IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Question regarding Splicing in DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Tue Jul 18, 2006 11:33 pm
Reply with quote

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
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Jul 19, 2006 12:54 am
Reply with quote

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:

Use [URL] BBCode for External Links

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?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts Question for file manager IBM Tools 7
Search our Forums:

Back to Top