Page 1 of 1

How to read PIC -9.9 in complex flat file

Posted: Wed Nov 13, 2013 10:42 pm
by sheema
In the cobol file definition provided one of the columns provided is PIC-9.9.
But the complex flat file stage was not able to import this column.
Can some one please let me know how this column can be imported.
I am getting the below error
'PIC' PICTURE character string format is invalid.

Posted: Wed Nov 13, 2013 10:46 pm
by chulett
Hmmm... I'd try changing the FD to show PIC S9.9 for that column and see if that works.

Posted: Thu Nov 14, 2013 1:42 am
by ray.wurlod
"-" is not correct for showing a signed number. "S" is.

Re: How to read PIC -9.9 in complex flat file

Posted: Thu Nov 14, 2013 11:03 am
by shiva459
Declaring the data type as PIC +9.9 or PIC -9.9 is perfectly valid in Cobol world but DS is not able read it.Change the copy book to PIC X(4) for that field and try reading the source file.

Re: How to read PIC -9.9 in complex flat file

Posted: Fri Nov 15, 2013 1:45 pm
by FranklinE
That's correct for Cobol, but I don't recommend changing the format type for the column. Adjust the numeric formatting first as Ray suggests, and change to Char only if it doesn't work.

Re: How to read PIC -9.9 in complex flat file

Posted: Sat Nov 16, 2013 5:37 am
by shiva459
Problem is not with the sign but '.' DataStage table definition import somehow is not able to read the real decimal. Changing it to S9(1).9(1) or S9.9 will not work