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

Splicing multiple records into a single one


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Fri Dec 29, 2006 3:45 pm
Reply with quote

I have to splice the records in the input file into single record in output file using Sort.

For Ex

Input File
0000000006
0000000006
0000000002

Output file
000000000600000000060000000002

Sai
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Dec 29, 2006 4:07 pm
Reply with quote

So your input file has only 3 records?
If more than 3, do you still want only one output record?
Have you looked at some of the posts in this forun and seen what additional information is required to help you with your requirement?
Do you have DFSORT/ICETOOL with all the current PTFs?
This:
http://www.ibmmainframes.com/viewtopic.php?t=15794&highlight=splice might give you a headstart.....
Back to top
View user's profile Send private message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Fri Dec 29, 2006 4:32 pm
Reply with quote

First using Outrec place the recods as below
Code:

0000000006
                 0000000006
                                  0000000002


& Then splice the records using the witheach option.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Fri Dec 29, 2006 8:59 pm
Reply with quote

Sai,

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/10)
//OUT DD DSN=...  output file (FB/30)
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(31,1,CH) -
   WITHEACH WITH(11,10) WITH(21,10) USING(CTL1)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(31:C'A',32:SEQNUM,1,ZD)),
   IFTHEN=(WHEN=(32,1,ZD,EQ,+2),OVERLAY=(11:1,10)),
   IFTHEN=(WHEN=(32,1,ZD,EQ,+3),OVERLAY=(21:1,10))
  OUTFIL FNAMES=OUT,BUILD=(1,30)
/*
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Mon Nov 15, 2010 11:21 pm
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 quite easily like this:

Code:

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


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

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top