Page 1 of 1

Obtaining File Length and Passing it to the next Job Step

PostPosted: Wed Dec 03, 2014 9:15 pm
by jois0321
Hi,
I need your expertise.
I have a JOB that unloads DB2 Table into a Flat File. However, the DB2 Table Structure keeps on changing, that is, additional columns keeps on changing the layout of the file.
The issue here is that, we manually change the record length of the file whenever there's a change in Table Structure (e.g. ADD New Column). Before loading back the unloaded file after Data Patching is done.
E.g.
STEP01 (Unload DB2 Table into a Flat FIle, UNLOAD FILE) -- new column is added
STEP02 (Program will be run to do the patching on some columns of UNLOAD FILE, and output it into PATCHED File)
STEP03 (LOAD PATCHED File into the DB2 Table)

To Automate the PROCESS :
In STEP01, I need to KNOW the RECORD Length of the newly formatted File (UNLOAD FILE). ---> HOW???
Once I obtain the RECLEN, I need to replaced the old FILE Length with the New File Length so I can LOAD the PATCHED File Correctly. ---> HOW???

I am thinking of adding 2 Job Steps,
First : to obtain Record Length of the File, save it to a variable, then pass it to Second Step.
Second : Will retrieve the Record Length variable result from First Step, and the rest of the process will be the same.

Kindly advise me, as to how to go about it.

Thank you for your help.

Re: Obtaining File Length and Passing it to the next Job Ste

PostPosted: Wed Dec 03, 2014 9:28 pm
by enrico-sorichetti
is the record format FIXED or VARIABLE ???

Re: Obtaining File Length and Passing it to the next Job Ste

PostPosted: Wed Dec 03, 2014 10:41 pm
by jois0321
Record Format is Fixed.