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

2 files to a single output file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Praanu

New User


Joined: 27 Mar 2009
Posts: 8
Location: chennai

PostPosted: Thu Dec 03, 2009 6:46 pm
Reply with quote

Hi,

I have two files each with lrecl 5

I need my output file to be of 10 bytes..

Output file should have 1-5 (first file 5 bytes) and 6-10 ( second file 5 bytes)

There no comparison for file two.. its should just be copied in the order

Please find the example:

file 1 data:
12345
45678
34534
12325

file 2 data:
abcdf
bhgty
werty
pooit

output file:
12345abcdf
45678bhgty
34534werty
12325pooit

how can this be done using SORT..
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Dec 03, 2009 7:24 pm
Reply with quote

Search the DFSORT forum. I remember Frank has already given the solution exactly for this.
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 Dec 03, 2009 11:33 pm
Reply with quote

With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009), you can use JOINKEYS to do this as follows:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTJNF1 DD DSN=...  input file1 (FB/5)
//SORTJNF2 DD DSN=...  input file2 (FB/5)
//SORTOUT DD DSN=...  output file (FB/10)
//SYSIN    DD    *
  SORT FIELDS=COPY
  JOINKEYS FILE=F1,FIELDS=(6,8,A),SORTED,NOSEQCK
  JOINKEYS FILE=F2,FIELDS=(6,8,A),SORTED,NOSEQCK
  REFORMAT FIELDS=(F1:1,5,F2:1,5)
//JNF1CNTL DD *
  INREC OVERLAY=(6:SEQNUM,8,ZD)
//JNF2CNTL DD *
  INREC OVERLAY=(6:SEQNUM,8,ZD)
/*


For complete details on date conversion functions and the other new functions available with the Nov, 2009 DFSORT PTF, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174

If you don't have the Nov, 2009 DFSORT PTF, you can use a DFSORT/ICETOOL job like the following:

Code:

//S2    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG   DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/5)
//IN2 DD DSN=...  input file2 (FB/5)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/10)
//TOOLIN   DD    *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(11,8,ZD) WITH(6,5) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(11:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
  INREC BUILD=(6:1,5,11:SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,BUILD=(1,10)
/*

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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top