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
 

 

All the records of input to one record of output file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Oct 14, 2008 12:58 pm    Post subject: All the records of input to one record of output file
Reply with quote

Hi,
Below is my requirement
Code:

Input file:LRECL=10,RECFM=FB
001001001z
002002002z
323323323z
322322322z
756756756z
565565565z
095095095z
121121121z
075095095z
085095095z
065095095z
Output file:LRECL=115,RECFM=FB
MMYY1;001001001z;002002002z;323323323z;322322322z;756756756z;565565565z;095095095z;121121121z;075095095z;085095095z
MMYY2;065095095z


If input file has many records to fit into one record of output file( i.e. more than 10) then it should write remaining records to second record with first five bytes as MMYY2 and so on..
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Tue Oct 14, 2008 3:48 pm    Post subject:
Reply with quote

Sambhaji,

Here's a job which works in DFSORT for the above req.
Code:
//STEP0001 EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN       DD *                                                         
001001001Z                                                             
002002002Z                                                             
323323323Z                                                             
322322322Z                                                             
756756756Z                                                             
565565565Z                                                             
095095095Z                                                             
121121121Z                                                             
075095095Z                                                             
085095095Z                                                             
065095095Z                                                             
//OUT      DD SYSOUT=*                                                 
//TOOLIN   DD *                                                         
SPLICE FROM(IN) TO(OUT) ON(1,5,CH) WITH(17,11) WITH(28,11) WITH(39,11) -
WITH(50,11) WITH(61,11) WITH(72,11) WITH(83,11) WITH(94,11)            -
WITH(105,11) WITHEACH KEEPNODUPS USING(CTL1)                       
//CTL1CNTL DD *                                                     
 INREC IFTHEN=(WHEN=INIT,                                           
       OVERLAY=(116:SEQNUM,8,ZD,124:116,8,ZD,MOD,+10,M11,LENGTH=8)),
 IFTHEN=(WHEN=(124,8,ZD,EQ,1),                                     
       BUILD=(C'MMYY',SEQNUM,1,ZD,C';',1,10)),                     
 IFTHEN=(WHEN=(124,8,ZD,EQ,2),                                     
       BUILD=(C'MMYY',SEQNUM,1,ZD,17:C';',1,10)),                   
 IFTHEN=(WHEN=(124,8,ZD,EQ,3),                                     
       BUILD=(C'MMYY',SEQNUM,1,ZD,28:C';',1,10)),                   
 IFTHEN=(WHEN=(124,8,ZD,EQ,4),                                     
       BUILD=(C'MMYY',SEQNUM,1,ZD,39:C';',1,10)),                   
 IFTHEN=(WHEN=(124,8,ZD,EQ,5),                                     
      BUILD=(C'MMYY',SEQNUM,1,ZD,50:C';',1,10)),                   
 IFTHEN=(WHEN=(124,8,ZD,EQ,6),                                     
       BUILD=(C'MMYY',SEQNUM,1,ZD,61:C';',1,10)),                   
 IFTHEN=(WHEN=(124,8,ZD,EQ,7),                                     
       BUILD=(C'MMYY',SEQNUM,1,ZD,72:C';',1,10)),                   
 IFTHEN=(WHEN=(124,8,ZD,EQ,8),                                     
       BUILD=(C'MMYY',SEQNUM,1,ZD,83:C';',1,10)),                   
 IFTHEN=(WHEN=(124,8,ZD,EQ,9),                                     
       BUILD=(C'MMYY',SEQNUM,1,ZD,94:C';',1,10)),     
 IFTHEN=(WHEN=(124,8,ZD,EQ,0),                       
       BUILD=(C'MMYY',SEQNUM,1,ZD,105:C';',1,10))     
 OUTFIL FNAMES=OUT,BUILD=(1,115)                   
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Oct 14, 2008 4:01 pm    Post subject:
Reply with quote

Thanks A lot...
Working as required icon_smile.gif icon_smile.gif icon_smile.gif
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Oct 14, 2008 9:19 pm    Post subject:
Reply with quote

sambhaji,

You can do this kind of thing more easily and efficiently with the new WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this

Code:

//STEP0100 EXEC PGM=ICEMAN                                             
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                         
001001001Z                                                             
002002002Z                                                             
323323323Z                                                             
322322322Z                                                             
756756756Z                                                             
565565565Z                                                             
095095095Z                                                             
121121121Z                                                             
075095095Z                                                             
085095095Z                                                             
065095095Z                                                             
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  SORT FIELDS=COPY                                                     
  INREC IFTHEN=(WHEN=INIT,                                             
  OVERLAY=(110:1,10,C';',SEQNUM,8,ZD,START=10,INCR=1,                   
           121,8,ZD,MOD,+10,TO=ZD,LENGTH=1,1:109X)),                   
 IFTHEN=(WHEN=GROUP,PUSH=(130:ID=1),RECORDS=10),                       
 IFTHEN=(WHEN=GROUP,BEGIN=(128,1,ZD,EQ,0),RECORDS=10,PUSH=(01:110,11)),
 IFTHEN=(WHEN=GROUP,BEGIN=(128,1,ZD,EQ,1),RECORDS=09,PUSH=(12:110,11)),
 IFTHEN=(WHEN=GROUP,BEGIN=(128,1,ZD,EQ,2),RECORDS=08,PUSH=(23:110,11)),
 IFTHEN=(WHEN=GROUP,BEGIN=(128,1,ZD,EQ,3),RECORDS=07,PUSH=(34:110,11)),
 IFTHEN=(WHEN=GROUP,BEGIN=(128,1,ZD,EQ,4),RECORDS=06,PUSH=(45:110,11)),
 IFTHEN=(WHEN=GROUP,BEGIN=(128,1,ZD,EQ,5),RECORDS=05,PUSH=(56:110,11)),
 IFTHEN=(WHEN=GROUP,BEGIN=(128,1,ZD,EQ,6),RECORDS=04,PUSH=(67:110,11)),
 IFTHEN=(WHEN=GROUP,BEGIN=(128,1,ZD,EQ,7),RECORDS=03,PUSH=(78:110,11)),
 IFTHEN=(WHEN=GROUP,BEGIN=(128,1,ZD,EQ,8),RECORDS=02,PUSH=(89:110,11)),
 IFTHEN=(WHEN=(128,1,ZD,EQ,9),OVERLAY=(100:110,11))                     
                                                                       
 OUTFIL REMOVECC,NODETAIL,BUILD=(115X),                                 
 SECTIONS=(130,1,TRAILER3=('MMYY',130,1,';',1,109))                     
/*


For complete details on the WHEN=GROUP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
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: Sat Nov 06, 2010 3:24 am    Post subject:
Reply with quote

With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), you can now use the new RESIZE operator of DFSORT's ICETOOL to do this more easily like this:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//IN DD *
001001001Z
002002002Z
323323323Z
322322322Z
756756756Z
565565565Z
095095095Z
121121121Z
075095095Z
085095095Z
065095095Z
//OUT DD SYSOUT=*
//TOOLIN DD *
RESIZE FROM(IN) TO(OUT) TOLEN(110) USING(CTL1)
/*
//CTL1CNTL DD *
   INREC BUILD=(1,10,11:C';')
   OUTFIL FNAMES=OUT,
    BUILD=(C'MMYY',SEQNUM,1,ZD,C';',1,109)
/*


For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm


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