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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm


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