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
 

 

SORT Process Required

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: SORT Process Required
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 Moderator


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

PostPosted: Tue Nov 09, 2010 12:41 am    Post subject:
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:

http://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    Post subject: Reply to: SORT Process Required
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

Moderator Team Head


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

PostPosted: Wed Nov 10, 2010 12:19 am    Post subject: Reply to: SORT Process Required
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    Post subject: Reply to: SORT Process Required
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    Post subject: Reply to: SORT Process Required
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    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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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