In addition to PIC X, COBOL does have PIC N:  National characters.  These are 
basically UTF-16 characters.  (With the property alluded to by Charles Mills:  
these are fixed two byte data items.)  COBOL also offers DBCS characters.

Also, there are some UTF-8 functions such as ULEN that operate on PIC X strings 
treating them as UTF-8.

Here is my (and only my) random thought .... To really implement the Go scheme 
in COBOL, something about the standard use of the language would have to give.  
Practically speaking, you would lose a certain amount of control over the 
layout of storage.  If we had a PIC H(20).  (I used H because there is already 
a G and I wanted a type that is a Go Character type and H is the first letter 
after G.  So this declaration means "up to 20 Go Characters.")  Because we 
really can't use 4 bytes per character, we would need to have a pointer to the 
actual data.  That data would likely have to be dynamically managed (almost 
like Java objects.)  Also, in such a scheme, that 20 doesn't necessarily make 
sense.  (Maybe as a declared maximum, but if the string needs to be managed 
dynamically, it should also have a dynamic length.)  Doing something like this 
would take a fair bit of work to implement.  It would also change the idea that 
the programmer fully defines the shape of working storage.  (It's even more 
tricky to define such a data type in a file layout.)

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to