how to identify the COBOL PIC layout
Moderators: chulett, rschirm, roy
how to identify the COBOL PIC layout
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.
+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.
-
- Premium Member
- Posts: 385
- Joined: Wed Jun 16, 2004 12:43 pm
- Location: Virginia, USA
- Contact:
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.
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.
Chuck Smith
www.anotheritco.com
www.anotheritco.com
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
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.
*******
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.
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
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,
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,
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
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.
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.
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.