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

Icetool Sorting


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: Thu Sep 28, 2006 5:27 pm
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 Developer


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

PostPosted: Thu Sep 28, 2006 9:01 pm
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:

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top