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
 

 

To sort all records frm two files in one output file

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

New User


Joined: 28 May 2005
Posts: 26
Location: Chennai

PostPosted: Tue Jun 07, 2005 10:34 am    Post subject: To sort all records frm two files in one output file
Reply with quote

hello ,

here is the example

Code:

file a                fileb
1                      2
2                      4
4                      5
6                      7


i want to sort the file those records in both files in one output file and those belong to individuals in the other output file....
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Tue Jun 07, 2005 4:19 pm    Post subject: Re: To sort all records frm two files in one output file
Reply with quote

Quote:
i want to sort the file those records in both files in one output file and those belong to individuals in the other output file....


If I m not mistaking, U r looking for two o/p files.
One having all the values from File 1, which are also there in File 2.
Second having all the recs from both files which are not in the other file.

If Yes....Please try this code.

Code:
//S010     EXEC PGM=ICETOOL                     
//TOOLMSG   DD SYSOUT=*                         
//DFSMSG    DD SYSOUT=*                         
//IN     DD DSN=INPUT.FILE.FIRST,DISP=SHR 
//        DD DSN=INPUT.FILE.SECOND,DISP=SHR 
//OUT    DD DSN=OUTPUT.FILE.NO.DUP,           
//          DISP=(,KEEP,DELETE),               
//          RECFM=FB,LRECL=80,                 
//          SPACE=(80,(10,10),RLSE)             
//TOOLIN DD *                                   
  SELECT FROM(IN) TO(OUT) ON(1,[b]L[/b],CH) NODUPS     
//


This will give you Not duplicate values. Replacing NODUPS in the code with ALLDUPS will give you duplicate values. Also change "L" in the code to the field value of yours (1 in your given example).

Let me know, if having any question.

Regards,

Priyesh.
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: Tue Jun 07, 2005 9:43 pm    Post subject:
Reply with quote

pbgunasekar,

You can use the following DFSORT/ICETOOL job to get the matching records in one file and the non-matching records in another file:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD DSN=...  input file a
//    DD DSN=...  input file b
//MATCH DD DSN=...  output file with matching records
//NOMATCH DD DSN=...  output file with non-matching records
//TOOLIN DD *
SELECT FROM(CON) TO(MATCH) ON(1,1,CH) ALLDUPS DISCARD(NOMATCH)
/*


MATCH will have:

2
2
4
4

NOMATCH will have:

1
5
6
7

If that's not what you want, then show me the records you want in each output file and explain what you're trying to do.
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 Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm


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