Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am
No new posts Updating multiple counts in trailer!! Vignesh Sid SYNCSORT 4 Mon Nov 06, 2017 1:04 pm
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts XMITIP sends it out. Can it copy on l... Rommel Dayon Rustia IBM Tools 0 Tue Sep 05, 2017 10:16 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us