Page 1 of 1

How to Load Mainframe file in a table

Posted: Tue Jun 19, 2007 12:01 pm
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.

Posted: Tue Jun 19, 2007 12:56 pm
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.

Posted: Tue Jun 19, 2007 1:13 pm
by shamshad
I don't have COPY BOOK.....

Posted: Tue Jun 19, 2007 1:25 pm
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

Posted: Tue Jun 19, 2007 3:20 pm
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.

Posted: Wed Jun 20, 2007 8:15 am
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?

Posted: Wed Jun 20, 2007 11:35 am
by prasadduvasi
You can directly load the metadata from table definitions in FTP plug-in stage

Posted: Wed Jun 20, 2007 5:38 pm
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.