Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help how to code square brackets in COBOL

Status
Not open for further replies.

Nivas15

Programmer
Mar 9, 2008
1
0
0
US
Hi, How can I code the square brackets ([ and ]) in COBOL. I used X'BA and X'BD, but it does not work. Please help. Thanks.
 
I don't have the system available to test, but are you sure these are not considered unprintable characters, and therefore are not displayed?
 
According to this source the EBCDIC codes for left and right brackets are: x'BA' and x'BB', respectively.

In ASCII, they would be x'5B' and x'5D'.

Code what you mean,
and mean what you code!
But by all means post your code!

Razalas
 
I think the brackets are a bit of a moveable feast, depending on which code page you are using. In my green card (actually a little blue book nowadays) they are listed as BA and BD but on my current system (code page 500) they are BA and BB.

They show up fine on a CICS terminal, but if you write them to a TDQ sysout destination, they are unreadable under SDSF and show up as blanks. Which can be a bit confusing...

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top