MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SAS Error from Batch REXX - 'Unrecognized SAS option name'

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Wed Aug 08, 2018 2:10 pm    Post subject: SAS Error from Batch REXX - 'Unrecognized SAS option name' Reply with quote

In the below code, I cam executing SAS program through REXX.

When I execute it through the JCL, I get the expected messages from REXX in SYSTSPRT, both before and after executing SAS.

But from SAS I am getting 'Unrecognized SAS option name' errors in SASCLOG. SASLOG and SASLIST are empty.

I get expected result when I execute it in foreground (TSO EX 'U1234.DB.REXX(CALLSAS)').

U1234.DB.REXX(CALLSAS):
Code:

/* REXX */
Say "Digging into SAS"                   
"SAS INPUT('''U1234.DB.SAS(HELLOSAS)''')"
Say "I am back in REXX"   


U1234.DB.SAS(HELLOSAS):
Code:

data _null_;       
  put "Hello Sas";
run;


JCL:
Code:

//REXX     EXEC PGM=IKJEFT01,DYNAMNBR=99
//SYSTSIN   DD *                         
%CALLSAS                                               
//SYSTSPRT  DD SYSOUT=*                         
//SASCLOG   DD SYSOUT=*                         


SYSTSPRT:
Code:

READY             
%CALLSAS         
Digging into SAS 
I am back in REXX
READY             
END               


SASCLOG:
Code:

ERROR: Unrecognized SAS option name .                                   
ERROR: Unrecognized SAS option name .                                   
ERROR: Unrecognized SAS option name INPUT('''U1234.DB.SAS(HELLOSAS)''').
ERROR: Unrecognized SAS option name SAS.                                 
ERROR: Unrecognized SAS option name ..                                   
ERROR: Unrecognized SAS option name .                                   
ERROR: (SASXKRIN): KERNEL RESOURCE INITIALIZATION FAILED.               
ERROR: Unable to initialize the SAS kernel.                             

_________________
Regards,
Diba
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed Aug 08, 2018 5:02 pm    Post subject: Reply with quote

Dibakar,

Looks like the SAS environment is NOT setup as you are invoking it from TSO

Does this work?
Code:

// EXEC SAS,OPTIONS='SYSIN=SASIN'
//SASIN   DD *,DLM='$$'
DATA _NULL_ ;
    PUT "Hello Sas"; 
RUN ;
$$


If you are executing SAS from TSO then you need to either have "SAS InPUT" or have

Code:
Address SAS '++SASLOG'

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Thu Aug 09, 2018 12:39 pm    Post subject: Reply with quote

Kolusu,

SAS is working, but not the way I want. My requirement is to execute SAS program through a REXX code in JCL.

Our shop mainly deals with batch REXX so we are investigating if we start developing SAS then what restriction it will put on us in integrating it with REXX.

I got RC 1 from following Rexx code. So I understand that SAS interface to REXX is not set up.
Code:
Address mvs "subcom sas"


Following works -

    JCL: // EXEC SAS,OPTIONS='SYSIN=SASIN'

    ISPF: tso SAS INPUT('''U1234.DB.SAS(HELLOSAS)''')

    REXX: Address TSO "SAS INPUT('''U1234.DB.SAS(HELLOSAS)''')"


These don't work -
    JCL/IKJEFT01: %CALLSAS

    JCL/IKJEFT01: ISPSTART CMD(%CALLSAS)

    Rexx: Address SAS

_________________
Regards,
Diba
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Aug 09, 2018 12:49 pm    Post subject: Reply with quote

Dibakar,

You need to set up the REXX environment using SAS system options REXXMAC and REXXLOC which controls the REXX interface. The default is REXXLOC=SASREXX

So try this

Code:

//         EXEC SAS
//SASREXX  DD  DISP=SHR,DSN=U1234.DB.SAS
//SYSIN    DD  *
options rexxmac;
hellosas;
/*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Thu Aug 09, 2018 6:35 pm    Post subject: Reply with quote

Kolusu,

I was going to try this next but this is other way round, executing REXX from SAS. I am trying SAS from REXX.
_________________
Regards,
Diba
Back to top
View user's profile Send private message Send e-mail
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Thu Aug 09, 2018 7:19 pm    Post subject: Reply with quote

I finally did a little cheating by having first SAS call REXX and then REXX call SAS.

Here is the solution.

JCL:
Code:

//SAS      EXEC SAS                     
//SYSIN    DD *                         
  OPTIONS REXXMAC;                       
  CALLSAS;                               
//SASREXX  DD DISP=SHR,DSN=U1234.DB.REXX
//SASLOG   DD SYSOUT=*                   
//SYSTSPRT DD SYSOUT=*                 


U1234.DB.REXX(CALLSAS):
Code:

  Say "Entering SAS from REXX"               
                                             
  If (Address() = 'SAS') Then                 
    "%include '''U1234.DB.SAS(HELLOSAS)''';" 
  Else                                       
    "SAS INPUT('''U1234.DB.SAS(HELLOSAS)''')"
                                             
  Say "Returned to REXX from SAS"             


U1234.DB.SAS(HELLOSAS):
Code:

data _null_;         
                     
  put "Hello Sas";   
;                   
run;

_________________
Regards,
Diba
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group