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
 

 

Want to merge these two files with sort utility vertically

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rsshanmugam

New User


Joined: 08 Mar 2005
Posts: 54
Location: Chennai

PostPosted: Tue Jun 07, 2005 5:54 pm    Post subject: Want to merge these two files with sort utility vertically
Reply with quote

Important interview question.

i have two vsam file one with 100 bytes length and other with 50 byte length,

i want to merge these two files only with sort utility in vertical manner and the resultant file should have 150 bytes only.

can any one suggest ans for this, this should be done only thru jcl ie to use only sort utility.
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Jun 08, 2005 4:34 am    Post subject: Re: jcl interview question
Reply with quote

I'm going to move this post to the DFSORT forum. But, FYI, this same question was just asked and answered yesterday and, I believe, last week. Try a search in the DFSORT forum for SPLICE.
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: Wed Jun 08, 2005 6:03 am    Post subject:
Reply with quote

You can do this with the SPLICE operator of DFSORT's ICETOOL. This Smart DFSORT Trick shows the technique to use:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst03.html#t01

In your case, with input file1 having 100 byte records and input file2 having 50 byte records, the job would look like this. Note that I've used VSAMTYPE(F) to tell DFSORT to process the VSAM files as fixed (I'm assuming all of the records in file1 have 100 bytes and all of the records in file2 have 50 bytes):

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1    DD DSN=...  input file1
//IN2    DD DSN=...  input file2
//TMP1   DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT    DD DSN=...  output file
//TOOLIN DD *
* Reformat the IN1 data set so it can be spliced
 COPY FROM(IN1) TO(TMP1) USING(CTL1) VSAMTYPE(F)
* Reformat the IN2 data set so it can be spliced
 COPY FROM(IN2) TO(TMP1) USING(CTL2) VSAMTYPE(F)
* Splice records with matching sequence numbers.
 SPLICE FROM(TMP1) TO(OUT) ON(151,8,PD) WITH(101,50) USING(CTL3)
/*
//CTL1CNTL DD *
* Use OUTREC to create: |f1fld|blank|seqnum|
  OUTREC FIELDS=(1:1,100,151:SEQNUM,8,PD)
/*
//CTL2CNTL DD *
* Use OUTREC to create: |blank|f2fld|seqnum|
  OUTREC FIELDS=(101:1,50,151:SEQNUM,8,PD)
/*
//CTL3CNTL DD *
* Use OUTFIL OUTREC to remove the sequence number
 OUTFIL FNAMES=OUT,OUTREC=(1,150)
/*
Back to top
View user's profile Send private message
narayan_sug
Warnings : 1

New User


Joined: 08 Jun 2005
Posts: 1

PostPosted: Wed Jun 08, 2005 10:35 am    Post subject: give me answer for it
Reply with quote

hello, i have done my b.tech and also completed my mainframe course.
i am looking for a job. i think. not much opportunities on mainframes skills?
what do you think about it? sis it right or not?
Back to top
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1202
Location: India

PostPosted: Wed Jun 08, 2005 12:51 pm    Post subject:
Reply with quote

Quote:
hello, i have done my b.tech and also completed my mainframe course.
i am looking for a job. i think. not much opportunities on mainframes skills?
what do you think about it? sis it right or not?


Start a New Topic for that in "Off Topic" Forum...Before that Read Forum Rules now to avoid getting any more warnings in future.
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 TAPE VERIFY utility?? MrExtraordinare JCL & VSAM 3 Fri Dec 09, 2016 10:57 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


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