IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SORT Process Required


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
erdilverma

New User


Joined: 12 Sep 2007
Posts: 4
Location: Mumbai

PostPosted: Tue Nov 09, 2010 12:00 am
Reply with quote

File 1:-
CH12312**T1111
CH23123**T2222
CH22255**T4444
CH25525**T2222

File2:-
T1111
T4444

Output should contain:-
CH23123**T2222
CH25525**T2222

Removing those one that is present in File2.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Nov 09, 2010 12:41 am
Reply with quote

You can use a DFSORT JOINKEYS job like the following to do what you asked for:

Code:

//S1 EXEC PGM=SORT                             
//SYSOUT DD SYSOUT=*                           
//IN1 DD *                                     
CH12312**T1111                                 
CH23123**T2222                                 
CH22255**T4444                                 
CH25525**T2222                                 
//IN2 DD *                                     
T1111                                         
T4444                                         
//SORTOUT DD SYSOUT=*                         
//SYSIN DD *                                   
  JOINKEYS F1=IN1,FIELDS=(10,5,A)             
  JOINKEYS F2=IN2,FIELDS=(1,5,A)               
  JOIN UNPAIRED,F1,ONLY                       
  OPTION COPY                                 
/*


For complete details on JOINKEYS, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174
Back to top
View user's profile Send private message
erdilverma

New User


Joined: 12 Sep 2007
Posts: 4
Location: Mumbai

PostPosted: Wed Nov 10, 2010 12:00 am
Reply with quote

Hi Frank,

Thanks for the help.
But I want the F1 file should not get in SORTed order.

The code which you mentioned is SORTing the F1 file.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Nov 10, 2010 12:19 am
Reply with quote

I can attest that Frank's code gives the output as you showed:

CH23123**T2222
CH25525**T2222

which is the same order as the input.
Back to top
View user's profile Send private message
erdilverma

New User


Joined: 12 Sep 2007
Posts: 4
Location: Mumbai

PostPosted: Wed Nov 10, 2010 12:27 am
Reply with quote

Hi Kelvin,

Actually I have mentioned only small data. In my file I am having thousands of records. Suppose I change the example as

File 1:-
CH12312**T1111
CH23123**T2222
CH22255**T4444
CH25525**T3333
CH12225**T2222


File2:-
T1111
T4444

Output will come as:-
CH23123**T2222
CH12225**T2222
CH25525**T3333

But I want as:-
CH23123**T2222
CH25525**T3333
CH12225**T2222

File 1 order should not get changed. Only the record having ids present in File2 should get removed.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Nov 10, 2010 1:59 am
Reply with quote

erdilverma,

Use the following JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                     
//SYSOUT   DD SYSOUT=*                       
//IN1      DD *                               
CH12312**T1111                               
CH23123**T2222                               
CH22255**T4444                               
CH25525**T3333                               
CH12225**T2222                               
//IN2 DD *                                   
T1111                                         
T4444                                         
//SORTOUT  DD SYSOUT=*                       
//SYSIN DD *                                 
  JOINKEYS F1=IN1,FIELDS=(10,5,A)             
  JOINKEYS F2=IN2,FIELDS=(1,5,A)             
  JOIN UNPAIRED,F1,ONLY                       
  REFORMAT FIELDS=(F1:1,88)                   
  SORT FIELDS=(81,8,CH,A)                     
  OUTREC BUILD=(1,80)                         
//JNF1CNTL DD *                               
  INREC OVERLAY=(81:SEQNUM,8,ZD)             
//*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
Search our Forums:

Back to Top