Page 1 of 1

Cobol Datatype PIC 9(003) vs PIC S9(3)

PostPosted: Mon Nov 05, 2007 3:09 pm
by riship
Hi,
I would like to know if PIC 9(003) is represented/same as PIC S9(3)

Thanks in advance.

Regards,
Rishi.

Re: Cobol Datatype

PostPosted: Mon Nov 05, 2007 4:03 pm
by CICS Guy
riship wrote:I would like to know if PIC 9(003) is represented/same as PIC S9(3)
Almost, the 'S' forces COBOL to deal with each just a little differentl.
If I recall correctly, when data is moved into the field without the sign, COBOL will insure the last byte (where the sign is stored) has a positive sign.

Re: Cobol Datatype PIC 9(003) vs PIC S9(3)

PostPosted: Tue Nov 06, 2007 4:14 am
by dick scherrer
Hello,

COBOL will insure the last byte (where the sign is stored) has a positive sign.
If the field is S9(3), cobol will generate a "C" sign. If the field is 9(3), cobol should generate an "F" sign. Both C and F are positive. A "D" sign is negative.

Re: Cobol Datatype PIC 9(003) vs PIC S9(3)

PostPosted: Wed Nov 07, 2007 11:02 am
by kanswa_boy
hi ,
they both vil take 3 bytes.u knw the sign is store in 'sign trailing ' format it is by default.
lik d no. is -321 so it stores lik 32(-1) tat vil become 32J.
according to zoned decimal form +1=A
+2=B nd so on......
nd -1 =J
-2 =K
girish kanswa
FCIL INDIA