Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : programming pearls - The fastest algorithm can frequently be replaced by one that is almost as fast and much easier to understand.

Google
 
Web mainframegurukul.com

Welcome to the mainframegurukul forums.

You are currently viewing our mainframe forums as a guest which gives you limited access to view most discussions, articles. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support at admin@mainframegurukul.com


2 input files sorted into 1 output file

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
dkirk@sungard
Member


Joined: 03 Feb 2007
Posts: 1

PostPosted: Sat Feb 03, 2007 3:15 am    Post subject: 2 input files sorted into 1 output file Reply with quote

I have two input files with the same key values. I need to sort on the key and write one output file containing both records from the input files on the same output record.

I.E. File1/rec1 key = 123
File2/rec1 key = 123

output
outfile1/rec1 containing file1/rec1 and file2/rec1

Is this a merge function or and outfil/outrec function?
Back to top
View user's profile Send private message

Veera
Moderator


Joined: 22 Feb 2006
Posts: 111

PostPosted: Sat Feb 03, 2007 4:52 am    Post subject: Reply with quote

dkirk@sungard,

We can do it using ICETOOL, please find the test job below.

I/P->
*****

FILEA

10 11

FILEB

10 12

FINALOUT
********

10 11 12 -> I think this is ur requirement


//TESTSPLC JOB (TEST,04,T,0000),'SORTT',CLASS=C,MSGCLASS=T, JOB45059
// NOTIFY=AAAAA
//*
/*JOBPARM L=9999
//*
//JOBLIB DD DSN=LOADLIB,DISP=SHR
//*
//JS010 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//*
//IN1 DD *
10 11
//*
//IN2 DD *
10 12
//* here use a temp dataset bcoz ihave used mod
//TMP1 DD DSN=TEMPFILE, /* OUTPUT
// DISP=(MOD,PASS),
// UNIT=SYSDA,
// SPACE=(CYL,(1,2),RLSE),
// DCB=(RECFM=FB,BLKSIZE=0)
//OUT DD DSN=SPLOUT, /* OUTPUT
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(1,2),RLSE),
// DCB=(RECFM=FB,LRECL=8,BLKSIZE=800)
//LIST1 DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(TMP1) USING(CPY1)
COPY FROM(IN2) TO(TMP1) USING(CPY2)
SPLICE FROM(TMP1) TO(OUT) ON(1,2,CH) WITH(7,2)
//CPY1CNTL DD *
OUTREC FIELDS=(1:1,2,4:4,2,7:2X)
//CPY2CNTL DD *
OUTREC FIELDS=(1:1,2,7:4,2)

Let us know if this doesn meet your requirements, we can tailor accordingly.

Thanks
Veera
Back to top
View user's profile Send private message
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 487
Location: San Jose, CA

PostPosted: Sat Feb 03, 2007 9:14 pm    Post subject: Reply with quote

If you want fields from each file in the same output record, you can use the technique discussed in the "Join fields from two files on a key" Smart DFSORT Trick at:

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

If you need more specific help, please show an example of the records in your input files and the records you expect for output. Tell us the RECFM and LRECL of the input files and the starting position, length and format of the key in each input file.
_________________
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts two reports to compare , both different format - URGENT 1 ar3 1493 Wed Jul 15, 2009 7:57 pm
Frank Yaeger View latest post
No new posts If both the JOBCAT & STEPCAT statements are coded in a s 1 Krishna 2095 Tue May 12, 2009 6:43 pm
Krishna View latest post
No new posts Commit both in DB2 and MQ 3 jackie 2824 Fri Jul 27, 2007 3:52 pm
dbzTHEdinosauer View latest post
No new posts How to use both lower and upper case letters in cobol? 1 Divya 4885 Fri Mar 09, 2007 10:27 pm
Veera View latest post
No new posts Stop Run in both called and calling programs !!! 2 arrbee 4480 Fri Mar 10, 2006 12:13 pm
jaydeeppal View latest post
 



This widget requires Flash Player 9 or better








Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB