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

Is it possible in SORT (or ICETOOL)?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Wed Sep 02, 2009 12:40 am
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 Developer


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

PostPosted: Wed Sep 02, 2009 2:07 am
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: 55

PostPosted: Wed Sep 02, 2009 2:14 am
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 Developer


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

PostPosted: Wed Sep 02, 2009 2:30 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
Search our Forums:

Back to Top