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
 
How to merge files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 149
Location: Coimbatore

PostPosted: Tue Nov 24, 2009 12:03 pm    Post subject: How to merge files
Reply with quote

Hi,

I have a query on merging the files,

I have an input file 1:
123 ABDUL 85

I have an input file 2:
123 ABDUL FIRST

My output after merging needs to look like:
123 ABDUL 85 FIRST

but it look like,
123 ABDUL FIRST

The jcl i am using is,

//H1279CNA JOB ('SORTJCL'),MSGCLASS=O,TIME=(,9),NOTIFY=&SYSUID
//STEP01 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=H1279CN.SORT7.IN1,
// DISP=SHR
// DD DSN=H1279CN.SORT7.IN2,
// DISP=SHR
//OUT1 DD DSN=H1279CN.SORT7.OUT1,
// DISP=SHR
//TOOLIN DD *
SPLICE FROM(IN1) TO(OUT1) ON(1,3,CH) WITH(11,5)
/*

Is there any way to get my desired output ?. Can I use dfsort-OUTFIL to get it?
any suggestions?... plz
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8619
Location: Back in jolly old England

PostPosted: Tue Nov 24, 2009 12:42 pm    Post subject:
Reply with quote

This is a link to the DFSORT smart tricks documentation which has examples of splicing records.
Please click HERE to access it.

Because the solution for sort related questions may vary from product to product, please ensure that you state clearly which sort product you are using.

If you are not sure, then by running a simple sort step shown below, you will be able to find out for yourself.

If the messages start with ICE then your product is DFSORT. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.

If the messages start with WER or SYT then the product is SYNCSORT and should be posted in the JCL forum. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.

Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in you site.

Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY


What is the DSORG, RECFM & LRECL of both File 1 and File 2
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: Tue Nov 24, 2009 10:06 pm    Post subject:
Reply with quote

Abdul,

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//STEP01   EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//IN1      DD DSN=H1279CN.SORT7.IN1,
//            DISP=SHR
//IN2      DD DSN=H1279CN.SORT7.IN2,
//            DISP=SHR
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT1     DD DSN=H1279CN.SORT7.OUT1,
//            DISP=SHR
//TOOLIN   DD *
 COPY FROM(IN1) TO(T1)
 COPY FROM(IN2) TO(T1) USING(CTL2)
 SPLICE FROM(T1) TO(OUT1) ON(1,3,CH) WITH(14,5)
/*
//CTL2CNTL DD *
  INREC OVERLAY(14:11,5)
/*


Alternatively, with z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009), you can use this JOINKEYS job:

Code:

//S2    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//IN1      DD DSN=H1279CN.SORT7.IN1,
//            DISP=SHR
//IN2      DD DSN=H1279CN.SORT7.IN2,
//            DISP=SHR
//SORTOUT  DD DSN=H1279CN.SORT7.OUT1,
//            DISP=SHR
//SYSIN    DD    *
  JOINKEYS F1=IN1,FIELDS=(1,3,A)
  JOINKEYS F2=IN2,FIELDS=(1,3,A)
  REFORMAT FIELDS=(F1:1,13,F2:11,5)
  OPTION COPY
/*
Back to top
View user's profile Send private message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 149
Location: Coimbatore

PostPosted: Wed Nov 25, 2009 11:34 am    Post subject: Reply to: How to merge files
Reply with quote

I got the output. Thanks for your kind help.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 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 Finding difference between two PS fil... Vignesh Sid SYNCSORT 5 Mon Oct 30, 2017 1:13 pm
No new posts NDM 300 files from mainframe to linux shreya19 All Other Mainframe Topics 2 Thu Oct 26, 2017 11:40 am

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