Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Copy a file1 into File2 , where File2 is with header,trailer

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
Gousiya Mulla

New User


Joined: 02 Jun 2008
Posts: 62
Location: bangalore

PostPosted: Thu Jul 02, 2009 1:38 pm    Post subject: Copy a file1 into File2 , where File2 is with header,trailer
Reply with quote

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
View user's profile Send private message
References
Mazahar

New User


Joined: 11 Dec 2007
Posts: 70
Location: hyderabad

PostPosted: Thu Jul 02, 2009 2:27 pm    Post subject:
Reply with quote

Gousiya,

can you please give example i/p and expected o/p and input file format and lrecl
Back to top
View user's profile Send private message
Gousiya Mulla

New User


Joined: 02 Jun 2008
Posts: 62
Location: bangalore

PostPosted: Thu Jul 02, 2009 2:32 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 6001
Location: San Jose, CA

PostPosted: Thu Jul 02, 2009 9:39 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Gousiya Mulla

New User


Joined: 02 Jun 2008
Posts: 62
Location: bangalore

PostPosted: Fri Jul 03, 2009 4:22 pm    Post subject:
Reply with quote

Hi Frank ..

It has worked !!

thank u
Back to top
View user's profile Send private message
Splitted: Fri Jul 03, 2009 8:09 pm by Frank Yaeger From Topic Copy a file1 into File2 , where File2 is with header,trailer (DFSORT/ICETOOL)
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1