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

combining 2 files into one file and excluding some columns


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

New User


Joined: 02 Jun 2008
Posts: 48
Location: India

PostPosted: Mon Jan 19, 2009 6:07 pm
Reply with quote

Hi all,
i'm having 2 files...
File1 lrecl is 12 and is having following records...

1111sant1234
1112raju1345
1113john1655
1114mahi5454

and file 2 lrecl is 6 and is having following records

222222
333333
444444
555555

now i want output like below

1111sant222222
1112raju333333
1113john444444
1114mahi555555

Thanks.
Back to top
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Mon Jan 19, 2009 6:26 pm
Reply with quote

Hi,

You can find a lot on this topic in DFSORT/ICETOOL forum

Try executing the below job :

Code:
//STEP010    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/12)
//IN2 DD DSN=...  input file2 (FB/6)
//T1 DD DSN=&&TEMP,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/14)
//TOOLIN   DD    *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(15,8,ZD) -
  WITH(9,6) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC FIELDS=(1,8,15:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
  INREC FIELDS=(9:1,6,15:SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,BUILD=(1,14)
/*



Thanks,
-Kapil.
Back to top
View user's profile Send private message
sant532

New User


Joined: 02 Jun 2008
Posts: 48
Location: India

PostPosted: Mon Jan 19, 2009 7:25 pm
Reply with quote

what is the meaning of
15:SEQNUM,8,ZD in INREC FIELDS=(1,8, 15:SEQNUM,8,ZD)
Back to top
View user's profile Send private message
sant532

New User


Joined: 02 Jun 2008
Posts: 48
Location: India

PostPosted: Mon Jan 19, 2009 8:02 pm
Reply with quote

Hi Kapil...That is WORKING WELL.
Thanks A lot.
Back to top
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Mon Jan 19, 2009 8:11 pm
Reply with quote

Hi,

SEQNUM,8,ZD : This generates sequence nos. of 8 digits in zone decimal format.

Thanks,
-Kapil.
Back to top
View user's profile Send private message
sant532

New User


Joined: 02 Jun 2008
Posts: 48
Location: India

PostPosted: Mon Jan 19, 2009 8:30 pm
Reply with quote

hi Kapil one more question ....what is the use of WITH

SPLICE FROM(T1) TO(OUT) ON(15,8,ZD) -
WITH(9,6) USING(CTL3)
Back to top
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Mon Jan 19, 2009 8:42 pm
Reply with quote

Try reading this. It gives detailed description on DFSORT's SPLICE operator.

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA30/6.13?DT=20080528171007

Further if you search this forum for SPLICE. You will get lots of various ways to use SPLICE.

Thanks,
-Kapil.
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 Jan 19, 2009 10:48 pm
Reply with quote

For more specific information on the technique Kapil used, see the "Join fields from two files record-by-record" Smart DFSORT Trick at:

Use [URL] BBCode for External Links

You can access all of the DFSORT books from:

Use [URL] BBCode for External Links
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
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
Search our Forums:

Back to Top