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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Handling a field with SZZ9????

Status
Not open for further replies.

beebs

Programmer
Nov 1, 2000
1
CA
This question is kind of related to the Byte Usage of PIC S9.

I am doing a report layout (new to COBOL) and I am trying to get a minus sign at the end of my field using the S in the PIC clause, but I also need to use the Z in the PIC clause as well to get rid of any leading zeros, I have tried SZZ9 for a field length
of 3, but it seems not to like that syntax.

Any Suggestions??
 
Store it as S9(03) and define it in report as:

IN CODE MOVE IT TO REPORT FIELD

PIC --9 WILL FLOAT THE MINUS UP TO THE SIGNIFICANT DIGIT

PIC ZZ9 SIGN TRAILING SEPERATE
" " " LEADING "

PIC ZZ9CR FOR CREDIT
ETC...
 
MVANBRO is right, but didn't tell you the easiest picture string so I thought you might like to see it.

Try PIC ZZ9-

The S is for an internal sign only and minus is for a displayed sign. Since you are printing (the Z character) the compiler decided your characters were incompatible and gave you the message.

Betty Scherber
Brainbench MVP for COBOL II
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top