View previous topic :: View next topic
|
Author |
Message |
rsshanmugam
New User
Joined: 08 Mar 2005 Posts: 62 Location: Basildon
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can do this with the SPLICE operator of DFSORT's ICETOOL. This Smart DFSORT Trick shows the technique to use:
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 |
|
|
narayan_sug Warnings : 1 New User
Joined: 08 Jun 2005 Posts: 1
|
|
|
|
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 |
|
|
mcmillan
Site Admin
Joined: 18 May 2003 Posts: 1210 Location: India
|
|
|
|
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 |
|
|
|