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
 

 

How to select records from two files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
adarsh.bhalke

New User


Joined: 06 May 2007
Posts: 16
Location: pune

PostPosted: Mon Dec 10, 2007 12:52 pm    Post subject: How to select records from two files
Reply with quote

Hi

my requirement is as follows

1. There are two Input files

File1 - with one of the fields as F1
File2 - with fields F1(same as in file1) and F2

2. One output file should be generated with all the records from
File1 where field F1 of File1 = field F1 of File2

please tell me the solution
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Mon Dec 10, 2007 12:59 pm    Post subject:
Reply with quote

adarsh,

This was discussed earlier. Search DFSORT fourm.
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Mon Dec 10, 2007 5:07 pm    Post subject:
Reply with quote

Hi,

You want to do it using DFSORT/ICETOOL only or even without using DFSORT/ICETOOL?

We can write a simple COBOL program to execute your requirement.

Regards,
KSK
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 Dec 10, 2007 9:59 pm    Post subject:
Reply with quote

adarsh.bhalke,

Please show an example of the records in each input file (relevant fields only) and what you expect for output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Back to top
View user's profile Send private message
adarsh.bhalke

New User


Joined: 06 May 2007
Posts: 16
Location: pune

PostPosted: Thu Dec 13, 2007 12:15 pm    Post subject: How to select records from two files
Reply with quote

my requirement is like this

File1 one contains

F1 000001 010408SAP4WITA 19991201
F1 000002 010408SAP4WITA 19991201

and file 2 contains

F1 112333 010408SAP4WITA 19991201

Here if first two bytes of file 1 matches with that of file2 then i want all curressponding records of file 1 in output file


I.e.

the output should be as follows

F1 000001 010408SAP4WITA 19991201
F1 000002 010408SAP4WITA 19991201
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Dec 13, 2007 1:31 pm    Post subject:
Reply with quote

Code:
//*******************************************************             
//STEP001  EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN1      DD *                                                       
F1 000001 010408SAP4WITA 19991201                                     
F1 000002 010408SAP4WITA 19991201                                     
/*                                                                   
F1 112333 010408SAP4WITA 19991201                                     
//IN2      DD *                                                       
/*                                                                   
//TMP1     DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//BOTH     DD SYSOUT=*                                               
//TOOLIN   DD *                                                       
 COPY FROM(IN1)  TO(TMP1) USING(CP01)                                 
 COPY FROM(IN2)  TO(TMP1) USING(CP02)                                 
 SELECT FROM(TMP1) TO(BOTH) ON(1,2,CH) ALLDUPS USING(CP03)           
/*                                                                   
//CP01CNTL DD   *                                                     
  OUTREC OVERLAY=(80:C'1')                                           
/*                                                                   
//CP02CNTL DD   *                                                     
  OUTREC OVERLAY=(80:C'2')                                   
/*                                                           
//CP03CNTL DD   *                                           
  OUTFIL FNAMES=BOTH,INCLUDE=(80,1,ZD,EQ,1),OVERLAY=(80:C' ')
/*                                                           


BOTH
Code:
F1 000001 010408SAP4WITA 19991201
F1 000002 010408SAP4WITA 19991201
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 SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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