how to identify the COBOL PIC layout

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
kommven
Charter Member
Charter Member
Posts: 125
Joined: Mon Jul 12, 2004 12:37 pm

how to identify the COBOL PIC layout

Post 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.
chucksmith
Premium Member
Premium Member
Posts: 385
Joined: Wed Jun 16, 2004 12:43 pm
Location: Virginia, USA
Contact:

Post 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.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post 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.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post 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.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

By the way, did you check the Transforms under sdk -> Data Types?
kommven
Charter Member
Charter Member
Posts: 125
Joined: Mon Jul 12, 2004 12:37 pm

Post 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,
synbaadh
Participant
Posts: 3
Joined: Tue Jan 18, 2005 2:45 pm
Contact:

Post 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
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post 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.
synbaadh
Participant
Posts: 3
Joined: Tue Jan 18, 2005 2:45 pm
Contact:

Post 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.
Post Reply