Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SYNCSORT in Z/VSE
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
nithinkarthika

New User


Joined: 26 Apr 2020
Posts: 11
Location: India

PostPosted: Mon May 11, 2020 3:44 pm    Post subject: SYNCSORT in Z/VSE
Reply with quote

Hi,

I have a requirement to compare two VSAM F using SYNCSORT in Z/VSE. The record size of both the input files are same. The first 22 character length field is the key field in both the files. I want to find out all the records in file 2 matching with key field in file 1. I tried to write a sort jcl using JOINKEYS, but its giving errors. I am new in Z/VSE environment, so could someone please direct me to achieve this

Code:

// DLBL SRTJNF1,'file 1',0,VSAM,CAT=ID
// DLBL SRTJNF2,'file 2',0,VSAM,CAT=ID
// DLBL SORTOUT,'output file',0,VSAM,DISP=(,KEEP), RECORDS=(100,100),
                             RECSIZE=775,CAT=ID
// EXEC SORT
   SORT FIELDS= COPY
   JOINKEYS FILES=F1,FIELDS=(1,10,A)
   JOINKEYS FILES=F2,FIELDS=(1,10,A)
   REFORMAT FIELDS=(F2:1,775)
Back to top
View user's profile Send private message

Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 342
Location: Bamberg, Germany

PostPosted: Mon May 11, 2020 3:57 pm    Post subject:
Reply with quote

Please post the error msgs as well. Between your SORT FIELDS= and the following COPY should not be a blank, btw.
Back to top
View user's profile Send private message
nithinkarthika

New User


Joined: 26 Apr 2020
Posts: 11
Location: India

PostPosted: Mon May 11, 2020 4:09 pm    Post subject:
Reply with quote

Hi Joerg.

Thanks for your reply. Sorry, the space between SORT FIELDS and COPY is a typo.
Please find the error message below.

Code:

// DLBL SRTJNF1,'file1',0,VSAM,CAT=ID
1S03D INVALID STATEMENT
// DLBL SRTJNF1,'file2',0,VSAM,CAT=ID
1S03D INVALID STATEMENT
SYNCSORT for Z/VSE version number
SORT FIELDS=COPY
JOINKEYS FILES=F1,FIELDS=(1.22,A)
JOINKEYS FILES=F2,FIELDS=(1.22,A)
REFORMAT FIELDS=(F2:1,775)

WER115A  REQ'D PARM MISSING ON JOINKEYS STMT
WER115A  REQ'D PARM MISSING ON JOINKEYS STMT
WER234A  DIAG= 00000000 00000000 00000000  00000400 00370000 00000000
WER400A  CRITICAL ERROR, SORT TERMINATED
WER117A  PHASE 0 HAS CRITICAL ERROR

Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 342
Location: Bamberg, Germany

PostPosted: Mon May 11, 2020 4:23 pm    Post subject:
Reply with quote

It seems your allocation of F1 and F2 are wrong. Unfortunately I can't help with that.
Code:
// DLBL SRTJNF1,'file1',0,VSAM,CAT=ID
1S03D INVALID STATEMENT
// DLBL SRTJNF1,'file2',0,VSAM,CAT=ID
1S03D INVALID STATEMENT
Back to top
View user's profile Send private message
nithinkarthika

New User


Joined: 26 Apr 2020
Posts: 11
Location: India

PostPosted: Mon May 11, 2020 4:42 pm    Post subject:
Reply with quote

Is there any other methods to compare two files. I want to find all the records in file 2 matching with key field in file 1. The first 22 character length field is the key field in both the files.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 860
Location: Maryland

PostPosted: Mon May 11, 2020 4:43 pm    Post subject:
Reply with quote

nithinkarthika wrote:
Code:

JOINKEYS FILES=F1,FIELDS=(1.22,A)
JOINKEYS FILES=F2,FIELDS=(1.22,A)

You cannot specify field positions as "one point twenty two"

It must be "one comma twenty two"
Back to top
View user's profile Send private message
nithinkarthika

New User


Joined: 26 Apr 2020
Posts: 11
Location: India

PostPosted: Mon May 11, 2020 4:46 pm    Post subject:
Reply with quote

Hi Sergeyken,

Sorry, there were some issues while typing the code. Please find below the jcl statements and error message.

Code:

// DLBL SRTJNF1,'file 1',0,VSAM,CAT=ID
// DLBL SRTJNF2,'file 2',0,VSAM,CAT=ID
// DLBL SORTOUT,'output file',0,VSAM,DISP=(,KEEP), RECORDS=(100,100),
                             RECSIZE=775,CAT=ID
// EXEC SORT
   SORT FIELDS=COPY
   JOINKEYS FILES=F1,FIELDS=(1,22,A)
   JOINKEYS FILES=F2,FIELDS=(1,22,A)
   REFORMAT FIELDS=(F2:1,775)


output error message

Code:

// DLBL SRTJNF1,'file1 name',0,VSAM,CAT=ID
1S03D INVALID STATEMENT
// DLBL SRTJNF1,'file2 name',0,VSAM,CAT=ID
1S03D INVALID STATEMENT
SYNCSORT for Z/VSE version number
SORT FIELDS=COPY
JOINKEYS FILES=F1,FIELDS=(1,22,A)
JOINKEYS FILES=F2,FIELDS=(1,22,A)
REFORMAT FIELDS=(F2:1,775)

WER115A  REQ'D PARM MISSING ON JOINKEYS STMT
WER115A  REQ'D PARM MISSING ON JOINKEYS STMT
WER234A  DIAG= 00000000 00000000 00000000  00000400 00370000 00000000
WER400A  CRITICAL ERROR, SORT TERMINATED
WER117A  PHASE 0 HAS CRITICAL ERROR
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 860
Location: Maryland

PostPosted: Mon May 11, 2020 5:10 pm    Post subject:
Reply with quote

RTFM carefully!
Code:

 JOINKEYS  {FILE=F1   }
           {     F2   }
           {F1=ddname }
           {F2=ddname }
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 342
Location: Bamberg, Germany

PostPosted: Mon May 11, 2020 5:14 pm    Post subject:
Reply with quote

Could you try and omit the CAT=ID parameter for the DLBL allocation? It seems it either requires an additional DLBL statement if you want to use it but for VSAM it seems to not be necessary.
Back to top
View user's profile Send private message
nithinkarthika

New User


Joined: 26 Apr 2020
Posts: 11
Location: India

PostPosted: Mon May 11, 2020 6:12 pm    Post subject:
Reply with quote

Hi Joerg,

Thank you for assistance. The Invalid statement error has been resolved.
But the second error is still there, "REQ'D PARM MISSING ON JOINKEYS STMT". Not getting what PARM value is missing in the statements !
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 342
Location: Bamberg, Germany

PostPosted: Mon May 11, 2020 6:20 pm    Post subject:
Reply with quote

Please see what sergeyken has written:
Code:
JOINKEYS FILE=F1,FIELDS=(1,22,A)

and you have (FILES instead of FILE)
Code:
JOINKEYS FILES=F1,FIELDS=(1,22,A)

Hopefully it's just that. icon_wink.gif
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 860
Location: Maryland

PostPosted: Mon May 11, 2020 6:22 pm    Post subject:
Reply with quote

Joerg.Findeisen wrote:
Please see what sergeyken has written:
Code:
JOINKEYS FILE=F1,FIELDS=(1,22,A)

and you have (FILES instead of FILE)
Code:
JOINKEYS FILES=F1,FIELDS=(1,22,A)

Hopefully it's just that. icon_wink.gif

Those not able to RTFM, cannot read clear answers, too...
Back to top
View user's profile Send private message
nithinkarthika

New User


Joined: 26 Apr 2020
Posts: 11
Location: India

PostPosted: Mon May 11, 2020 7:18 pm    Post subject:
Reply with quote

Hi Sergeyken/Joerg,

I changed from FILES to FILE but no luck. I am getting the same error message, "REQ'D PARM MISSING ON JOINKEYS STMT".


Before
Code:

JOINKEYS FILES=F1,FIELDS=(1,22,A)
JOINKEYS FILES=F2,FIELDS=(1,22,A)
REFORMAT FIELDS=(F2:1,775)


After
Code:

JOINKEYS FILE=F1,FIELDS=(1,22,A)
JOINKEYS FILE=F2,FIELDS=(1,22,A)
REFORMAT FIELDS=(F2:1,775)
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 860
Location: Maryland

PostPosted: Mon May 11, 2020 7:42 pm    Post subject:
Reply with quote

nithinkarthika wrote:
Hi Sergeyken/Joerg,

I changed from FILES to FILE but no luck. I am getting the same error message, "REQ'D PARM MISSING ON JOINKEYS STMT".


Before
Code:

JOINKEYS FILES=F1,FIELDS=(1,22,A)
JOINKEYS FILES=F2,FIELDS=(1,22,A)
REFORMAT FIELDS=(F2:1,775)


After
Code:

JOINKEYS FILE=F1,FIELDS=(1,22,A)
JOINKEYS FILE=F2,FIELDS=(1,22,A)
REFORMAT FIELDS=(F2:1,775)

Are you sure you’re running the same code?

Are you sure you’re looking into the right log version?

Since you demonstrated inability to fix primitive syntax errors, I do not believe your presented information is correct.

Copy and paste THE FULL LOG WITH FULL ELEMENTS OF IT JUST COPIED, not re-typed manually, and not re-told by your own words. Otherwise it makes no sense to waste more time on you.
Back to top
View user's profile Send private message
nithinkarthika

New User


Joined: 26 Apr 2020
Posts: 11
Location: India

PostPosted: Mon May 11, 2020 7:57 pm    Post subject:
Reply with quote

Hi Sergeyken,

Please find the log copied directly from spool.


Code:

SYNCSORT FOR Z/VSE REL 3.7D
   SORT FIELDS=COPY                                                             
   JOINKEYS FILE=F1,FIELDS=(1,22,A)                                             
   JOINKEYS FILE=F2,FIELDS=(1,22,A)                                             
   REFORMAT FIELDS=(F2:1,775)                                                   
                                                                               
   WER115A  REQ'D PARM MISSING ON JOINKEYS STMT                                 
   WER115A  REQ'D PARM MISSING ON JOINKEYS STMT                                 
   WER234A  DIAG= 00000000 00000000 00000000 00000400 00370000 00000000         
   WER400A  CRITICAL ERROR, SORT TERMINATED   
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 342
Location: Bamberg, Germany

PostPosted: Mon May 11, 2020 8:16 pm    Post subject:
Reply with quote

Please let's change the JOINKEYS as follows:
Code:
JOINKEYS FILE=F1,FIELDS=(1,22,A)                                             
JOINKEYS FILE=F2,FIELDS=(1,22,A)

to
Code:
JOINKEYS F1=SRTJNF1,FIELDS=(1,22,A)                                             
JOINKEYS F2=SRTJNF2,FIELDS=(1,22,A)

and check one more time that those DLBL are defined correctly (1 and 2).
Code:
// DLBL SRTJNF1 ..
// DLBL SRTJNF2 ..
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 860
Location: Maryland

PostPosted: Mon May 11, 2020 9:33 pm    Post subject:
Reply with quote

nithinkarthika wrote:
Hi Sergeyken,

Please find the log copied directly from spool.


Code:

SYNCSORT FOR Z/VSE REL 3.7D
   SORT FIELDS=COPY                                                             
   JOINKEYS FILE=F1,FIELDS=(1,22,A)                                             
   JOINKEYS FILE=F2,FIELDS=(1,22,A)                                             
   REFORMAT FIELDS=(F2:1,775)                                                   
                                                                               
   WER115A  REQ'D PARM MISSING ON JOINKEYS STMT                                 
   WER115A  REQ'D PARM MISSING ON JOINKEYS STMT                                 
   WER234A  DIAG= 00000000 00000000 00000000 00000400 00370000 00000000         
   WER400A  CRITICAL ERROR, SORT TERMINATED   

The full log assumes everything, including JCL log, and JCL source
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 342
Location: Bamberg, Germany

PostPosted: Mon May 11, 2020 9:43 pm    Post subject:
Reply with quote

@sergeyken: This is a fact indeed. icon_exclaim.gif

It seems to me that the DD's are wrong. They were named SRTJNF1 and SRTJNF2 but should be SORTJNF1 and SORTJNF2 for FILE=Fn format. When switching to the Fn=DDname format the job should run. Otherwise I am temporary out of ideas here.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2487
Location: NY,USA

PostPosted: Tue May 12, 2020 12:02 am    Post subject:
Reply with quote

And assuming they are sorted, may also try adding ,
Code:
JOINKEYS FILE=F1,FIELDS=(1,22,A),SORTED,NOSEQ


If nothing works then please write a program or use other utilities you have at your site.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 317
Location: Inside the SPEW (Cincinnati OH USA)

PostPosted: Tue May 12, 2020 12:27 am    Post subject:
Reply with quote

If I recall,

// DLBL filename, 'file-id',...

filename is limited to 7 characters in VSE

filename is equivalent to DD and file-id is equivalent to DSN in Z/OS
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 -> SYNCSORT All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SYNCSORT Error - CONTROL FIELD BEYOND... arunn SYNCSORT 10 Sun Oct 04, 2020 4:10 pm
No new posts Populating Date and Sequence numer in... PORYES SYNCSORT 11 Thu Jul 16, 2020 5:01 pm
No new posts Insert System Runtime in HEADER In SY... Rick Ryan SYNCSORT 9 Tue May 26, 2020 9:01 pm
No new posts Removing Hyphens and Dots using Syncsort PORYES SYNCSORT 8 Tue Apr 28, 2020 9:52 pm
No new posts Accumulating fields using syncsort Hemant L SYNCSORT 6 Fri Feb 07, 2020 2:55 am

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us