Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us