Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 5 Sat Aug 19, 2017 2:33 pm
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us