complex flat file

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
logic
Participant
Posts: 115
Joined: Thu Feb 24, 2005 10:48 am

complex flat file

Post by logic »

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.
Last edited by logic on Wed Jun 29, 2005 10:42 am, edited 1 time in total.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

The field you see is not a COMP field. It is decimal with implied sign and decimal value.
logic
Participant
Posts: 115
Joined: Thu Feb 24, 2005 10:48 am

Post by logic »

Hello Sai,
So even if I do not define the sign as leading it would not matter...right?
Thanks


Sainath.Srinivasan wrote:The field you see is not a COMP field. It is decimal with implied sign and decimal value.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Logic,

Cobol fields are stored as clear-text except when they have an explicit "COMP" attached to the picture. The
S9(6)V9(4) SIGN IS LEADING
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.

The PICture for
USAGE QUAD SCALE -2
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.
Post Reply