MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Continuing after an error

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
rogervais
Beginner


Joined: 19 May 2010
Posts: 6
Topics: 2

PostPosted: Sun May 23, 2010 3:10 pm    Post subject: Continuing after an error Reply with quote

Is it possible to reset the Return Code (RC) value back to zero???
I'm trying to insert comments in a Cobol program. I want to insert after finding an alpha in cols 73 80
ADDRESS ISREDIT "FIND PREV P'@' 73 80"
But sometimes there are no alphas so the RC is set to 28. I want to reset the return code back to zero after that.
RC = 0 does not work as I get a 28 on a valisd instruction.

Thanks
Roger
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sun May 23, 2010 8:45 pm    Post subject: Reply with quote

rogervais,

The best option is check for RC and issue another find(guaranteed find like spacex'40' ) which would reset the rc to zero

Code:

  IF RC = 28
     SAY ' NO STRING FOUND'
     ADDRESS ISREDIT "FIND PREV X'40' 1 72"
  END


kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Mon May 24, 2010 12:33 am    Post subject: Reply with quote

you won't get a 28 from a not found. 28 is only issued if you don't start the command as an edit macro - in other words, if you type TSO before the command name.
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
rogervais
Beginner


Joined: 19 May 2010
Posts: 6
Topics: 2

PostPosted: Mon May 24, 2010 11:25 am    Post subject: Reply with quote

You do get a return code of 28 when it does not find the string that you are looking for. And then subsequent instructions don't seem to work.

Here is the code that I had:
Code:

ADDRESS ISREDIT "FIND FIRST 'ENVIRONMENT DIV'"   
ADDRESS ISREDIT "FIND PREV P'@' 73 80"           
SAY 'RETURN CODE IS: ' RC                       
ADDRESS ISREDIT "COPY BLOCK2 AFTER .ZCSR"       
ADDRESS ISREDIT "END"     


Code:

 READY                                                                   
  ISPSTART CMD(%PDSLOOP TEST.PROGRAMS)                                   
RETURN CODE IS:  28                                                     
  ISPP330 BDISPMAX exceeded       -/-100 displays exceeded in batch mode
READY                                                                   
END   


Here
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Mon May 24, 2010 11:42 am    Post subject: Reply with quote

What does your PDSLOOP program do? I presume it is meat to do something like:
Code:

ADDRESS ISPEXEC EDIT DATASET('your dataset') IMACRO(your macro as displayed above)


Does your macro start with:
Code:

Address ISPEXEC 'CONTROL ERRORS RETURN'                                         
Address ISREDIT                                                                 
'Macro (param)'


or similar?
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
rogervais
Beginner


Joined: 19 May 2010
Posts: 6
Topics: 2

PostPosted: Mon May 24, 2010 11:51 am    Post subject: Reply with quote

PDSLOOP
Code:

Address ISPEXEC "EDIT DATASET('"pds"("mem")') MACRO("IsrtComm")"

ISRTCOMM
Code:

/* REXX MACRO  */           
ADDRESS ISREDIT             
"MACRO (PARM) PROCESS"
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon May 24, 2010 11:53 am    Post subject: Reply with quote

rogervais,

Please use BBCOde as shown in this topic which makes the posts more readable

http://www.mvsforums.com/helpboards/viewtopic.php?p=19031#19031

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rogervais
Beginner


Joined: 19 May 2010
Posts: 6
Topics: 2

PostPosted: Mon May 24, 2010 11:53 am    Post subject: Reply with quote

Thanks for your help
I needed
Address ISPEXEC 'CONTROL ERRORS RETURN'

in the MACRO
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Mon May 24, 2010 10:52 pm    Post subject: Reply with quote

I still don't understand why you are getting a 28 if this is being started as a macro. Which instruction returns the 28? Usually it is the 'macro' command.
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
rogervais
Beginner


Joined: 19 May 2010
Posts: 6
Topics: 2

PostPosted: Fri May 28, 2010 12:40 pm    Post subject: Reply with quote

Yes it was the macro, I think that I was getting RC 28 because I did not have
Address ISPEXEC 'CONTROL ERRORS RETURN'
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri May 28, 2010 1:55 pm    Post subject: Reply with quote

and will semigeezer hang in there and ask another question or try to make a point???
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group