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
 

 

Icetool Sorting

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

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Thu Sep 28, 2006 5:27 pm    Post subject: Icetool Sorting
Reply with quote

My code is like this
Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=FILE15,DISP=SHR
//IN2 DD DSN=FILE16,DISP=SHR
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//UPDATE DD DSN=UPDATE,DISP=SHR
//INSERT DD DSN=INSERT,DISP=SHR
//DELETE DD DSN=DELETE,DISP=SHR
//TOOLIN DD *
  COPY FROM(IN1) TO(T1) USING(CTL1)
  COPY FROM(IN2) TO(T1) USING(CTL2)
  SELECT FROM(T1) TO(T2) ON(1,69,CH) NODUPS
  SPLICE FROM(T2) TO(UPDATE) ON(1,8,CH) -
  KEEPNODUPS WITH(1,70) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(70:C'11')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(70:C'22')
/*
//CTL3CNTL DD *
  SORT FIELDS=(1,8,CH,A,70,2,CH,A)
  OUTFIL FNAMES=UPDATE,INCLUDE=(70,2,CH,EQ,C'21'),
    BUILD=(1,69)
  OUTFIL FNAMES=INSERT,INCLUDE=(70,2,CH,EQ,C'22'),
    BUILD=(1,69)
  OUTFIL FNAMES=DELETE,INCLUDE=(70,2,CH,EQ,C'11'),
    BUILD=(1,69)
/*


I am using two input files file15 and File16 both of 69 in Lrecl and the key is the first 8 bytes

File15 is blank and

File16 has the following types of records

111-0001AAAAAAA 111111-11
111-0002BBBBB 111111-12
111-0003CCCCCCC 111111-13
111-0004DDDDDDDD 111111-14
111-0005EEEE 111111-15
111-0006FFFFF 111111-16
111-0007GGGGGGG 111111-17
111-0008HHHHH 111111-18
111-0009IIII 111111-19
111-0001JJJ 111111-10
111-0000KKKKKK 111111-10
111-0003LLLLLLL LLL LLL 111111-13
111-0004MMMMM 111111-12
111-0002NNNNNNNNNN 111111-12
111-0002OOOOOOO 111111-12
111-0009PPPPPP 111111-19
111-0009QQQQ 111111-19
111-0009RRRRRRR 111111-19
111-0001SSS SSS 111111-11

Since the file15 is blank while executing the code the insert file should contain all the records as in file16?but some records are getting truncated .....

Could you please share your thoughts on this?
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: Thu Sep 28, 2006 9:01 pm    Post subject:
Reply with quote

Quote:
Since the file15 is blank while executing the code the insert file should contain all the records as in file16?


Why would you think that? The blank records in file15 don't even matter since you're eliminating them with the SELECT NODUPS.

If you display your T2 file, you'll see it has:

Code:

111-0000KKKKKK                                            111111-10  22
111-0001AAAAAAA                                           111111-11  22
111-0001JJJ                                               111111-10  22
111-0001SSS SSS                                           111111-11  22
111-0002BBBBB                                             111111-12  22
111-0002NNNNNNNNNN                                        111111-12  22
111-0002OOOOOOO                                           111111-12  22
...


Now you're SPLICEing on 1,8,CH. Since you don't have WITHALL, the first 111-0001 record will be spliced with the last 111-0001 record. So you'll end up with one 111-0001 record instead of three 111-0001 records. That's what your SPLICE operator is supposed to do. Likewise for any other duplicate records like 111-0002.

You might want to spend some time reading through the SPLICE chapter in "z/OS DFSORT Application Programming Guide" to understand how SPLICE actually works:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.13?DT=20060615185603

If you want help figuring out how to use SPLICE for a particular task, you need to describe what you're trying to do and show an example of the records in each input file and what you expect for output.
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 Sorting group data rajella DFSORT/ICETOOL 3 Sun Jan 22, 2017 11:32 pm
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Stripping and Sorting of VB file G SRINIVASA RAO SYNCSORT 5 Wed Sep 14, 2016 1:34 pm


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