Read EBCDIC file layout in Datastage

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

Arpanakhade2009
Participant
Posts: 30
Joined: Tue Sep 08, 2009 4:24 am

Read EBCDIC file layout in Datastage

Post by Arpanakhade2009 »

Hi,
We have received an Layout file of an ebcdic file. We can open the layout file in textpad to view the column and its details.

Can anyone please let me know, how can we import the layout file in Datastage to load the column details of the ebcdic file.


Thnx
Arpana
anand_dafaria
Premium Member
Premium Member
Posts: 36
Joined: Wed Dec 27, 2006 3:50 am
Location: Phoenix

Post by anand_dafaria »

Import the layout using COBOL file definitions....
Arpanakhade2009
Participant
Posts: 30
Joined: Tue Sep 08, 2009 4:24 am

Post by Arpanakhade2009 »

The layout file "Download" does not have any extension.
And while importing via COBOL it prompts for below error.

File Contains no table definition (01 level is not found). C:\............\Download
anand_dafaria
Premium Member
Premium Member
Posts: 36
Joined: Wed Dec 27, 2006 3:50 am
Location: Phoenix

Post by anand_dafaria »

Can you paste some portion of the file layout......
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Probably your COBOL FD has the level 01 item (A margin) other than in column #8 (the default). You have to tell the importer in which column the level 01 item appears.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Arpanakhade2009
Participant
Posts: 30
Joined: Tue Sep 08, 2009 4:24 am

Post by Arpanakhade2009 »

Some file portion:

***** ABC TESTING ***** 20/08/10 at 3:43 pm
SY039 F I L E L A Y O U T U T I L I T Y Page.: 1
Library: PLDUSRA File: YELBOK Selection: YELBOK____
*USRLIBL__
Record : RYELBOK Text: YEL Book
Length : 349 Type: Physical file Access path: Keyed FIFO Unique
__Field_text_____________________Key_#__Field_name__Start__End__Typ__Len__Dec_
| | | | | | | | |
| Branch | 01 A | BRK | 1 | 2 | A | 2 | |
| | | | | | | | |
| Product Type | 02 A | TYK | 3 | 5 | A | 3 | |
| | | | | | | | |
| Number | 03 A | NOK | 6 | 12 | S | 7 | 0 |
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That is not a COBOL file definition.

COBOL file definition files tend to have ".CFD" for a name suffix.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Arpanakhade2009
Participant
Posts: 30
Joined: Tue Sep 08, 2009 4:24 am

Post by Arpanakhade2009 »

Agreed that the file does not have ".CFD" suffix. But based on teh code what can be teh file type.
And howcan read these columns
anand_dafaria
Premium Member
Premium Member
Posts: 36
Joined: Wed Dec 27, 2006 3:50 am
Location: Phoenix

Post by anand_dafaria »

You need to give the file layout snapshot and not the actual file here. For reading binay files there is a separate Cobol file definition file (not necessarily having .cfd extension) which needs to be imported using "Import Cobol file definition" option.
Arpanakhade2009
Participant
Posts: 30
Joined: Tue Sep 08, 2009 4:24 am

Post by Arpanakhade2009 »

The text which i have pasted above is teh one seen via textpad.
You will be able to see the same via snapshot .
anand_dafaria
Premium Member
Premium Member
Posts: 36
Joined: Wed Dec 27, 2006 3:50 am
Location: Phoenix

Post by anand_dafaria »

Looks like you have a pipe delimited sequential file. try getting rid of the below portion before reading the entire file.
***** ABC TESTING ***** 20/08/10 at 3:43 pm
SY039 F I L E L A Y O U T U T I L I T Y Page.: 1
Library: PLDUSRA File: YELBOK Selection: YELBOK____
*USRLIBL__
Record : RYELBOK Text: YEL Book
Length : 349 Type: Physical file Access path: Keyed FIFO Unique
__Field_text_____________________Key_#__Field_name__Start__End__Typ__Len__Dec_
Arpanakhade2009
Participant
Posts: 30
Joined: Tue Sep 08, 2009 4:24 am

Post by Arpanakhade2009 »

Modified the file as below but the same error.

| Branch | 01 A | POLBRK | 1 | 2 | A | 2 | |
| | | | | | | | |
| Product Type | 02 A | POLTYK | 3 | 5 | A | 3 | |
| | | | | | | | |
| Number | 03 A | POLNOK | 6 | 12 | S | 7 | 0 |

Can you please let me know what is the expected format when seen in textpad.
anand_dafaria
Premium Member
Premium Member
Posts: 36
Joined: Wed Dec 27, 2006 3:50 am
Location: Phoenix

Post by anand_dafaria »

From the designer Use Import>Table Definitions>Sequential File Definitions
Select directory containing your modified file and sucessively the file and then check the format which comes then by default edit the metadata where required and save it. Use sequential file stage then to read the modified file with the metadat saved.
Arpanakhade2009
Participant
Posts: 30
Joined: Tue Sep 08, 2009 4:24 am

Post by Arpanakhade2009 »

The modified file is as below:

| Branch | 01 A | POLBRK | 1 | 2 | A | 2 | |
| | | | | | | | |
| Product Type | 02 A | POLTYK | 3 | 5 | A | 3 | |
| | | | | | | | |
| Number | 03 A | POLNOK | 6 | 12 | S | 7 | 0 |

When i try to import the file as sequential file definition, by default in the format tab, all the checkboxes are unchecked ; except delimeter is defaulted to comma.

But when i try to see the metadata in define's tab, i can see only 1 column Field001. But when i try to load he table definition in Complex flat file stage it prompts no rows returned. But the file is of 20000 bytes

When i update teh delimeter to |, i can see 10 fields. But when i try to load he table definition in Complex flat file stage it prompts with below error:

##E IIS-DSEE-TOIX-00179 13:00:52(010) <I90_ADRCLM,0> Import error at record 1.


Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Change comma to pipe on the Format tab when importing.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply