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

copy two files ointo one file


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

New User


Joined: 02 Nov 2007
Posts: 8
Location: hyderabad

PostPosted: Tue Nov 06, 2007 12:14 pm
Reply with quote

hi all,

please find my requirement below.

i have two files with 10 record each.

i want the output file with 10 records only......that means it requires to concatenate the records....

example....

file1:
sai****
ravi***

file2:
******krishna
******kumar

where * meant for spaces.....

i need my output file as.....

sai**********krishna
ravi*********kumar


Thanks in advance
Saikrishna yadav
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Nov 06, 2007 12:18 pm
Reply with quote

sai mainframes

Look at the "Join fields from two files record-by-record" Smart DFSORT trick at:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
sai mainframes

New User


Joined: 02 Nov 2007
Posts: 8
Location: hyderabad

PostPosted: Tue Nov 06, 2007 3:01 pm
Reply with quote

hi kRISPREMs

i am not getting this value..... ON(11,8,PD) and


OUTREC FIELDS=(1:1,10,11:SEQNUM,8,PD)....

will you please explain the attributes of these values.......



thanks in advance

Saikrishna yadav
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Nov 06, 2007 3:20 pm
Reply with quote

Code:
OUTREC FIELDS=(1:1,10,11:SEQNUM,8,PD)....
This OUTREC statement formats the records by adding a sequence number record by record... like if you consider you i/p records after passing through this OUTREC statement it would look like this
Code:

sai                                   00001
ravi                                  00002

Ofcourse you could see this sequence number because you have it in PD format, if you would like to look at it just change PD to ZD.

Now also the another set of your i/p records wolud have the SEQUENCE number like this
Code:

              krishna                 00001
              kumar                   00002     


Next Comes the SPLICE(JOIN) statement which considers the key as
Code:
ON(11,8,PD)

Here splice operator checks the records with the same record number like sai and krishna have the same seqnumber 00001 so it joins both the records based on the WITH parameter
Code:
WITH(p,m)
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: Tue Nov 06, 2007 9:41 pm
Reply with quote

Sai,

You can use a DFSORT/ICETOOL job like the following to do what you asked for. I assumed your input files have RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD *
sai
ravi
/*
//IN2 DD *
      krishna
      kumar
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(81,8,PD) WITH(14,20) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:SEQNUM,8,PD)
/*
//CTL2CNTL DD *
  INREC BUILD=(14:7,20,81:SEQNUM,8,PD)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,BUILD=(1,80)
/*


For complete details on the SPLICE operator of DFSORT's ICETOOL, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.13?DT=20060615185603
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top