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
 

 

copy two files ointo one file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: copy two files ointo one file
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    Post subject:
Reply with quote

sai mainframes

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

http://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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Nov 06, 2007 9:41 pm    Post subject:
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:

http://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    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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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