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
 

 

formatting of input using sort??

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kalyan.v

New User


Joined: 04 Feb 2008
Posts: 65
Location: Hyd

PostPosted: Fri Aug 12, 2011 3:04 pm    Post subject: formatting of input using sort??
Reply with quote

Hi,

I have a input like below. It is a list of some accts.

INput List:
1000555
1131887
1001839
1417301
1000242
1530474
1305921
1125135
1534212
1005600
1196139
1059296
1165365
1638262
1059297
1165368
1638267

I should get output like below.
Code:



DATA=1000555/1131887/1001839/1417301/1000242/1530474/1305921/1125135/
DATA=1534212/1005600/1196139/1059296/1165365/1638262/1059297/1165368/
DATA=1638267


Can we do this using sort ? if yes, please let me know.

Thanks,
Kalyan.
Back to top
View user's profile Send private message

gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri Aug 12, 2011 4:13 pm    Post subject:
Reply with quote

Refer - http://ibmmainframes.com/viewtopic.php?p=275319&highlight=#275319
Back to top
View user's profile Send private message
kalyan.v

New User


Joined: 04 Feb 2008
Posts: 65
Location: Hyd

PostPosted: Fri Aug 12, 2011 4:45 pm    Post subject:
Reply with quote

Thanks for the quick response.
But in my case, the input number of records will vary.It is not constant.

How i can do ?


Thanks,
Kalyan
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Fri Aug 12, 2011 5:54 pm    Post subject:
Reply with quote

kalyan.v,
Quote:

But in my case, the input number of records will vary.It is not constant.

How i can do ?
Your varying number of input records doesn't matter, what matters is how much you can/want to fit in one record. From your sample output you seem to want to fit, 8 account numbers in one record.

However, Is there a reason you don't show / for the last record? If that is something you just missed, see if below works (Tested on DFSort)...
Code:
//STEP0001 EXEC PGM=ICETOOL                               
//TOOLMSG  DD  SYSOUT=*                                   
//DFSMSG   DD  SYSOUT=*                                   
//IN       DD  *                                         
1000555                                                   
1131887                                                   
1001839                                                   
1417301                                                   
1000242                                                   
1530474                                                   
1305921                                                   
1125135                                                   
1534212                                                   
1005600                                                   
1196139                                                   
1059296                                                   
1165365                                                   
1638262                                                   
1059297                                                   
1165368                                                   
1638267                                                   
//OUT      DD  SYSOUT=*                                   
//TOOLIN   DD  *                                         
 SPLICE FROM(IN) TO(OUT) ON(81,8,ZD) WITHEACH KEEPNODUPS -
 WITH(09,8) WITH(17,8) WITH(25,8) WITH(33,8)  -           
 WITH(41,8) WITH(49,8) WITH(57,8)             -           
 USING(CTL1)                                             
/*                                                         
//CTL1CNTL DD *                                             
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(8:C'/')),               
        IFTHEN=(WHEN=GROUP,RECORDS=8,PUSH=(81:ID=8,SEQ=8)),
        IFTHEN=(WHEN=(89,8,ZD,EQ,02),OVERLAY=(09:1,8)),     
        IFTHEN=(WHEN=(89,8,ZD,EQ,03),OVERLAY=(17:1,8)),     
        IFTHEN=(WHEN=(89,8,ZD,EQ,04),OVERLAY=(25:1,8)),     
        IFTHEN=(WHEN=(89,8,ZD,EQ,05),OVERLAY=(33:1,8)),     
        IFTHEN=(WHEN=(89,8,ZD,EQ,06),OVERLAY=(41:1,8)),     
        IFTHEN=(WHEN=(89,8,ZD,EQ,07),OVERLAY=(49:1,8)),     
        IFTHEN=(WHEN=(89,8,ZD,EQ,08),OVERLAY=(57:1,8))     
  OUTFIL FNAMES=OUT,BUILD=(C'DATA=',1,64,80:X)             
/*                                                         
//SYSOUT   DD  SYSOUT=*                                     
//*

OUTPUT
Code:
DATA=1000555/1131887/1001839/1417301/1000242/1530474/1305921/1125135/
DATA=1534212/1005600/1196139/1059296/1165365/1638262/1059297/1165368/
DATA=1638267/                                                       

If you really don't want / for the final record, it is still possible using condition check.

Thanks,
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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