How to Load Mainframe file in a table

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

Post Reply
shamshad
Premium Member
Premium Member
Posts: 147
Joined: Wed Aug 25, 2004 1:39 pm
Location: Detroit,MI

How to Load Mainframe file in a table

Post by shamshad »

Below is the Mainframe Layout that I have to pull the data from:-

01 MSX-OUT-STOCK-REC.
05 MSX-STKOUT-DIVISION PIC X(01)
05 MSX-STKOUT-LEVEL1-REGION PIC X(02)
05 MSX-STKOUT-ORDER-TYPE PIC X(03)
05 MSX-STKOUT-VEH-LINE PIC X(04)
05 MSX-STKOUT-MODEL-YEAR PIC X(04)
05 MSX-STKOUT-PROCESS-YEAR PIC X(04)
05 MSX-STKOUT-PROCESS-MONT PIC X(02)
05 MSX-STKOUT-PROCESS-DATE PIC X(10)
05 MSX-STKOUT-UMR-A PIC S9(9) USAGE COMP.
05 MSX-STKOUT-UMR-B PIC S9(9) USAGE COMP.
05 MSX-STKOUT-UMR-C PIC S9(9) USAGE COMP.
05 MSX-STKOUT-UMR-D PIC S9(9) USAGE COMP.
05 MSX-STKOUT-UMR-E PIC S9(9) USAGE COMP.
05 MSX-STKOUT-UMR-F PIC S9(9) USAGE COMP.
05 MSX-STKOUT-UMR-G PIC S9(9) USAGE COMP.
05 MSX-STKOUT-UMR-H PIC S9(9) USAGE COMP.
05 MSX-STKOUT-UMR-I PIC S9(9) USAGE COMP.
05 MSX-STKOUT-UMR-J PIC S9(9) USAGE COMP.
05 MSX-STKOUT-UMR-K PIC S9(9) USAGE COMP.
05 MSX-STKOUT-UMR-L PIC S9(9) USAGE COMP.
05 MSX-STKOUT-UMR-M PIC S9(9) USAGE COMP.
05 MSX-STKOUT-UMR-N PIC S9(9) USAGE COMP.
05 MSX-STKOUT-UMR-O PIC S9(9) USAGE COMP.


I have to read the data from mainframe file and load the data into a table. I don't have access to COBOL COPY BOOKS.

Question

In Parallel Extender, how should I design the job and handle the USAGE COMP field?

If need be, I can even design a server job if parallel won't do.

Any help greatly appreciated.
prasadduvasi
Participant
Posts: 19
Joined: Wed Feb 15, 2006 11:08 am

Post by prasadduvasi »

In Datastage Designer go to the repository then right click on table definitions--->import--->COBOL file definitions then it'll popup a window to select copybook relevent to table definition, select copybook and import tabledefinition.
Prasad Duvasi
shamshad
Premium Member
Premium Member
Posts: 147
Joined: Wed Aug 25, 2004 1:39 pm
Location: Detroit,MI

Post by shamshad »

I don't have COPY BOOK.....
prasadduvasi
Participant
Posts: 19
Joined: Wed Feb 15, 2006 11:08 am

Post by prasadduvasi »

the mainframe layout shown in your post itself is copybook
if it is a text file,then you need to save it as .cfd extension file

make sure that the cfd file to have 01 level in eight column

better go to google n search for cobol file definaition and you'll understand well the cobol file format
Prasad Duvasi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You don't actual need the A margin (where the level 01 item begins) to be in column #8 - that's just a convention. You can tell the import process where the A margin is. Similarly, the B margin is conventionally four places indented from the A margin - so, if your level 01 item begins in column #8 then your level 05 items should begin in column #12.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
shamshad
Premium Member
Premium Member
Posts: 147
Joined: Wed Aug 25, 2004 1:39 pm
Location: Detroit,MI

Post by shamshad »

Thank You for your responses. I was able to IMPORT the COBOL DEFINITION into my METADATA.

Question:

In the FTP Plug-in stage, through which I am reading my mainframe file, I have designed my PIC X columns as VARCHAR.

What should be the COLUMN NAME & TYPE for the PIC S9(9) USAGE COMP columns?
prasadduvasi
Participant
Posts: 19
Joined: Wed Feb 15, 2006 11:08 am

Post by prasadduvasi »

You can directly load the metadata from table definitions in FTP plug-in stage
Prasad Duvasi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Open the table definition in Manager or Designer Repository view. Choose the Layout tab. View the metadata as SQL, COBOL or Orchestrate schema format. But it's all the same metadata. And you can answer your question about PIC S9(9) USAGE COMP.
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