Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SORT inside a PROC

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SORT inside a PROC
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7235

PostPosted: Fri Mar 30, 2012 1:13 pm    Post subject: Reply to: SORT inside a PROC
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

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri Mar 30, 2012 1:13 pm    Post subject:
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    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7235

PostPosted: Fri Mar 30, 2012 2:39 pm    Post subject: Reply to: SORT inside a PROC
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7235

PostPosted: Sat Mar 31, 2012 3:08 am    Post subject: Reply to: SORT inside a PROC
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    Post subject:
Reply with quote

Thanks Bill..

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

http://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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us