View previous topic :: View next topic
|
Author |
Message |
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
Hi all,
I am having an input file which contains Header, trailer, Title an Data Part.
Could you guys please help me to get only the Data portion of the file into one file. For e.g:
Code: |
The Report
Dated : 23/02/2008
SL No;Report Numeber;values
1;123456;2000
2;256488;2330
3;598654;1254
Total No - 3
|
So my o/p Should be like below,
Code: |
1;123456;2000
2;256488;2330
3;598654;1254
|
Simillarly i just need another Sort card which will do the Vice versa,
Input File- 1
Code: |
a;aaaaaa;1234
b;vvvvvv;2330
C;zzzzzz;1254
|
Input File 2
Code: |
The Report
Dated : 23/02/2008
SL No;Report Numeber;values
1;123456;2000
2;256488;2330
3;598654;1254
Total No - 3
|
So my output should be like below,
Code: |
The Report
Dated : 23/02/2008
SL No;Report Numeber;values
a;aaaaaa;1234
b;vvvvvv;2330
C;zzzzzz;1254
Total No - 3
|
That is it will copy the Data from File 2 and the header and trailer stuffs from File 1 and put in the O/P File.
Let all the files are Of FB and having LRECL=80.
If somebody is having sample sort cards please help me. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
How do we identify the "header and trailer stuffs" programmatically?
Is it the first three records and last record, or the records that don't have a semicolon in position 2, or what? |
|
Back to top |
|
|
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
Hi Frank,
Thanks for ur reply.
yes, It is the First three and the last record itself. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT/ICETOOL job like the following for your first requirement:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT DD DSN=... output file
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) REMOVE INPUT FIRST(3) LAST
/*
|
You can use a DFSORT/ICETOOL job like the following for your second requirement. Make sure OUT is a MOD data set.
Code: |
//S2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (has new data)
//IN2 DD DSN=... input file2 (has header/old data/trailer)
//*** OUT MUST BE A MOD DATA SET
//OUT DD DISP=MOD,DSN=... output file (has header/new data/trailer)
//TOOLIN DD *
SUBSET FROM(IN2) TO(OUT) KEEP INPUT FIRST(3)
COPY FROM(IN1) TO(OUT)
SUBSET FROM(IN2) TO(OUT) KEEP INPUT LAST
/*
|
|
|
Back to top |
|
|
|