Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
How to Modify the SAS return code(SYSRC) in the SAS Code?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Other Mainframe Topics
Author Message
harikiran.mc

New User


Joined: 18 Jan 2007
Posts: 11
Location: CHENNAI

PostPosted: Fri May 30, 2008 11:24 am    Post subject: How to Modify the SAS return code(SYSRC) in the SAS Code?
Reply with quote

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
View user's profile Send private message
References
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 652

PostPosted: Fri May 30, 2008 11:37 am    Post subject:
Reply with quote

Hi,
I usually use this to return my own RC


Code:
 ABORT 99 ;


Gerry
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 652

PostPosted: Fri May 30, 2008 11:45 am    Post subject:
Reply with quote

Hi,
you can use
Code:
ABORT  ABEND


if you want the job to abend


Gerry
Back to top
View user's profile Send private message
abhishekmdwivedi

Active User


Joined: 22 Aug 2006
Posts: 89
Location: india

PostPosted: Fri May 30, 2008 12:32 pm    Post subject: Reply to: How to Modify the SAS return code(SYSRC) in the SA
Reply with quote

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
View user's profile Send private message
harikiran.mc

New User


Joined: 18 Jan 2007
Posts: 11
Location: CHENNAI

PostPosted: Fri May 30, 2008 2:42 pm    Post subject:
Reply with quote

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
View user's profile Send private message
abhishekmdwivedi

Active User


Joined: 22 Aug 2006
Posts: 89
Location: india

PostPosted: Fri May 30, 2008 2:48 pm    Post subject: Reply to: How to Modify the SAS return code(SYSRC) in the SA
Reply with quote

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
View user's profile Send private message
harikiran.mc

New User


Joined: 18 Jan 2007
Posts: 11
Location: CHENNAI

PostPosted: Fri May 30, 2008 2:53 pm    Post subject:
Reply with quote

Sounds Good!! Thanks a Lot !!
Back to top
View user's profile Send private message
harikiran.mc

New User


Joined: 18 Jan 2007
Posts: 11
Location: CHENNAI

PostPosted: Fri May 30, 2008 2:59 pm    Post subject:
Reply with quote

[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
View user's profile Send private message
abhishekmdwivedi

Active User


Joined: 22 Aug 2006
Posts: 89
Location: india

PostPosted: Fri May 30, 2008 3:15 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Alan Voss

New User


Joined: 29 Nov 2006
Posts: 35
Location: Jacksonville, FL

PostPosted: Wed Jun 04, 2008 10:27 pm    Post subject:
Reply with quote

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
View user's profile Send private message
harikiran.mc

New User


Joined: 18 Jan 2007
Posts: 11
Location: CHENNAI

PostPosted: Thu Jun 05, 2008 11:01 am    Post subject: Reply to: How to Modify the SAS return code(SYSRC) in the SA
Reply with quote

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
View user's profile Send private message
harikiran.mc

New User


Joined: 18 Jan 2007
Posts: 11
Location: CHENNAI

PostPosted: Thu Jun 05, 2008 11:03 am    Post subject: Reply to: How to Modify the SAS return code(SYSRC) in the SA
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 3060
Location: italy

PostPosted: Thu Jun 05, 2008 11:06 am    Post subject: Reply to: How to Modify the SAS return code(SYSRC) in the SA
Reply with quote

did anybody care to test before posting icon_rolleyes.gif
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 652

PostPosted: Thu Jun 05, 2008 11:40 am    Post subject:
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 3507
Location: Brussels once more ...

PostPosted: Thu Jun 05, 2008 11:46 am    Post subject:
Reply with quote

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 icon_biggrin.gif
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Other Mainframe Topics All times are GMT + 6 HoursGoto page 1, 2  Next
Page 1 of 2