View previous topic :: View next topic |
Author |
Message |
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Wed Aug 08, 2018 2:10 pm Post subject: SAS Error from Batch REXX - 'Unrecognized SAS option name' |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Wed Aug 08, 2018 5:02 pm Post subject: |
|
|
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 |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Thu Aug 09, 2018 12:39 pm Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu Aug 09, 2018 12:49 pm Post subject: |
|
|
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 |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Thu Aug 09, 2018 6:35 pm Post subject: |
|
|
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 |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Thu Aug 09, 2018 7:19 pm Post subject: |
|
|
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 |
|
|
|
|