Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
rmd3003

New User

Joined: 03 Jul 2006
Posts: 53

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

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.

Frank Yaeger

DFSORT Moderator

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

Posted: Wed Sep 02, 2009 2:07 am    Post subject:

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)) /*
rmd3003

New User

Joined: 03 Jul 2006
Posts: 53

 Posted: Wed Sep 02, 2009 2:14 am    Post subject: Reply to: Is it possible in SORT (or ICETOOL)? Frank, you are the best. It's awesome and so simple. Thanks a lot. I'm still learning all those tricks here.
Frank Yaeger

DFSORT Moderator

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

 Posted: Wed Sep 02, 2009 2:30 am    Post subject: Glad I could help. I still haven't learned all the tricks myself.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am How to Generate JCL using Sort naveen katkuri DFSORT/ICETOOL 7 Tue Mar 13, 2018 3:50 pm Need better approach to create a sort... Vamshi Veludandi DFSORT/ICETOOL 8 Thu Mar 08, 2018 5:59 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us