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
 

 

Can ICETOOL flag the last record based on a key?

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

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Thu Mar 27, 2008 2:11 am    Post subject: Can ICETOOL flag the last record based on a key?
Reply with quote

I have a single input file and would expect a single output file.

Input:

Code:

----+----1----+----2----+----3----+----4
AB1234  YYYYYYYYYYY
AB1234  YYYYYYYYYYY
AB1234  YYYYYYYYYYY
AB1234  YYYYYYYYYYY
AB1234  YYYYYYYYYYY
CD5678  YYYYYYYYYYY
CD5678  YYYYYYYYYYY
CD5678  YYYYYYYYYYY
EF9012  YYYYYYYYYYY
EF9012  YYYYYYYYYYY
EF9012  YYYYYYYYYYY
EF9012  YYYYYYYYYYY
EF9012  YYYYYYYYYYY


Using the USERID in position 1-6 of the input file, can ICETOOL flag the last record of each set with an "*" (asterisk)?

Output:

Code:

----+----1----+----2----+----3----+----4
AB1234  YYYYYYYYYYY
AB1234  YYYYYYYYYYY
AB1234  YYYYYYYYYYY
AB1234  YYYYYYYYYYY
AB1234  YYYYYYYYYYY *
CD5678  YYYYYYYYYYY
CD5678  YYYYYYYYYYY
CD5678  YYYYYYYYYYY *
EF9012  YYYYYYYYYYY
EF9012  YYYYYYYYYYY
EF9012  YYYYYYYYYYY
EF9012  YYYYYYYYYYY
EF9012  YYYYYYYYYYY *


This isn't my exact requirement, but after seeing the ICETOOL control cards, I should be able to adapt it to my setup.

Thanks in advance.
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 Mar 27, 2008 3:03 am    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. Note that there's a system restriction related to the use of referback for concatenation with multiple volumes, so you might want to have the SELECT in one ICETOOL step and the SORT in another if that's a concern.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=...  input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=*.T2,VOL=REF=*.T2,DISP=(OLD,PASS)
//    DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(T1) ON(1,6,CH) LAST DISCARD(T2) USING(CTL1)
SORT FROM(CON) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,OVERLAY=(21:C'*')
  OUTFIL FNAMES=T2
/*
//CTL2CNTL DD *
  OPTION EQUALS
  SORT FIELDS=(1,6,CH,A)
/*
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Thu Mar 27, 2008 8:15 pm    Post subject: Reply to: Can ICETOOL flag the last record based on a key?
Reply with quote

The solution worked fine. I see the methodogy of splitting out the last record of each userid set, flagging it, and sorting it back together with the non-selected records. Thank you for all your invaluable advice on this problem as well as all the others.
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 Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm


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