|
|
| Author |
Message |
harikiran.mc
New User
Joined: 18 Jan 2007 Posts: 11 Location: CHENNAI
|
|
|
|
Generally SAS program in the JCL gives a Return code at the end of the step. Inside the Step I think we can Modify the Return code.
I want to modify the Return code Value in the SAS, like forcing the abend while Testing.
Ex:- Move '8' to %SYSRC.
If anyone knows this please give me some syntax. |
|
| Back to top |
|
 |
References
|
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 691
|
|
|
|
Hi,
I usually use this to return my own RC
Gerry |
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 691
|
|
|
|
Hi,
you can use
if you want the job to abend
Gerry |
|
| Back to top |
|
 |
abhishekmdwivedi
Active User
Joined: 22 Aug 2006 Posts: 91 Location: india
|
|
|
|
hi,
You may use
| Code: |
DATA _NULL_;
ABORT ABEND;
|
to abend your application OR
you may use
| Code: |
DATA _NULL_;
ABORT 16;
|
or
| Code: |
DATA _NULL_;
RC=16;
RETURN;
|
to return specific code to JCL, which can be used in the steps below the EXEC SAS. |
|
| Back to top |
|
 |
harikiran.mc
New User
Joined: 18 Jan 2007 Posts: 11 Location: CHENNAI
|
|
|
|
Hi Friends!! Thanks a lot for your replies!!!
Hi Abhishek!!
Can we send any message when we use the below syntax:
DATA _NULL_;
ABORT ABEND;
[/img] |
|
| Back to top |
|
 |
abhishekmdwivedi
Active User
Joined: 22 Aug 2006 Posts: 91 Location: india
|
|
|
|
Well ABORT ABEND is an inbulit SAS function. It just abends the job abnormally.
For SAS System message :
You may use SYSMSG function. |
|
| Back to top |
|
 |
harikiran.mc
New User
Joined: 18 Jan 2007 Posts: 11 Location: CHENNAI
|
|
|
|
| Sounds Good!! Thanks a Lot !! |
|
| Back to top |
|
 |
harikiran.mc
New User
Joined: 18 Jan 2007 Posts: 11 Location: CHENNAI
|
|
|
|
[quote]Hi !! If we Code the below statements, will it abend at that step and return to the JCL and proceeds next step ?
OR
Will it store 16 as return code and perform the next steps in SAS and @ End of SAS code program will terminate??
| Code: |
DATA _NULL_;
RC=16;
RETURN;
[/quote] |
|
|
| Back to top |
|
 |
abhishekmdwivedi
Active User
Joined: 22 Aug 2006 Posts: 91 Location: india
|
|
|
|
1) No it will not abend at that step it is used to make steps followed after the EXEC SAS to flush with COND=ONLY within JCL.
2) To abend in SAS code you have to use ABORT ABEND only at an DATA STEP and SAS will terminate immediatly with errored steps (including steps followed by the step having ABORT ABEND). |
|
| Back to top |
|
 |
Alan Voss
New User
Joined: 29 Nov 2006 Posts: 35 Location: Jacksonville, FL
|
|
|
|
| abhishekmdwivedi wrote: |
| 1) No it will not abend at that step it is used to make steps followed after the EXEC SAS to flush with COND=ONLY within JCL. |
The above statement is not true. SAS will continue running and RC from SAS will still be 0.
You must use the ABORT statement to end SAS with a user provided return code. |
|
| Back to top |
|
 |
harikiran.mc
New User
Joined: 18 Jan 2007 Posts: 11 Location: CHENNAI
|
|
|
|
Can i use the following code:??
| Code: |
DATA _NULL_;
RC=16;
RETURN;
/* THE ABOVE STEPS WILL MAKES RC TO HOLD THE RETURN CODE AS 16 /*
ABORT ABEND;
/* THIS ABORT STEP WILL ABEND AT THIS STEP AND RETURN TO JCL. SO RC OF THIS SAS STEP WILL BE 16/*
/* PLEASE CORRECT ME IF I'M WORNG/* |
|
|
| Back to top |
|
 |
harikiran.mc
New User
Joined: 18 Jan 2007 Posts: 11 Location: CHENNAI
|
|
|
|
OR JUST CAN I USE:???
[/code]
DATA _NULL_;
ABORT 16;
/* WILL THE ABOVE LINES OF CODE TERMINATE ABNORMLY AND STORES THE SAS STEP RC AS 16??/* |
|
| Back to top |
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 3277 Location: italy
|
|
|
|
did anybody care to test before posting  |
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 691
|
|
|
|
Hi Enrico,
I can assure you I have tested what I stated, rarely I don't test the code that I provide.
Gerry |
|
| Back to top |
|
 |
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 3725 Location: Brussels once more ...
|
|
|
|
| gcicchet wrote: |
Hi Enrico,
I can assure you I have tested what I stated, rarely I don't test the code that I provide.
Gerry |
Surely you must be tempted at some stage to supply untested code, just to see what happens  |
|
| Back to top |
|
 |
|
|