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
 

 

Fetch Unmatched records from Input File Using SORT

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

New User


Joined: 10 Oct 2007
Posts: 12
Location: India

PostPosted: Thu Jun 05, 2008 6:10 pm    Post subject: Fetch Unmatched records from Input File Using SORT
Reply with quote

Hi,

Input File1 FILEA:

AAAAA
BBBBB
CCCCC

Input File 2 : FILEB
BBBBB
DDDDD
EEEEE

Expected Output File : OUTA
AAAAA
CCCCC

Simply termed by OUTA=FILEA-FILEB
i.e. The output file should contain the records which are not present in FILEB.
PLease help to acheive this using SORT and not by ICETOOL.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 05, 2008 7:02 pm    Post subject:
Reply with quote

ICETOOL is part of SORT.

There are a few examples posted quite recently using the SPLICE function.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Jun 05, 2008 7:11 pm    Post subject: Re: Fetch Unmatched records from Input File Using SORT
Reply with quote

Tharageshwari Marukkutti wrote:
PLease help to acheive this using SORT and not by ICETOOL.
Why?
compare two files and write output file with unmatched recor
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Thu Jun 05, 2008 7:35 pm    Post subject: Reply to: Fetch Unmatched records from Input File Using SORT
Reply with quote

Hi,
Please find this jcl with out icetool.

Code:

//STEP0100 EXEC PGM=SORT                                     
//SYSOUT   DD  SYSOUT=*                                       
//SORTIN   DD DSN=INPUT.BALU1,DISP=SHR                   
//SORTOUT  DD DSN=OUTPUT.BALU1,DISP=(NEW,CATLG,DELETE), 
//             AVGREC=K,SPACE=(90,(40,40),RLSE),             
//             RECFM=FB,LRECL=80                             
//SYSIN    DD *                                               
 SORT FIELDS=COPY                                             
 OUTREC OVERLAY=(76:C'F')                                     
//*                                                           
//STEP0200 EXEC PGM=SORT                                                   
//SYSOUT   DD  SYSOUT=*                                                   
//SORTIN   DD DSN=OUTPUT.BALU1,DISP=SHR                               
//         DD DSN=INPUT.BALU2,DISP=SHR                               
//SORTOUT  DD DSN=OUTPUT.BALU2,DISP=(NEW,CATLG,DELETE),               
//             AVGREC=K,SPACE=(80,(40,40),RLSE),                           
//             RECFM=FB,LRECL=80                                           
//SYSIN    DD *                                                           
 INREC OVERLAY=(71:C'00001')                                               
 SORT FIELDS=(1,5,CH,A)                                                   
 SUM FIELDS=(71,5,ZD)                                                     
 OUTFILE FNAMES=SORTOUT,BUILD=(1,70,10X),INCLUDE=(71,6,CH,EQ,C'00001F')   
//*                                                                       


But with icetool we can do it in one step.... icon_lol.gif

Thanks,
Balu
Back to top
View user's profile Send private message
Tharageshwari Marukkutti

New User


Joined: 10 Oct 2007
Posts: 12
Location: India

PostPosted: Thu Jun 05, 2008 8:56 pm    Post subject: Reply to: Fetch Unmatched records from Input File Using SORT
Reply with quote

Hi Babu,
Thanks Very much for your Kind Response..It work fine and gives the expected Output.

Like to give a little enhancement over your JCL to give the Output ,if the Input File contains Duplicates.
In step1
//SYSIN DD *
SORT FIELDS=(1,5,CH,A)
SUM FIELDS=NONE
OUTREC OVERLAY=(10:C'W')
/*
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am


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