Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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
View previous topic :: :: View next topic  
Author Message
Gousiya Mulla

New User


Joined: 02 Jun 2008
Posts: 87
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

Mazahar

New User


Joined: 11 Dec 2007
Posts: 82
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: 87
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: 7130
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: 87
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us