Obtaining File Length and Passing it to the next Job Step



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Obtaining File Length and Passing it to the next Job Step

Postby jois0321 » Wed Dec 03, 2014 9:15 pm

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.
jois0321
 
Posts: 2
Joined: Wed Dec 03, 2014 7:14 pm
Has thanked: 0 time
Been thanked: 0 time

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

 

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

Postby enrico-sorichetti » Wed Dec 03, 2014 9:28 pm

is the record format FIXED or VARIABLE ???
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

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

Postby jois0321 » Wed Dec 03, 2014 10:41 pm

Record Format is Fixed.
jois0321
 
Posts: 2
Joined: Wed Dec 03, 2014 7:14 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post