Page 1 of 2

Read EBCDIC file layout in Datastage

Posted: Mon Aug 30, 2010 2:40 am
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

Posted: Mon Aug 30, 2010 2:43 am
by anand_dafaria
Import the layout using COBOL file definitions....

Posted: Mon Aug 30, 2010 2:56 am
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

Posted: Mon Aug 30, 2010 2:57 am
by anand_dafaria
Can you paste some portion of the file layout......

Posted: Mon Aug 30, 2010 3:10 am
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.

Posted: Mon Aug 30, 2010 3:21 am
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 |

Posted: Mon Aug 30, 2010 3:25 am
by ray.wurlod
That is not a COBOL file definition.

COBOL file definition files tend to have ".CFD" for a name suffix.

Posted: Mon Aug 30, 2010 3:28 am
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

Posted: Mon Aug 30, 2010 3:31 am
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.

Posted: Mon Aug 30, 2010 3:37 am
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 .

Posted: Mon Aug 30, 2010 4:05 am
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_

Posted: Mon Aug 30, 2010 4:37 am
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.

Posted: Mon Aug 30, 2010 4:44 am
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.

Posted: Tue Aug 31, 2010 2:27 am
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

Posted: Tue Aug 31, 2010 2:59 am
by ray.wurlod
Change comma to pipe on the Format tab when importing.