Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 7315

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: 998
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: 7315

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: 7315

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 sending email from jcl using the mail... niloyarp JCL & VSAM 5 Tue Oct 10, 2017 12:32 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm

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