Page 1 of 1

how to identify the COBOL PIC layout

Posted: Wed Jan 19, 2005 7:54 am
by kommven
The data looks like

+0000079.600{0
+0000407.085{0
+0000078.840{0
+0000075.240{0
+0000129.240{0


definition is PIC S9(7)V9(5)

Is there any avlb. SDK to make the Tran. into decimal that can readily loadable into Oracle?

Immedaite help req. and highly appreciated.

Unable to use DataTypePicS9(Link) Trans.

Kommu.

Posted: Wed Jan 19, 2005 8:40 am
by chucksmith
You can only guess. You know the the{ is the end of a column, but you do not know its starting column.

Is the + found in your source data?

Look at my Create a hax/ascii dump of an ebcdic cobol file tool. It may help you identify the start and end of comp-3 fields.

You can find my tools on the DataStage Tools page of www.anotheritco.com.

Posted: Wed Jan 19, 2005 8:54 am
by Sainath.Srinivasan
Stick the following into a routine and call it wherever needed

*******
SignField = Arg1[1, 1]

RestField = Arg1[ 2, len(Arg1) - 1]

ValueField = Field(RestField, '{', 1) : '0' Field(RestField, '}', 2)

If SignField = '+' Then Ans = ValueField
Else Ans = -1 * ValueField
********

Before proceeding can you please let me know what values you get if the 4th decimal place is non-zero and what is the max value (high values) entered for this field.

Posted: Wed Jan 19, 2005 8:56 am
by Sainath.Srinivasan
Just a change that both sign should be '}' identical to the one in the values provided by you.

Also I very much doubt that the values you provided can be considered as an exhaustive list. So more investigation is required.

Posted: Wed Jan 19, 2005 9:00 am
by Sainath.Srinivasan
By the way, did you check the Transforms under sdk -> Data Types?

Posted: Wed Jan 19, 2005 9:40 am
by kommven
I figured it, the layout is PIC S9 and works fine SDK provided with DS. The mistake I was running was with Fixed width definition. There were some extra characters in the length while defining.


Srinivasan and Chuck thanks for u r time and help.

Chuck u r approach is to create a dump file, which will retard my performance on a file of apprx. 3.5 million rows and 90 col's.

Yes Srinivas I checked the SDK in DS and it worked. The code you provided waS INTERESTING. I'll let you know after I proceed...

Kommu,

Posted: Wed Jan 19, 2005 9:59 am
by synbaadh
Sainath.Srinivasan wrote:By the way, did you check the Transforms under sdk -> Data Types?

Hey Sai,

Can you let me know from where and how i can use the SDK transforms/data types ... ?

Thanks,
syn

Posted: Wed Jan 19, 2005 10:09 am
by Sainath.Srinivasan
You can use the transforms in your DataStage job. You can include the relevant transform when editing the derivation of a column.

To see the transforms available, log to DataStage Manager and go to
Transforms -> sdk -> DataType.

All transforms located under 'Transforms' link are available for use in DataStage.

Posted: Wed Jan 19, 2005 10:26 am
by synbaadh
Sainath.Srinivasan wrote:You can use the transforms in your DataStage job. You can include the relevant transform when editing the derivation of a column.

To see the transforms available, log to DataStage Manager and go to
Transforms -> sdk -> DataType.

All transforms located under 'Transforms' link are available for use in DataStage.

Thanks Sai,that was informative.
Regards.