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 

Exclude Using SOrt

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


Joined: 11 Aug 2004
Posts: 30
Topics: 10

PostPosted: Mon Aug 06, 2007 5:01 am    Post subject: Exclude Using SOrt Reply with quote

Hi
I would like to read 2 files and exculde teh common entries and write the remaining into a third file.

Is this possible with Sort utility?

INFile1:

101 AAA
102 AAA

103 AA2
104 AA3
101 AA1
102 AA1

103 AA2
104 AA3


INFile2:

102 AAA
103 AA1


The rows in the red color would be excluded from my thrid file which is the output file i need.

OUfile

103 AA2
104 AA3
103 AA2
104 AA3


The comaprision would be from the 5th character which is AAA or AA1 etc

Please let me know your ideas?

Thanks
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Aug 06, 2007 5:07 am    Post subject: Reply with quote

rsivananda,

Please SEARCH before posting. Concatenate both file and use the JCl listed here

http://www.mvsforums.com/helpboards/viewtopic.php?t=8&highlight=nodups

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


Joined: 11 Aug 2004
Posts: 30
Topics: 10

PostPosted: Mon Aug 06, 2007 6:31 am    Post subject: Reply with quote

Thanks Kolusu

I mind is totally thick today and i couldn't think of this concatenation. bonk

Thanks

Siva
Back to top
View user's profile Send private message
rsivananda
Beginner


Joined: 11 Aug 2004
Posts: 30
Topics: 10

PostPosted: Tue Aug 07, 2007 9:29 am    Post subject: Reply with quote

Hi Kolusu
I am kind of back again as the concatenation is not helping me out.
Please have a look at the files below
File1: VB, LRECL=1000 The USERID startes with A is 7 characters Ex:A109944

..07-08-2007000A109944 0000
..07-08-2007000A114441 0000
..07-08-2007000A147196 0000
..07-08-2007000A147196 0000
..07-08-2007000A147196 ALL
..07-08-2007000A147196 ALL
..07-08-2007000A276832 0000
..07-08-2007000A276832 ALL
..07-08-2007000A276832 ALL

File 2: FB LRECL 80

A109944
A147196

Output:

All those records with userIDS which are on file2 should be removed from File1 and then output to a OUTFILE

So the OUTFILE is VB LRECL 1000

..07-08-2007000A114441 0000
..07-08-2007000A276832 0000
..07-08-2007000A276832 ALL
..07-08-2007000A276832 ALL


we do have SORT and ICETOOL

Please let me know if you need any further info.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Aug 07, 2007 9:49 am    Post subject: Reply with quote

rsivananda,

Your request has changed from your initial post. You canNOT use the concatenation and eliminate alldups as your file1 has dups.

what is the max record count you expect for file2? Run this sample job and post the contents of sysout

Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*   
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=COPY
/*


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


Joined: 11 Aug 2004
Posts: 30
Topics: 10

PostPosted: Tue Aug 07, 2007 9:57 am    Post subject: Reply with quote

File 2 will just have unique IDs and no dups like file1
File1 is the master file of users and file 2 has users who should be eliminated from file1

The output file thus resulted should be processed.





----

output of Sysout.
Code:

1ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                               
 ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES A
 ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 16:54 ON TUE AU
0            SORT FIELDS=COPY                                                   
 ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
 ICE751I 0 C5-K90007 C6-K90007 C7-K90000 C8-K90007 E9-K90007 C9-BASE   E5-K22788
 ICE193I 0 ICEAM1 ENVIRONMENT IN EFFECT - ICEAM1 INSTALLATION MODULE SELECTED   
 ICE088I 0 F256479X.STEP0100.        , INPUT LRECL = 80, BLKSIZE = 80, TYPE = F
 ICE093I 0 MAIN STORAGE = (MAX,6291456,6278238)                                 
 ICE156I 0 MAIN STORAGE ABOVE 16MB = (6200798,6200798)                         
 ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y
 ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=524288,MINLIM=450560,EQUALS=N,LIST=Y,ERE
 ICE129I 0 OPTIONS: VIO=Y,RESDNT=ALL ,SMF=FULL ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT
 ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT
 ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW
 ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE    ,EXIT
 ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=80  ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAM
 ICE235I 0 OPTIONS: NULLOUT=RC0                                                 
 ICE084I 0 BSAM ACCESS METHOD USED FOR SORTOUT                                 
 ICE084I 0 BSAM ACCESS METHOD USED FOR SORTIN                                   
 ICE751I 1 EF-K10929 F0-Q84357 E8-K19114                                       
 ICE090I 0 OUTPUT LRECL = 80, BLKSIZE = 80, TYPE = F                           
 ICE055I 0 INSERT 0, DELETE 0                                                   
 ICE054I 0 RECORDS - IN: 1, OUT: 1                                             
 ICE052I 0 END OF DFSORT
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: Tue Aug 07, 2007 11:38 am    Post subject: Reply with quote

rsivananda,

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed your 7-byte key in the VB input file starts in position 20 (counting the RDW), but you can change the job appropriately if it's in another position.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1 (VB/1000)
//IN2 DD DSN=...  input file2 (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS),
// LRECL=1009
//OUT DD DSN=...  output file (VB/1000)
//TOOLIN   DD    *
COPY FROM(IN2) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(7,7,CH) KEEPNODUPS KEEPBASE -
  VLENOVLY WITHALL WITH(6,1003) USING(CTL3)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,FTOV,BUILD=(C'BB',1,7)
/*
//CTL2CNTL DD *
  INREC BUILD=(1,4,5:C'VV',7:20,7,14:5)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(5,2,CH,EQ,C'VV'),
    BUILD=(1,4,5:14)
/*

_________________
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