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 Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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