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
 

 

combining 2 files into one file and excluding some columns

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: combining 2 files into one file and excluding some columns
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    Post subject: Reply to: combining 2 files into one file and excluding some
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    Post subject: Thanks Kapil!
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    Post subject:
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    Post subject: Reply to: combining 2 files into one file and excluding some
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    Post subject:
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    Post subject: Reply to: combining 2 files into one file and excluding some
Reply with quote

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

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


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

PostPosted: Mon Jan 19, 2009 10:48 pm    Post subject:
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:

www.ibm.com/systems/support/storage/software/sort/mvs/tricks/

You can access all of the DFSORT books from:

www.ibm.com/systems/support/storage/software/sort/mvs/srtmpub.html
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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