IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Copy a file1 into File2 , where File2 is with header,trailer


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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 Developer


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

PostPosted: Thu Jul 02, 2009 9:39 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts DB2 Table - Image copy unload IBM Tools 2
Search our Forums:

Back to Top