I have a file which has the record in this order in FILE A
Incident number(10) Ind1(1) Ind2(1)
the possible values of Ind 1 and Ind 2 are P,G and A,B respectively
eg-
Code:
0000000091 P A
0000000091 G A
0000000072 P B
0000000051 G B
I have another file, FILE B that has the Incident number field at 20 pos
My requirement is that I want to check FILE A for the incident number and possible combination 'P A' ,'G A','P B' and 'G B'.
I need omit sort cards in such a way so that- for eg
it checks for 'P A' and all incident no.
it checks for 'P B' and all incident no.
it checks for 'G A' and all incident no.
it checks for 'G B' and all incident no.
so i need 4 omit sort cards for all this,
for the incident numbers alone i had this sort card
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Please note that your post has been Code'd to preserve the spacing.
Can you show sample data, RECFM and LRECL, for both input files, and expected output from that, with matches, not matches, whatever. I think you are better looking at JOINKEYS, but can't be certain until we see what you want.
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 55BA6, MODEL 2817 708
SYSIN :
SORT FIELDS=COPY
WER276B SYSDIAG= 7613154, 12987187, 12987187, 8178825
WER164B 6,896K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 440K BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER073I SORTIN : DSNAME=Z1225DJ.F0091CVT.JOB00968.D0000101.?
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER074I SORTOUT : DSNAME=Z1225DJ.F0091CVT.JOB00968.D0000104.?
WER410B 5,868K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 324K BYTES USED
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER416B BSAM WAS USED FOR SORTIN
WER416B BSAM WAS USED FOR SORTOUT
WER054I RCD IN 1, OUT 1
WER169I RELEASE 1.4 BATCH 0520 TPF LEVEL 0.1
WER052I END SYNCSORT - F0091CVT,STEP0100,,DIAG=AC00,6242,8084,00CC,E47A,48CB,8688,8460
The requirement is as follows, to make it simpler i have used id that resembles to file name:
There are 3 files
FILE A( FB nad LRECL 80)
FILE B( FB nad LRECL 200)
FILE C( FB nad LRECL 200)
FILE A CONTENTS
Code:
0000000091 P B
0000000095 G B
0000000072 P C
0000000051 G C
these are the meanings of indicators-
A and B indicate whether record need to be omitted from FILE B or FILE C
P-(type 1 incident),G(Type 2 incident) so P and G are types of incidents
if an incident no. is given with a P in file 1 , then the incident number is at pos 20 in FILEB or FILEC
if an incident no. is given with a G in file 1 , then the incident number is at pos 40 in FILEB or FILE C
So, based on these indicators i need omit sort condition to delete records from the 2 files FILE B and FILE C
0000000091 P B
0000000095 G B
0000000072 P C
0000000051 G C
in the first record for the incident no. '0000000091' the indicator at 12 pos is P and at 14 pos is B
means that record needs to be deleted from file B and the incident no. will be at pos 20 in FILE B(indicated by 'P' in FILE A)
same way for 2nd record ithe incident no. '0000000095' the indicator at 12 pos is G and at 14 pos is B
means that record needs to be deleted from file B and the incident no. will be at pos 40 in FILE B(indicated by 'G' in FILE A)
same way for 3rd record ithe incident no. '0000000072' the indicator at 12 pos is P and at 14 pos is C
means that record needs to be deleted from file C and the incident no. will be at pos 20 in FILE C(indicated by 'P' in FILE A)
same way for 4th record ithe incident no. '0000000051' the indicator at 12 pos is G and at 14 pos is c
means that record needs to be deleted from file C and the incident no. will be at pos 40 in FILE C(indicated by 'G' in FILE A)
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
Your output shows you are using SYNCSORT, not DFSORT. You have posted in the wrong forum - you should be in the JCL forum which is for both JCL and SYNCSORT.
Also, you have now changed from using A and B indicators to B and C indicators and these now appear to indicate from which of the files the records are to be removed. I asked for clarification on this yesterday but your response to that request did not clarify.
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
I think as though you are over complicating this with Files B and C and the 'delete from' approach.
Try to redefine your requirements with just two input files 1 and 2 (since B and C are the same anyway).
You can then use a combination of Cond and Joinkeys (with unpaired 2) to select the ones you want from file 2 to go to output file 1 and the ones you want to go output file 2.
This positive logic is much easier for the human mind to process (at least my mind).
Gary, sorry for posting this in DFSORT , i will repost in syncsort, i made indicators as B and C to make it sound easy , so that indicators match the file name
daveporcelan, these files B and C are not completely same, however many records are same. the records which i need to delete using sort card will exist in both files but that does not mean files are same. I just gave sample data as asked
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
How many records are in each of these files?
The reason I ask is that an alternate approach (Rexx maybe) may be in order.
From my observation, a multiple pass Syncsort solution would be required.
You would need at least one step to Joinkeys on A and B and and another to Joinkeys A and C. There may even be two for each because the key in B and C varies based on the P/G value in A.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
I was providing an OMIT that I thought you could then generate...
However...
As you do not know the P/G, except on FILE A, I don't think ANY single OMIT is going to do what you want (as you show in your data, that an incident number could be in either place on FILE B or C).
I think you would need to pass each of the two files twice, with different OMITs.
It is either that or "program time", or try to work out what Kolusu had in mind :-), bearing in mind also that there are things like JNFnCNTL files which DFSORT has and your SyncSort may not.