i know this has been done before and was hoping someone is will to share their code.
im looking for a standard header file that will be the start to all my new rexx code.
what im looking for is a header that has the basic syntax to catch syntax error, not ready conditions and on other thing that will return the line e of code that is having issues.
can anyone help me? please.
Bob Brozewicz
Data Transmission Monitoring Unit
Mellon Financial
412 236-3971
brozew...@mellon.net
The information contained in this e-mail may be confidential and is intended solely for the use of the named addressee.
Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorized.
If you are not the intended recipient please notify us immediately by returning the e-mail to the originator.(A)
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX
Its more a template than just a header file.
I've adopted it for my new code and even refitted some old code
to use it. It might be overkill for you, but it has a lot of
nice features that you may come to appreciate and even rely on.
Don't fail to read "How to REXXSKEL" by the same author. It's a
good overview of the thing.
Joe Schwarzbauer
Life Companies PC Support
Mainframe Security and Tech Support
The Reliable Life Insurance Company
314-968-4910 ext 6296
800-325-6658 ext 6296
folks,
-----------------------------------------
CONFIDENTIALITY NOTICE: The information contained in this e-mail and attached document(s) may contain confidential information that is intended only for the addressee(s). If you are not the intended recipient, you are hereby advised that any disclosure, copying, distribution or the taking of any action in reliance upon the information is prohibited. If you have received this e-mail in error, please immediately notify the sender and delete it from your system.
http://www.robinandmariette.com/Mvs/Rexx/RexxUtils.asp
--- Brozewicz Robert F <brozew...@MELLON.COM>
wrote:
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover
> From: Lola Tomillo [SMTP:lola_t...@YAHOO.COM]
>
> I like $START at Robin Murray's Rexx Pages:
>
> http://www.robinandmariette.com/Mvs/Rexx/RexxUtils.asp
>
> --- Brozewicz Robert F <brozew...@MELLON.COM>
> wrote:
> > folks,
> >
> > i know this has been done before and was hoping
> > someone is will to share their code.
> > im looking for a standard header file that will be
> > the start to all my new rexx code.
>
This is what I use:
/* Rexx */
/**********************************************************************/
/* Function:
*/
/* Author:
*/
/**********************************************************************/
/* ChangeControl-Start
*/
/* ChangeControl-End
*/
/* Debug on?
*/
arg argstr
if pos("DEBUG",argstr) \= 0
then trace all
else
do
a = msg("OFF")
a = prompt("OFF")
end
/* establish default environment
*/
address "ISPEXEC"
sysenv = sysvar("SYSENV")
/* error handling
*/
"CONTROL ERRORS RETURN"
Zerrlm = ""
rc = 0
AcceptCC = 8
call on error name Error
call on failure name Error
/********************************************************************/
USER CODE GOES HERE
/********************************************************************/
qquit:
/* abandon ...
*/
AcceptCC = 12
exit
/********************************************************************/
/* Generalised error handling
*/
Error:
/* Return acceptable code to the
program */
if (rc >= 0 & rc <= AcceptCC)
then return
/* Or report the error and terminate
*/
eline = sourceline(sigl)
errCond = condition("C")
errDesc = condition("D")
/* get error text if applicable
*/
if rc > 0 & rc < 100
then etext = errortext(rc)
else etext = ""
/* Check error code
*/
if rc = -3
then etext = "A Host command was not found"
"DISPLAY PANEL(YERRORP)"
and here's the error handling panel:
)attr
! type(output) color(red) caps(off) skip(on)
)Body expand(}})
%}-} dialog error handling }-}
%Command ===>_zcmd
+
Please print this panel and contact your ISPF dialog administrator
+ Return code:!rc +<
+ Rexx error type:!ErrCond+<Source line number!sigl + and text:
+
+ !eline
+ Diagnostic text (only applicable if it is a Rexx error):
+
+ !etext
+ Last ISPF error message, if any:
+
+ !zerrlm
+ Any descriptive text:
+
+ !ErrDesc
)init
.cursor = zcmd
)proc
)end
The Royal Bank of Scotland plc, Registered in Scotland No. 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
The Royal Bank of Scotland plc is authorised and regulated by the Financial Services Authority and represents The Royal Bank of Scotland Marketing Group. The Bank sells life policies, collective investment schemes and pension products and advises only on the Marketing Group's range of these products and on a With-Profit Bond produced by Norwich Union Life (RBS) Limited.
This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent.
Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard and the recipient should carry out such virus and other checks as it considers appropriate.
/* Rexx */
then trace all
else
do
end
Zerrlm = ""
rc = 0
AcceptCC = 8
/********************************************************************/
qquit:
exit
then return
then etext = errortext(rc)
else etext = ""
"DISPLAY PANEL(YERRORP)"
)attr
)Body expand(}})
%Command ===>_zcmd
+
+
+ !eline
+
+ !etext
+
+ !zerrlm
+ Any descriptive text:
+
+ !ErrDesc
)init
.cursor = zcmd
)proc
)end
The information contained in this e-mail may be confidential and is intended solely for the use of the named addressee.
Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorized.
If you are not the intended recipient please notify us immediately by returning the e-mail to the originator.(A)
address ISPEXEC "CONTROL NONDISPL END" /* perhaps in batch*/
address TSO "CLEAR" /* maybe */
address ISPEXEC "CONTROL ERRORS RETURN" /* best for ISPF */
global = 'gl. sigl ' /* global vars */
call Init_Globals
call CPU_Timer 'Initialised.'
parse arg method /* Get method only */
/* Call the routine caller asked for */
select
when method = 'HELLO' do
parse arg .,arg1,arg2,etc
say 'Hello World!'
say 'Args were:' arg1 ',' arg2
exit 0
end
otherwise do
say 'Unrecognised method:' method
exit 8
end
end
exit 0
My header comment is handled by an ISPF edit macro.
My Init_globals is generally:
/* --------------------------------------------------------------- */
/** Initialise all global vars with nulls, defaults, etc */
Init_Globals: procedure expose (global)
/* Clear the globals */
gl. = '' /* globals */
/* Save the execName for diagnostics */
parse source . . gl.#execName .
return
My syntax recovery is usually tailored to the environment: This routine
should go near the front of the exec
/* --------------------------------------------------------------- */
/** We have a syntax error. Issue red messages and exit cleanish */
Exit_Syntax:
/* Identify where we went wrong */
failRc = RC
failLine = SIGL
failText = ERRORTEXT(failRc)
failSource = SOURCELINE(failLine)
parse source . callType execName .
say RIGHT(failLine,6) '+++' failSource
say 'Error' failRc 'running' execName,
', line 'failLine': 'failText
exit '8' failText '('execName'/'failLine')'
---------------------------------------------
My edit macro header is:
address ISREDIT
/* Get the parms, if macParms are blank, get them from ISPF var */
"MACRO NOPROCESS (macParms)"
if macParms = '' then
address ISPEXEC "VGET (MACPARMS) SHARED"
signal on syntax name Syntax_Error
"(CSRrow,CSRcol) = CURSOR"
> -----Original Message-----
> From: Brozewicz Robert F [mailto:brozew...@MELLON.COM]
> Sent: 05 May 2004 21:40
> To: TSO-...@VM.MARIST.EDU
> Subject: rexx header.....
>
>
> folks,
>
> i know this has been done before and was hoping someone is
> will to share their code.
> im looking for a standard header file that will be the start
> to all my new rexx code.
>
> what im looking for is a header that has the basic syntax to
> catch syntax error, not ready conditions and on other thing
> that will return the line e of code that is having issues.
>
> can anyone help me? please.
>
>
>
> Bob Brozewicz
> Data Transmission Monitoring Unit
> Mellon Financial
> 412 236-3971
> brozew...@mellon.net
>
> The information contained in this e-mail may be confidential
> and is intended solely for the use of the named addressee.
> Access, copying or re-use of the e-mail or any information
> contained therein by any other person is not authorized.
> If you are not the intended recipient please notify us
> immediately by returning the e-mail to the originator.(A)
>
>
> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions,
> send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX
>
> ______________________________________________________________
> __________
> This email has been scanned for all known viruses by the
> MessageLabs Email Security Service and the Macro 4 plc
> internal virus protection system.
> ______________________________________________________________
> __________