MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Generate Output file from 2 files using sort.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Ram22
Beginner


Joined: 09 Jun 2004
Posts: 33
Topics: 6

PostPosted: Thu Aug 19, 2004 10:16 am    Post subject: Generate Output file from 2 files using sort. Reply with quote

Hi,

I need to use two input files, the first one contains n records and the second one contains less number of records than the first.

The record layout for both the files is same.. i.e. same fields.

ex: number name for the first one, then
number name for the second one tooo.

now using the second file i need to eliminate all the records in first file which matches the the number in the second file.

i.e if number of any rec of first file = number of any rec in the second file then this record should not go to the output file( a new file i.e file3)

i.e I need to generate an output file using file 1, which does not have any records which have the number that is present in file 2.

Note: file 1 can have more than one records with the same number, but file 2 is unique.


Please provide me an approach to do this using sort.

Regards & Thanks,
Ram
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Thu Aug 19, 2004 12:29 pm    Post subject: Reply with quote

Ram,

1. What is the LRECL,RECFM of the files?
2. Post a sample Input and desired output
3. What type of sort product do you have ?(DFSORT,Syncsort)
4. If you do have syncsort then post the realease version of Synctool along with TPF.( This can be found in the toolmsg)

5. Is easytrieve/sas an option?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Ram22
Beginner


Joined: 09 Jun 2004
Posts: 33
Topics: 6

PostPosted: Sat Aug 21, 2004 5:17 am    Post subject: Reply with quote

Kolusu,

Please find the details below
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sat Aug 21, 2004 10:09 am    Post subject: Reply with quote

Here's a DFSORT/ICETOOL solution:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1
//IN2 DD DSN=...  input file2
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file
//TOOLIN DD *
* IN2->T1:  File2 records - add '22' id in 191-192
  COPY FROM(IN2) TO(T1) USING(CTL1)
* IN1->T1:  Get File1 FIRSTDUP records and add 'XX' id in 191-192
  SELECT FROM(IN1) TO(T1) ON(1,3,CH) FIRSTDUP USING(CTL2)
* IN1->T1:  File1 records - add '11' id in 191-192
  COPY FROM(IN1) TO(T1) USING(CTL3)
* T1->OUT:  SPLICE on key with 1-191, but not 192.
* Keep records with id in 191-192 of:
*   '1X' - Dups in file1 w/o match in file2.
*   '11' - nondups in file1 w/o match in file2.
* Remove id.
  SPLICE FROM(T1) TO(OUT) ON(1,3,CH) KEEPNODUPS -
    WITHALL WITH(1,191) USING(CTL4)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(1,190,191:C'22')
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=(T2),OUTREC=(1,190,191:C'XX')
/*
//CTL3CNTL DD *
  OUTREC FIELDS=(1,190,191:C'11')
/*
//CTL4CNTL DD *
  OUTFIL FNAMES=OUT,
    INCLUDE=(191,2,CH,EQ,C'1X',OR,
             191,2,CH,EQ,C'11'),
    OUTREC=(1,190)
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
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   printer-friendly view    MVSFORUMS.com Forum Index -> 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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group