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

formatting of input using sort??


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
Reply with quote

Refer - 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
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: 577
Location: USA

PostPosted: Fri Aug 12, 2011 5:54 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top