View previous topic :: View next topic
|
Author |
Message |
Gousiya Mulla
New User
Joined: 02 Jun 2008 Posts: 87 Location: Bangalore
|
|
|
|
Hi I have requirement as below :
Copy the File1 into File2(having 30000 records, header and trailer) .
The File1 is having 500 (no header and trailers) records should be copied after the header record of the File2 .
Record length is same for File1 and File2 .
Can any one suggest any DFSORT/Sort JCL on this please ? |
|
Back to top |
|
|
Mazahar
New User
Joined: 11 Dec 2007 Posts: 82 Location: hyderabad
|
|
|
|
Gousiya,
can you please give example i/p and expected o/p and input file format and lrecl |
|
Back to top |
|
|
Gousiya Mulla
New User
Joined: 02 Jun 2008 Posts: 87 Location: Bangalore
|
|
|
|
Hi The information is as below :
File Format : VB
Rec Lenghth : 351
File 1:
AAAAAA
BBBBBB
File 2 :
REF-HDR 02.06.2009
CCCCCCC
DDDDD
TRAILER 2009.06.02
Output :
REF-HDR 02.06.2009
AAAAAA
BBBBBB
CCCCCCC
DDDDD
TRAILER 2009.06.02 |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for:
IN2 is the file with the header and trailer.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (VB/351-no header or trailer)
//IN2 DD DSN=... input file2 (VB/351-has header and trailer)
//OUT DD DISP=MOD,DSN=... output file (VB/351)
//TOOLIN DD *
SUBSET FROM(IN2) TO(OUT) KEEP FIRST INPUT
COPY FROM(IN1) TO(OUT)
SUBSET FROM(IN2) TO(OUT) REMOVE FIRST INPUT
/*
|
SUBSET requires the July, 2008 PTF. If you don't have that PTF, you can use the following DFSORT/ICETOOL job:
Code: |
//S2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (VB/351-no header or trailer)
//IN2 DD DSN=... input file2 (VB/351-has header and trailer)
//OUT DD DISP=MOD,DSN=... output file (VB/351)
//TOOLIN DD *
COPY FROM(IN2) TO(OUT) USING(CTL1)
COPY FROM(IN1) TO(OUT)
COPY FROM(IN2) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
OPTION STOPAFT=1
/*
//CTL2CNTL DD *
OPTION SKIPREC=1
/*
|
|
|
Back to top |
|
|
Gousiya Mulla
New User
Joined: 02 Jun 2008 Posts: 87 Location: Bangalore
|
|
|
|
Hi Frank ..
It has worked !!
thank u |
|
Back to top |
|
|
|