Hi gurus,
I am trying to read a complex flat file in ds. I have a field which has defination "S9(6)V9(4) SIGN IS LEADING"
I am not at all a COBOL person..but i understand that this is a decimal (comp3)field. but when I try to define the sign field for the decimal DS prompts me saying that sign field should be blank for decimal. I also tried defining the field as binary and usage as comp but then it will not let me define the scale...
Also i have another field with defination "USAGE QUAD SCALE -2"..I defined this field usage as COMP but again i could not define the scale..I could define the scale when i define the usage as comp 2 but can specify the scale as 2 would it be different han -2..i hope not..
Any help would of "help"
Thanks,
Ash.
complex flat file
Moderators: chulett, rschirm, roy
complex flat file
Last edited by logic on Wed Jun 29, 2005 10:42 am, edited 1 time in total.
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Logic,
Cobol fields are stored as clear-text except when they have an explicit "COMP" attached to the picture. The
The PICture for
Cobol fields are stored as clear-text except when they have an explicit "COMP" attached to the picture. The
produces data such as '-3625418671' - a leading sign either - or space, plus 9 digits with the decimal point being assumed to be between positions 6 and 7.S9(6)V9(4) SIGN IS LEADING
The PICture for
is more complicated; this is not an ISO/ANSII standard datatype, but is most likely an extension by the compiler manufacturer. It is most certainly a binary field, and quad-precision floating point datatypes are pretty well standardized. You do need to know how many bytes are used by this PICture clause; I would try a float() and with the appropriate length. It might be that this datatype cannot be easily parsed, in which case you could "fake" the stage by declaring a CHAR() column of the same length.USAGE QUAD SCALE -2