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
 

 

Is it possible in SORT (or ICETOOL)?

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

New User


Joined: 03 Jul 2006
Posts: 53

PostPosted: Wed Sep 02, 2009 12:40 am    Post subject: Is it possible in SORT (or ICETOOL)?
Reply with quote

I have interesting dilemma. Input file has multiple occurence of ITEM# (for ex. 111111111) with MONTH# (01,02,03...). Is it possible to reformat it so final file shows unique ITEM# and all months in one record?


Code:
----+----1----
1111111111  01
1111111111  02
1111111111  03
2222222222  01
2222222222  02
3333333333  03
4444444444  01
4444444444  03


My final file should look like this:
Code:
----+----1----+----2--
1111111111  01  02  03
2222222222  01  02   
3333333333          03
4444444444  01      03


Any help would be greatly appreciated.

Thanks.
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: Wed Sep 02, 2009 2:07 am    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(1,10,CH) KEEPNODUPS WITHANY -
 WITH(17,2) WITH(21,2) WITH(25,2) WITH(29,2) WITH(33,2) -
 WITH(37,2) WITH(41,2) WITH(45,2) WITH(49,2) WITH(53,2) WITH(57,2) -
 USING(CTL1)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=(13,2,CH,EQ,C'02'),BUILD=(1,10,17:13,2)),
    IFTHEN=(WHEN=(13,2,CH,EQ,C'03'),BUILD=(1,10,21:13,2)),
    IFTHEN=(WHEN=(13,2,CH,EQ,C'04'),BUILD=(1,10,25:13,2)),
    IFTHEN=(WHEN=(13,2,CH,EQ,C'05'),BUILD=(1,10,29:13,2)),
    IFTHEN=(WHEN=(13,2,CH,EQ,C'06'),BUILD=(1,10,33:13,2)),
    IFTHEN=(WHEN=(13,2,CH,EQ,C'07'),BUILD=(1,10,37:13,2)),
    IFTHEN=(WHEN=(13,2,CH,EQ,C'08'),BUILD=(1,10,41:13,2)),
    IFTHEN=(WHEN=(13,2,CH,EQ,C'09'),BUILD=(1,10,45:13,2)),
    IFTHEN=(WHEN=(13,2,CH,EQ,C'10'),BUILD=(1,10,49:13,2)),
    IFTHEN=(WHEN=(13,2,CH,EQ,C'11'),BUILD=(1,10,53:13,2)),
    IFTHEN=(WHEN=(13,2,CH,EQ,C'12'),BUILD=(1,10,57:13,2))
/*
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 53

PostPosted: Wed Sep 02, 2009 2:14 am    Post subject: Reply to: Is it possible in SORT (or ICETOOL)?
Reply with quote

Frank, you are the best. It's awesome and so simple. Thanks a lot. I'm still learning all those tricks here.
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: Wed Sep 02, 2009 2:30 am    Post subject:
Reply with quote

Glad I could help. I still haven't learned all the tricks myself. icon_wink.gif
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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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