View previous topic :: View next topic
Author
Message
raj4neo Warnings : 1 New User Joined: 12 May 2006Posts: 51 Location: India
I have a requirement to compare two PS Files File 1 and File2 , Both are Fixed length , I need to write the matched record in o/p file and matched should be deleted from the File1
Eg :
File 1 :
111
222
333
444
555
File2
333
777
555
requirement 1:
O/p file should be
333
555
Requirement 2 :
333
555 should be deleted from File1
i have the answer for requirement 1 using Join keys
Is it possible to drop the matched records from file 1
Thanks in advance for your help
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Huh?
Requirement 1 is apparently to get just the matching records in File1 (333 and 555).
But I don't understand what you want for requirement 2. You show:
Requirement 2 :
333
555 should be deleted from File1
I have no idea what you mean by that. 333 and 555 are both in input file1 and input file2 so by what rule would you keep 333 but delete 555?
Do you want a second output file with the non-matching records from File 1 (111, 222 and 444) or do you want something else?
Show the output you actually expect for requirement 2 from your example of input file1 and input file2. Explain clearly what you want in the output for each requirement. Do you want to produce two output files (output file1 for requirement 1 and output file2 for requirement 2) in the same run, or do you want something else?
Back to top
raj4neo Warnings : 1 New User Joined: 12 May 2006Posts: 51 Location: India
want a second output file with the non-matching records from File 1 (111, 222 and 444) or do you want something else?
Back to top
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
Hi,
try this job which works with DFSORT:
Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD *
111
222
333
444
555
//IN2 DD *
333
777
555
//MATCHES DD SYSOUT=*
//NOMATCH1 DD SYSOUT=*
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(1,3,A)
JOINKEYS F2=IN2,FIELDS=(1,3,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,80,?)
OPTION COPY
OUTFIL FNAMES=MATCHES,INCLUDE=(81,1,CH,EQ,C'B'),BUILD=(1,80)
OUTFIL FNAMES=NOMATCH1,INCLUDE=(81,1,CH,EQ,C'1'),BUILD=(1,80)
/*
Gerry
Back to top
raj4neo Warnings : 1 New User Joined: 12 May 2006Posts: 51 Location: India
My file has a record length of 730 ,
Total length of the file is Key
Back to top
raj4neo Warnings : 1 New User Joined: 12 May 2006Posts: 51 Location: India
i tried with this
Code:
JOINKEYS FILES=F1,FIELDS=(1,730,A)
JOINKEYS FILES=F2,FIELDS=(1,730,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,730,800)
OPTION COPY
OUTFIL FNAMES=MATCHES,INCLUDE=(731,1,CH,EQ,C'B'),BUILD=(1,730)
OUTFIL FNAMES=NOMATCH1,INCLUDE=(731,1,CH,EQ,C'1'),BUILD=(1,730)
Its giving ABENDU0016
Back to top
raj4neo Warnings : 1 New User Joined: 12 May 2006Posts: 51 Location: India
Code:
SYSIN :
JOINKEYS FILES=F1,FIELDS=(1,730,A) 0024000
JOINKEYS FILES=F2,FIELDS=(1,730,A) 0025000
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,730) 0026000
OPTION COPY
OUTFIL FNAMES=MATCHES,INCLUDE=(1,730,CH,EQ,C'B'),BUILD=(1,730) 0027100
*
OUTFIL FNAMES=NOMATCH1,INCLUDE=(1,730,CH,EQ,C'1'),BUILD=(1,730) 0027100
*
WER251A INCLUDE/OMIT INVALID LENGTH
WER251A INCLUDE/OMIT INVALID LENGTH
Back to top
enrico-sorichetti Superior Member Joined: 14 Mar 2007Posts: 10873 Location: italy
just take a decision ...
in one post You show
Code:
OUTFIL FNAMES=MATCHES,INCLUDE=(731,1,CH,EQ,C'B'),BUILD=(1,730)
OUTFIL FNAMES=NOMATCH1,INCLUDE=(731,1,CH,EQ,C'1'),BUILD=(1,730)
in the other one
Code:
OUTFIL FNAMES=MATCHES,INCLUDE=(1,730,CH,EQ,C'B'),BUILD=(1,730)
OUTFIL FNAMES=NOMATCH1,INCLUDE=(1,730,CH,EQ,C'1'),BUILD=(1,730)
You are comparing a 730 bytes long something with a 1 byte someotherthing
Back to top
raj4neo Warnings : 1 New User Joined: 12 May 2006Posts: 51 Location: India
I was new to this and i was try with different thing
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
Confirmed as Syncsort anyway.
EDIT:
Gerry was using 80-byte records, with key of length three. Just change the lengths.
Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD dsn=
//IN2 DD dsn=
//MATCHES DD dsn=
//NOMATCH1 DD dsn=
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(1,730,A)
JOINKEYS F2=IN2,FIELDS=(1,730,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,730,?)
OPTION COPY
OUTFIL FNAMES=MATCHES,INCLUDE=(731,1,CH,EQ,C'B'),BUILD=(1,730)
OUTFIL FNAMES=NOMATCH1,INCLUDE=(731,1,CH,EQ,C'1'),BUILD=(1,730)
/*
EDIT AGAIN: And assume it works with your release of Syncsort.
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Quote:
And assume it works with your release of Syncsort.
That may be a bad assumption. Although Bill's job works with DFSORT, it will not necessarily work with Syncsort (regardless of the version) because DFSORT supports JOINKEYS functions that Syncsort does NOT support.
Back to top
raj4neo Warnings : 1 New User Joined: 12 May 2006Posts: 51 Location: India
Code:
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 1E9D6, MODEL 2817 709
SYSIN :
JOINKEYS FILES=F1,FIELDS=(1,730,A)
JOINKEYS FILES=F2,FIELDS=(1,730,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,730,?)
*
OPTION COPY
OUTFIL FNAMES=MATCHES,INCLUDE=(731,1,CH,EQ,C'B'),BUILD=(1,730)
OUTFIL FNAMES=NOMATCH1,INCLUDE=(731,1,CH,EQ,C'1'),BUILD=(1,730)
WER268A REFORMAT STATEMENT: SYNTAX ERROR
Please some one help me how to resolve this
Back to top
raj4neo Warnings : 1 New User Joined: 12 May 2006Posts: 51 Location: India
If its Possible in ICETOOL also it will be Great .. Thanks for your support
Back to top
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
Hi,
I'm preet sure that SYNCSORT does not have an F1 and F2 indicator, so you can try this
Code:
JOINKEYS FILE=F1,FIELDS=(1,730,A)
JOINKEYS FILE=F2,FIELDS=(1,730,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,730,F2:1,730)
OPTION COPY
OUTFIL FNAMES=NOMATCH1,
INCLUDE=(731,01,CH,EQ,C' '),
OUTREC=(1,730)
OUTFIL FNAMES=MATCHES,
INCLUDE=(001,256,CH,EQ,0731,256,CH,&,
256,256,CH,EQ,0987,256,CH,&,
513,218,CH,EQ,1243,218,CH),
OUTREC=(01,730)
Gerry
Back to top
raj4neo Warnings : 1 New User Joined: 12 May 2006Posts: 51 Location: India
Gerry ,
I tried with this sort card
Its not writing the matched record in the File
NOMATCH1 : DATA RECORDS OUT 27930; TOTAL RECORDS OUT 27930
MATCHES : DATA RECORDS OUT 0; TOTAL RECORDS OUT 0
Back to top
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
Hi,
can you try creating the 2 files with the data you provided above and rerun the job.
Gerry
Back to top
raj4neo Warnings : 1 New User Joined: 12 May 2006Posts: 51 Location: India
Gerry , i tried with below
Code:
JOINKEYS FILES=F1,FIELDS=(1,730,A)
JOINKEYS FILES=F2,FIELDS=(1,730,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,730,F2:1,730),FILL=C'$'
OPTION COPY
OUTFIL FNAMES=NOMATCH1,
INCLUDE=(731,01,CH,EQ,C'$'),
OUTREC=(1,730)
OUTFIL FNAMES=MATCHES,
INCLUDE=(731,1,CH,NE,C'$',AND,731,1,CH,NE,C'$'),
OUTREC=(01,730)
Its working fine , Thanks for your extended support
Back to top
raj4neo Warnings : 1 New User Joined: 12 May 2006Posts: 51 Location: India
Can some one please help me on with Variable Length file having LRECL of 3313 ,
Both Infiles are having similar variable length of 3313
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
It is possible. Can we have a clue as to what sort of help you want?
Back to top
raj4neo Warnings : 1 New User Joined: 12 May 2006Posts: 51 Location: India
FILE1 Variable length file 3313
File 2 Variable length file 3313
i need to compare two files and which is having key of 1-1000
Output file 1 : should have matched records
Output file 2: with the non-matching records from File 1
Back to top
enrico-sorichetti Superior Member Joined: 14 Mar 2007Posts: 10873 Location: italy
Back to top
raj4neo Warnings : 1 New User Joined: 12 May 2006Posts: 51 Location: India
Please continue here
Back to top
raj4neo Warnings : 1 New User Joined: 12 May 2006Posts: 51 Location: India
I was trying to Sort two PS file with VB record having Lrecl 3313 , Using Joinkeys to identify Matched records and Unmatched record from file
If i try with 20 records its working fine , the same sortcard if i try for 70000 records its giving
SYSTEM COMPLETION CODE=0C4 REASON CODE=00000004
Sort card used is
Code:
JOINKEYS FILES=F1,FIELDS=(5,1000,A)
JOINKEYS FILES=F2,FIELDS=(5,1000,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,3313,F2:1,3313),FILL=X'FF'
OPTION COPY
OUTFIL FNAMES=NOMATCH1,
INCLUDE=(3318,1,CH,EQ,X'FF'),
OUTREC=(05,3309),FTOV,VLTRIM=X'FF'
OUTFIL FNAMES=MATCHES,
INCLUDE=(3318,1,CH,NE,X'FF',AND,3318,1,CH,NE,X'FF'),
OUTREC=(05,3309),FTOV,VLTRIM=X'FF'
Could you some one please help me to resolve soc4 abend
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
Do you have any records on your file which are shorter than 1000 bytes?
Do you have records of different types that you shouldn't be including, in general, not related to the abend.
Back to top
raj4neo Warnings : 1 New User Joined: 12 May 2006Posts: 51 Location: India
no all the records greater than 1000
i tried using PARM='MAXSORT,FILSZ=E20M,MINWKSP=60'
but i got error as
WER479A MAXSORT MAY NOT BE USED IN A JOIN APPLICATION
I got the errors as SRTMAT - ABEND=S000 U0016 REASON=00000000
sometimes
UNSUCCESSFUL SORT 0C4 S
SYSTEM COMPLETION CODE=0C4 REASON CODE=00000004
Please help me to resolve
Back to top
Please enable JavaScript!