IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SORT inside a PROC


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chatterjesis

New User


Joined: 31 Aug 2008
Posts: 31
Location: hyderabad

PostPosted: Fri Mar 30, 2012 1:03 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Mar 30, 2012 1:13 pm
Reply with quote

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
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Mar 30, 2012 1:13 pm
Reply with quote

IFIRC, passing JPn parameters is a function of DFSORT, not Syncsort ?

The WER268A message indicates you're using Syncsort.

Garry.
Back to top
View user's profile Send private message
xknight

Active User


Joined: 22 Jan 2008
Posts: 117
Location: Liberty city

PostPosted: Fri Mar 30, 2012 2:11 pm
Reply with quote

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
View user's profile Send private message
chatterjesis

New User


Joined: 31 Aug 2008
Posts: 31
Location: hyderabad

PostPosted: Fri Mar 30, 2012 2:22 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Mar 30, 2012 2:39 pm
Reply with quote

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
View user's profile Send private message
chatterjesis

New User


Joined: 31 Aug 2008
Posts: 31
Location: hyderabad

PostPosted: Fri Mar 30, 2012 8:13 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Mar 31, 2012 3:08 am
Reply with quote

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
View user's profile Send private message
chatterjesis

New User


Joined: 31 Aug 2008
Posts: 31
Location: hyderabad

PostPosted: Mon Apr 02, 2012 11:01 am
Reply with quote

Thanks Bill..

I have taken help from below link and it solved my problem.

ibmmainframes.com/about36208.html


Thanks to all for your responses.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
Search our Forums:

Back to Top