Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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 -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
harikiran.mc

New User


Joined: 18 Jan 2007
Posts: 17
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

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

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: 1703
Location: Australia

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

New User


Joined: 22 Aug 2006
Posts: 95
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: 17
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

New User


Joined: 22 Aug 2006
Posts: 95
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: 17
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: 17
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

New User


Joined: 22 Aug 2006
Posts: 95
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: 32
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: 17
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: 17
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: 10202
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: 1703
Location: Australia

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: 8593
Location: Back in jolly old England

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
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

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

Hi Gerry,
I did not mean to put You in the same waste basket icon_biggrin.gif
it' s a pity that good answers get lost in the general noise
and too many people reply just to ... participate
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

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

Hi Expat,
I did say rarely icon_lol.gif


Gerry
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

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

/nastyness on

sometimes I provide the proper code, with slightly misleading comments
99% of the times nobody cares
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 05, 2008 1:02 pm    Post subject:
Reply with quote

I once recall giving an explanation and sample of the code to work from to get the solution, only to have the OP in question post back saying that it didn't work because my code had the incorrect field positions in it icon_rolleyes.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Jun 06, 2008 11:36 am    Post subject: Spooky
Reply with quote

icon_eek.gif Spooky eh ??? After my very last post on this topic .................

http://www.ibmmainframes.com/viewtopic.php?t=31280

Now let's see, what do I fancy in the 2:00 at Newmarket next week icon_biggrin.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts DFHWS2LS return value divated CICS 4 Mon Nov 07, 2016 5:44 pm
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us