Page 1 of 1

How can I import Cobol EBCDIC file definitions?

Posted: Tue Dec 09, 2003 9:47 am
by evanmaas
Hello,

I've no experience with Cobol EBCDIC files/file definitions.

The only thing I know is that cobol used packed fields

:?: How can I import Cobol EBCDIC file definitions in DataStage?
:?: How can I transform the EBCDIC file in an ASCII file, that you can read?

Thanxs,

Erik

Posted: Tue Dec 09, 2003 10:03 am
by roy
Hi,
well as far as I remember you need the dictionary files to obtain the schemes you need.
theese are files with the structure of the data you use and looks like:

Code: Select all

     01 .... 
        03 .... 
            05 .... PIC ...
and so on
as for ebcdic transforming to ascii you have the ascii() function, if memory serves me.

By the way did you read the 390 course book if not been to the course?

IHTH

Posted: Tue Dec 09, 2003 10:28 am
by Amos.Rosmarin
Hi there,

You import copy members not the data ....
You have to bring the copy book to the datastage server (by using file transfer or what ever method you use )
Then in the DS manager you have to import the copy book, there is an option in the import manu. Your copy must have a 01 level.

If you want to convert ebcidic to ascii, it depends on the platform you use for the trarget data. The projects I've been involved with usually use a shared disc (like HDS ) so the protocol is responsible for the translation.
Other option is to use a cobol routine in the MF or you have a DS routine in the open env. If you load your data to a RDBMS (either DB2 or Teradata) , the database will do it for you.


HTH,
Amos

Posted: Tue Dec 09, 2003 11:19 am
by Peytot
I don't know but if you have PX, use it only for making the transcription. With PX, you have only to choose EBCDIC to ASCII and in your output file, all is good.

If not, good luck,

Pey

Posted: Wed Dec 10, 2003 1:04 am
by evanmaas
Pey,

I don't know, what is PX?

Regards,

Erik
Peytot wrote:I don't know but if you have PX, use it only for making the transcription. With PX, you have only to choose EBCDIC to ASCII and in your output file, all is good.

If not, good luck,

Pey

Posted: Wed Dec 10, 2003 1:26 am
by evanmaas
Roy,

No, I didn't read the 390 course book. Do you know where I find this? Is this book online available?

Regards,

Erik


roy wrote:Hi,
well as far as I remember you need the dictionary files to obtain the schemes you need.
theese are files with the structure of the data you use and looks like:

Code: Select all

     01 .... 
        03 .... 
            05 .... PIC ...
and so on
as for ebcdic transforming to ascii you have the ascii() function, if memory serves me.

By the way did you read the 390 course book if not been to the course?

IHTH

Posted: Wed Dec 10, 2003 7:25 am
by Teej
evanmaas wrote:I don't know, what is PX?
Parallel Extender. It's one of the four major tools in the DataStage family, along with Server, 390, and TX.

-T.J.

Posted: Wed Dec 10, 2003 5:03 pm
by clshore
Importing copybook to an Orch schema is not difficult in PX, but OCCURS get converted to an array of subrecords, with a size field added before the array. And REDEFINES must be handled as variable record format.
Converting EBCDIC text to ASCII is easy. But numbers and dates are not text. Packed numbers are stored as 2 nibbles per byte, with the upper nibble of the last byte reserved for information relating to the sign, etc.
Dates, depending on the format, are split bitwise into components.
And floats (floats, why did it have to be floats!) are represented by mantissa, exponent, and sign fields, split along bit boundaries.

I have not used the 390 product, but I hope it handles these issues nicely.

Carter shore

Posted: Tue Jun 13, 2006 3:50 pm
by sylvan_rydes
I have been trying to import table definition for COBOL file layout
through manager. I was succenssful all the time. But this time even though the extract looks good but still I get this error : 01 level is not found. Even though the file has 01 level. I am giving you the sample here.
Image

Posted: Tue Jun 13, 2006 3:58 pm
by ray.wurlod
You must specify the column in which the 01 level item begins. By default it's set to column number 8. This is not the case with your FD.

Etiquette Note
It would have been better to start a new thread than to resurrect this very old one, even though the topic is accurate for your problem.

Posted: Tue Jun 13, 2006 4:02 pm
by sylvan_rydes
Thanks for reply. I even changed the default 8 before but still got the same result. I will try something else coz this thing was working before.

Thanks again.

Posted: Wed Jun 14, 2006 7:46 am
by clshore
ISTR a condition where the length of the element declaration was too long for the DataStage import job to handle, and so it missed the terminating period '.'.
In my case it was a particular problem with length of REDEFINES, as you have, try splitting the REDEFINES statement onto two lines instead of one, or delete leading whitespaces.

If that doesn't work, try shortening the 01 level identifier name.

Carter