View previous topic :: View next topic |
Author |
Message |
rogervais Beginner
Joined: 19 May 2010 Posts: 6 Topics: 2
|
Posted: Sun May 23, 2010 3:10 pm Post subject: Continuing after an error |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Sun May 23, 2010 8:45 pm Post subject: |
|
|
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 |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Mon May 24, 2010 12:33 am Post subject: |
|
|
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 |
|
 |
rogervais Beginner
Joined: 19 May 2010 Posts: 6 Topics: 2
|
Posted: Mon May 24, 2010 11:25 am Post subject: |
|
|
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 |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Mon May 24, 2010 11:42 am Post subject: |
|
|
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 |
|
 |
rogervais Beginner
Joined: 19 May 2010 Posts: 6 Topics: 2
|
Posted: Mon May 24, 2010 11:51 am Post subject: |
|
|
PDSLOOP Code: |
Address ISPEXEC "EDIT DATASET('"pds"("mem")') MACRO("IsrtComm")"
|
ISRTCOMM Code: |
/* REXX MACRO */
ADDRESS ISREDIT
"MACRO (PARM) PROCESS" |
|
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
rogervais Beginner
Joined: 19 May 2010 Posts: 6 Topics: 2
|
Posted: Mon May 24, 2010 11:53 am Post subject: |
|
|
Thanks for your help
I needed
Address ISPEXEC 'CONTROL ERRORS RETURN'
in the MACRO |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Mon May 24, 2010 10:52 pm Post subject: |
|
|
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 |
|
 |
rogervais Beginner
Joined: 19 May 2010 Posts: 6 Topics: 2
|
Posted: Fri May 28, 2010 12:40 pm Post subject: |
|
|
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 |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Fri May 28, 2010 1:55 pm Post subject: |
|
|
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 |
|
 |
|
|