[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: #return-status variable
- Subject: Re: #return-status variable
- From: "Bencke, Gina" <GBencke@KICHLER.COM>
- Date: Thu, 18 Nov 1999 12:45:28 -0500
Jason,
The way #return-status works is that SQR always returns a success value
(even when the SQR ends in an execution error, including SQL errors)
UNLESS the programmer sets #return-status to something else.
A standard that I have set for many of my customers is to set
#return-status to an unsuccessful value as one of the first commands
that will actually execute. Then set it to an successful value as one
of the last commands to execute. Then if the SQR fails due to an
execution error, the unsuccessful value will be returned to the
operating system.
!----------------------------------------------------------------------
Begin-Report
!----------------------------------------------------------------------
! If the report errors out due to an execution error, you want to
! send a failure code to the operating system.
move {BAD-OS-Status} to #Return-Status
do Init-Report
do Process-Main
do Reset ! RESET.SQC
! Program was successful; send a success code to the operating system
! and update the Process Run Status
move {Good-OS-Status} to #Return-Status
do Stdapi-Term ! STDAPI.SQC
End-Report
I hope this helps.
Gina Bencke
Bencke Consulting Corporation
gina@bencke.com
-----Original Message-----
From: Jason Maurer [mailto:JMaurer@WIREDEMPIRE.COM]
Sent: Thursday, November 18, 1999 12:14 PM
To: Multiple recipients of list SQR-USERS
Subject: #return-status variable
Does anyone know where I can get a listing of the possible values of
#return-status? I am using it in an error-notification batch file and I
would like to customize the error message to go with the #return-status
value. I know I can set the value in my .sqr program, but I am sure
that there will be times when the program will error and I won't have
the chance to set the value.
Thanks!!