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
 

 

2 files to a single output file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: 2 files to a single output file
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    Post subject:
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 Moderator


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

PostPosted: Thu Dec 03, 2009 11:33 pm    Post subject:
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:

http://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    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 Data replication from multiple Db2 ta... kishpra DB2 1 Mon Mar 27, 2017 9:58 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 3 Mon Mar 27, 2017 3:59 pm
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm


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