Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
Prasanthhere

Active User

Joined: 03 Aug 2005
Posts: 306

 Posted: Tue Jul 18, 2006 11:33 pm    Post subject: Question regarding Splicing in DFSORT SELECT FROM(IN1) TO(F1) ON(1,10,CH) FIRST SELECT FROM(IN2) TO(F1) ON(1,10,CH) FIRST SELECT FROM(F1) TO(T1) ON(1,10,CH) FIRSTDUP USING(CTL1) SELECT FROM(F1) TO(T1) ON(1,10,CH) NODUPS USING(CTL2) COPY FROM(IN1) TO(T1) USING(CTL3) COPY FROM(IN2) TO(T1) USING(CTL4) SPLICE FROM(T1) TO(OUT1) ON(1,10,CH) - WITHALL WITH(1,21) USING(CTL5) //CTL1CNTL DD * OUTFIL FNAMES=T1,OUTREC=(1,20,21:C'DD') /* //CTL2CNTL DD * OUTFIL FNAMES=T1,OUTREC=(1,20,21:C'UU') /* //CTL3CNTL DD * OUTFIL FNAMES=T1,OUTREC=(1,20,21:C'11') /* //CTL4CNTL DD * OUTFIL FNAMES=T1,OUTREC=(1,20,21:C'22') /* //CTL5CNTL DD * OUTFIL FNAMES=OUT1,INCLUDE=(21,2,CH,EQ,C'1U'), OUTREC=(1,20) OUTFIL FNAMES=OUT2,INCLUDE=(21,2,CH,EQ,C'2U'), OUTREC=(1,20) /* The first step copies the entire records from IN1 to F1 The Second step copies the entire records from IN2 to F1 the third step adds an identifier of 'DD' to one record for each name found in File1 and File2 (FIRSTDUP) using CTL1 The fourth step add an identifier of 'UU' to one record for each name found only in File1 or only in File2 (NODUPS), using CTL2 the fifth step and Sixth step add an identifier of '11' to the File1 records and add an identifier of '22' to the File2 records using CTL3 and CTL4 Then we splice the second id byte for matching records so we get '1U' for names only in File1, '2U' for names only in File2, and an id other than '1U' or '2U' for names in both File and File2. Can any one explain how the DD UU and 11and 22 are added and how the splice exactly works.I am very much comfused with splice step and how the DD and UU are added to records and also how 1U and 2U are added to the records and finally how the Splice takes the 2 byte records ie to get 1U and 2U Can anyone please explain this Hope this is clear Thanks in advance

Frank Yaeger

DFSORT Moderator

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

Posted: Wed Jul 19, 2006 12:54 am    Post subject:

 Quote: Can any one explain how the DD UU and 11and 22 are added

They are added by the OUTREC parameter of the OUTFIL statements. For example:

SELECT FROM(F1) TO(T1) ON(1,10,CH) FIRSTDUP USING(CTL1)

uses the following DFSORT control statement in CTL1CNTL:

 Code: OUTFIL FNAMES=T1,OUTREC=(1,20,21:C'DD')

This OUTFIL statement uses the SELECTed records as input and produces T1 output records that contain input positions 1-20 followed by 'DD' in positions 21-22.

 Quote: Can any one explain how ...the splice exactly works

"z/OS DFSORT Application Programming Guide" Chapter 6 explains exactly how SPLICE works in great detail with lots of examples. You can access all of the DFSORT books from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html

If you need more specific help, you need to explain what you're trying to do exactly. Where did you get this job? What is it trying to accomplish? What do the records in IN1 and IN2 look like, and what is the expected output?
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics JES2 EXIT 6 QUESTION Randy Horowitz All Other Mainframe Topics 30 Tue Feb 06, 2018 5:47 pm Formatting using DFsort Guru Nandu DFSORT/ICETOOL 5 Thu Nov 30, 2017 7:33 am Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us