How can I import Cobol EBCDIC file definitions?

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
evanmaas
Charter Member
Charter Member
Posts: 60
Joined: Tue Apr 22, 2003 5:19 am
Location: Belgium

How can I import Cobol EBCDIC file definitions?

Post 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
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post 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
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
Amos.Rosmarin
Premium Member
Premium Member
Posts: 385
Joined: Tue Oct 07, 2003 4:55 am

Post 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
Peytot
Participant
Posts: 145
Joined: Wed Jun 04, 2003 7:56 am
Location: France

Post 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
evanmaas
Charter Member
Charter Member
Posts: 60
Joined: Tue Apr 22, 2003 5:19 am
Location: Belgium

Post 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
evanmaas
Charter Member
Charter Member
Posts: 60
Joined: Tue Apr 22, 2003 5:19 am
Location: Belgium

Post 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
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Post 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.
Developer of DataStage Parallel Engine (Orchestrate).
clshore
Charter Member
Charter Member
Posts: 115
Joined: Tue Oct 21, 2003 11:45 am

Post 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
sylvan_rydes
Participant
Posts: 47
Joined: Wed Apr 12, 2006 12:13 pm

Post 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
sylvan rydes
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sylvan_rydes
Participant
Posts: 47
Joined: Wed Apr 12, 2006 12:13 pm

Post 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.
sylvan rydes
clshore
Charter Member
Charter Member
Posts: 115
Joined: Tue Oct 21, 2003 11:45 am

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