View previous topic :: View next topic
|
Author |
Message |
chatterjesis
New User
Joined: 31 Aug 2008 Posts: 31 Location: hyderabad
|
|
|
|
Hi,
I am having a requirement where SORT is being used inside PROC, and in PROC name of region (defined as RG) is being passed as below
Code: |
//S00 EXEC MYP,RG=XXXX
|
Now my SORT Input is like below
Code: |
PRE YYYY
OWNER
ST
FIND YYYY
++?
FIND JESMSGLG
++S
PRINT FILE LOGFILE
PRINT 1 99999
PRINT CLOSE
|
And my requirement is to replace YYYY with PROC supplied XXXX (or any value) each time it runs.
I tried using FINDREP with &RG, by setting it to a variable JP1.but it is giving syntax error. As below,
Code: |
SYSIN :
OPTION COPY
OUTREC FINDREP=(IN=C'YYYY',OUT=JP1)
*
WER268A OUTREC STATEMENT : SYNTAX ERROR
|
Can anyone help me on this?
Please let me know if more information is needed. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Looks like you'll have to go with updating the code that you want to update... or reviewing other similar Syncsort questions in the JCL forum here.
EDIT: To take account of Gerry's eagle eyes. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
IFIRC, passing JPn parameters is a function of DFSORT, not Syncsort ?
The WER268A message indicates you're using Syncsort.
Garry. |
|
Back to top |
|
|
xknight
Active User
Joined: 22 Jan 2008 Posts: 117 Location: Liberty city
|
|
|
|
Hello,
Quote: |
OUTREC FINDREP=(IN=C'YYYY',OUT=JP1) |
Syntax error occured due to absence of character representation in OUT parm
Should be,
Code: |
(IN=C'YYYY',OUT=C'XXXX') |
And as garry mentioned, JPn parameters doesn't support in SYNCSORT, which is installed at your site. |
|
Back to top |
|
|
chatterjesis
New User
Joined: 31 Aug 2008 Posts: 31 Location: hyderabad
|
|
|
|
Thanks for all your responses.
So is there any other way to do the same functionality using SYNCSORT?
I can not give it as XXXX, as XXXX is to be defined through PROC |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Did you look in the JCL forum for similar questions?
In your case, you can't generate a symbol/SYMNAME, because you can't use that for the IN/OUT of FINDREP. But you can generate a sort card with IFTHEN= and whatever is necessary. |
|
Back to top |
|
|
chatterjesis
New User
Joined: 31 Aug 2008 Posts: 31 Location: hyderabad
|
|
|
|
Thanks Bill for the response.
Can you provide me an example how can I use IF THEN here?As the character to be replaced still remains dynamic, passed through PROC. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Since Syncsort can't take the parameter, you need to find a program which does, which can take a parameter and write that to a file.
Either before writing, or in another step, the parameter has to be formatted to be part of an IFTHEN, or with the FINDREP but with the parameter "hard coded" as the literal associated with the OUT part of the FINDREP. Since it will be "hard coded" in each run, it will be as "dynamic" as you need it to be. |
|
Back to top |
|
|
chatterjesis
New User
Joined: 31 Aug 2008 Posts: 31 Location: hyderabad
|
|
Back to top |
|
|
|