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
 

 

Horizontol Sort/Merge

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

New User


Joined: 02 Jan 2008
Posts: 4
Location: PHX, AZ

PostPosted: Fri Jan 04, 2008 7:42 am    Post subject: Horizontol Sort/Merge
Reply with quote

Hi,

I have a flat file containing 10 sequential records of a hundred bytes each. I would like to copy these records into one record of 1000 bytes (thus horizontally). At first I thought that there must be a simple procedure in either ICEMAN or ICETOOL to perform this task; however, I have not been able to come up with anything!! Resorted to some REXX code to perform the task in the interim; however, I am quite interested in finding out if this is possible with ICEMAN or ICETOOL?

Thanks
Erik
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: Fri Jan 04, 2008 9:32 pm    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 (FB/100)
//OUT DD DSN=...  output file (FB/1000)
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(1001,1,CH) WITHEACH -
 WITH(101,100) WITH(201,100) WITH(301,100) WITH(401,100) -
 WITH(501,100) WITH(601,100) WITH(701,100) WITH(801,100) -
 WITH(901,100) USING(CTL1)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(1002:SEQNUM,1,ZD,START=0)),
    IFTHEN=(WHEN=(1002,1,ZD,EQ,+1),OVERLAY=(101:1,100)),
    IFTHEN=(WHEN=(1002,1,ZD,EQ,+2),OVERLAY=(201:1,100)),
    IFTHEN=(WHEN=(1002,1,ZD,EQ,+3),OVERLAY=(301:1,100)),
    IFTHEN=(WHEN=(1002,1,ZD,EQ,+4),OVERLAY=(401:1,100)),
    IFTHEN=(WHEN=(1002,1,ZD,EQ,+5),OVERLAY=(501:1,100)),
    IFTHEN=(WHEN=(1002,1,ZD,EQ,+6),OVERLAY=(601:1,100)),
    IFTHEN=(WHEN=(1002,1,ZD,EQ,+7),OVERLAY=(701:1,100)),
    IFTHEN=(WHEN=(1002,1,ZD,EQ,+8),OVERLAY=(801:1,100)),
    IFTHEN=(WHEN=(1002,1,ZD,EQ,+9),OVERLAY=(901:1,100))
  OUTFIL FNAMES=OUT,BUILD=(1,1000)
/*
Back to top
View user's profile Send private message
Steynek

New User


Joined: 02 Jan 2008
Posts: 4
Location: PHX, AZ

PostPosted: Fri Jan 04, 2008 10:06 pm    Post subject:
Reply with quote

Thanks Frank!!!

I guess this solution is not dynamic as it is specific to the number of rows in the input file. Would have been nice if it could just append dynamically for each input record.

Regards
erik
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: Tue Nov 09, 2010 2:21 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:

//NEW   EXEC  PGM=ICETOOL                                       
//TOOLMSG DD SYSOUT=*                                           
//DFSMSG  DD SYSOUT=*     
//IN DD DSN=...  input file (FB/100)
//OUT DD DSN=...  output file (FB/1000)
//TOOLIN DD *                                                   
RESIZE FROM(IN) TO(OUT) TOLEN(1000)                             
/*                                         


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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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