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 

SASCP in Rexx

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
linhofbiker
Beginner


Joined: 12 Aug 2005
Posts: 30
Topics: 10

PostPosted: Thu Jan 14, 2010 9:02 am    Post subject: SASCP in Rexx Reply with quote

about 25 years ago I invoked SASCP in a Clist. I can't find this now and want to do it in Rexx. I have some datasets that can't be execio'd and wish to use SAS as a utility file reader. I have asked SAS about this, but have not received a promised response yet. Is anyone doing this?
Back to top
View user's profile Send private message Send e-mail
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Fri Jan 15, 2010 6:28 am    Post subject: Reply with quote

I have invoked REXX from SAS programs, only in batch, by running IKJEFT01 with all of the ISPF and SAS libraries allocated. I can't see any reason with the same setup that you cannot invoke SAS from your REXX code.

I know the feeling of having done something a long while ago, knowing that it can be done, but trying to remember how.

Mmmmmmmmm, maybe something to play with in a dull moment Shocked if one ever arrives.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Fri Jan 15, 2010 7:05 am    Post subject: Reply with quote

Just had a very quick play, and I can execute some REXX, then switch to SAS, and then continue with REXX again processing the data obtained from the SAS part.

Allbeit in batch, but it can be done.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
linhofbiker
Beginner


Joined: 12 Aug 2005
Posts: 30
Topics: 10

PostPosted: Wed Feb 03, 2010 11:27 am    Post subject: Reply with quote

An update. I got this code from SAS but it is not working in my environment - I get a user abend 831 ??
Code:

 000001 /* REXX */                                                             
 000002 ADDRESS TSO                                                             
 000003 count=1                                                                 
 000004 say 'count before accessing SAS is ==> 'count                           
 000005 "ALLOC FILE(SYSIN) DA('ad6w.ENDEVOR.JCL(REXXIN)') SHR REU"             
 000006 "ALLOC FILE(CONFIG) DA('SYS2.SAS802.TS2M0.CNTL(BATCH)') shr reu"       
 000007 "ALLOC FILE(WORK) SP(10,50) DSORG(PS) RECFM(F S) REU UNIT(SYSDA)       
 000008 UCOUNT(1) BLKSIZE(6144) ROUND"                                         
 000009 "ALLOC FILE(SASMSG) DA('SYS2.SAS802.TS2M0.SASMSG') shr reu"             
 000010 "ALLOC FILE(SASLIST) DA(*) REU"                                         
 000011 "ALLOC FILE(SASPARM) CYL SP(1) UNIT(SYSDA) REU"                         
 000012 "ALLOC FILE(SASAUTOS) DA('SYS2.SAS802.TS2M0.AUTOLIB') shr reu"         
 000013 "ALLOC FILE(SASHELP) DA('SYS2.SAS802.TS2M0.SASHELP') shr reu"           
 000014 /*                                                                     
 000015 ----------- this is for SAS 9.2 (BCBSFL is on SAS 8.2 as at 01/29/10   
 000016 "ALLOC FILE(TKMVSENV) DA('"USERID".TKMVSENV(TKMVSENV)' ) SHR REU"       
 000017 ----------- this is for SAS 9.2 (BCBSFL is on SAS 8.2 as at 01/29/10   
 000018 */                                                                     
 000019 "ALLOC DD(SASLOG) NEW SPACE(1) CYL DSORG(PS) LRECL(133) RECFM(V B)"     
 000020 /*"SASCP T('SYS2.MXG.PROD.MXG.FORMATS'), says it is not a PDS */       
 000021 /*"SASCP T('ad6w.sas.library'), I dont have one of these*/             
 000022 "SASCP T('SYS2.SAS802.TS2M0.LIBRARY'),                                 
 000023        E(SASHOST) O('SASHELP=SASHELP LOG=SASLOG,                       
 000024        SYSIN=SYSIN NOSASUSER')"                                         
 000025 "FREE DD(SYSIN)"                                                       
 000026 "FREE DD(CONFIG)"                                                       
 000027 "FREE DD(WORK)"                                                         
 000028 "FREE DD(SASMSG)"                                                       
 000029 "FREE DD(SASLIST)"                                                     
 000030 "FREE DD(SASPARM)"                                                     
 000031 "FREE DD(SASAUTOS)"                                                     
 000032 "FREE DD(SASHELP)"                                                     
 000033 /*                                                                     
 000034 ----------- this is for SAS 9.2 (BCBSFL is on SAS 8.2 as at 01/29/10   
 000035 "FREE DD(TKMVSENV)"                                                     
 000036 ----------- this is for SAS 9.2 (BCBSFL is on SAS 8.2 as at 01/29/10   
 000037 */                                                                     
 000038 "FREE DD(SASLOG)"                                                       
 000039 say 'count after accessng SAS is => ' count                             
 000040 exit                                                                   
 000041                                                                         
 000042 /*                                                                     
 000043 Where SYSIN points to ad6w.endevor.jcl(rexxin)                         
 000044 options rexxmac;                                                       
 000045 data test;                                                             
 000046   origcount=getexec('COUNT');                                           
 000047   put 'this is the original count from REXX exec => ' origcount;       
 000048   * add 3 to this count and return it to REXX exec;                     
 000049   finalcount=sum(origcount,3);                                         
 000050   put ' this is the finaal count => ' finalcount;                       
 000051   put ' check it via REXX ';                                           
 000052   call putexec('COUNT',finalcount);                                     
 000053 run;                                                                   
 000054                                                                         
 000055 after using our files:                                                 
 000056                                                                         
 000057 count before accessing SAS is ==> 1                                     
 000058 SASHOST ENDED DUE TO ERROR+                                             
 000059 USER ABEND CODE 831                                                     
 000060  FILE SASMSG NOT FREED, DATA SET IS OPEN                               
 000061 count after accessng SAS is =>  1                                       
 000062 ***                                                                     
 000063                                                                         
 000064 */                                                                     
 ****** **************************** Bottom of Data ****************************
Back to top
View user's profile Send private message Send e-mail
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed Feb 03, 2010 2:49 pm    Post subject: Reply with quote

What does the SAS manual say about a user 831?

Line 7 should end with a comma as line 8 appears to be a continuation.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
linhofbiker
Beginner


Joined: 12 Aug 2005
Posts: 30
Topics: 10

PostPosted: Fri Feb 05, 2010 1:32 pm    Post subject: Reply with quote

I added the missing comma and got this:
Code:

 count before accessing SAS is ==> 1                                           
 SASHOST ENDED DUE TO ERROR+                                                   
 USER ABEND CODE 831                                                           
     24 *-* "SASCP T('SYS2.SAS802.TS2M0.LIBRARY'),       E(SASHOST) O('SASHELP=S
 ASHELP LOG=SASLOG,       SYSIN=SYSIN NOSASUSER')"                             
        +++ RC(-7897088) +++                                                   
  FILE SASMSG NOT FREED, DATA SET IS OPEN                                       
 count after accessng SAS is =>  1                                             
 ***
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Feb 05, 2010 2:06 pm    Post subject: Reply with quote

linhofbiker,

Did you try the examples listed here?

http://support.sas.com/documentation/cdl/en/hosto390/61886/HTML/default/mvs-ifaces-rexx.htm

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
linhofbiker
Beginner


Joined: 12 Aug 2005
Posts: 30
Topics: 10

PostPosted: Fri Feb 05, 2010 3:50 pm    Post subject: Reply with quote

No - this is not what I want to do (I don't want to access rexx from SAS). I want to access SAS from rexx - the SAS code I am executing is just SAS code without any calls to rexx. I just want the output of the SAS program to be a dataset that I can then read in rexx using EXECIO.
Back to top
View user's profile Send private message Send e-mail
linhofbiker
Beginner


Joined: 12 Aug 2005
Posts: 30
Topics: 10

PostPosted: Thu Feb 11, 2010 2:01 pm    Post subject: Reply with quote

This is what i sent SAS:

Cisco - this is what I get after doing what you suggested:
Code:

 000001 /* REXX in SYS2.ISPF.PROD.ISRCLIB(NDVSASRX)                             
 000002    NDVSASRX calls SAS for data etc...                                   
 000003 */                                                                     
 000004 ADDRESS TSO                                                             
 000005 count=1                                                                 
 000006 say 'count before accessing SAS is ==> 'count                           
 000007 "ALLOC FILE(SYSIN) DA('ad6w.ENDEVOR.JCL(REXXIN)') SHR REU"             
 000008 "ALLOC FILE(CONFIG) DA('SYS2.SAS802.TS2M0.CNTL(BATCH)') shr reu"       
 000009 "ALLOC FILE(WORK) SP(10,50) DSORG(PS) RECFM(F S) REU UNIT(SYSDA),       
 000010  UCOUNT(1) BLKSIZE(6144) ROUND"                                         
 000011 "ALLOC FILE(SASMSG) DA('SYS2.SAS802.TS2M0.SASMSG') shr reu"             
 000012 "ALLOC FILE(SASLIST) DA(*) REU"                                         
 000013 "ALLOC FILE(SASPARM) CYL SP(1) UNIT(SYSDA) REU"                         
 000014 "ALLOC FILE(SASAUTOS) DA('SYS2.SAS802.TS2M0.AUTOLIB') shr reu"         
 000015 "ALLOC FILE(SASHELP) DA('SYS2.SAS802.TS2M0.SASHELP') shr reu"           
 000016 /*                                                                     
 000017 ----------- this is for SAS 9.2 (BCBSFL is on SAS 8.2 as at 01/29/10   
 000018 "ALLOC FILE(TKMVSENV) DA('"USERID".TKMVSENV(TKMVSENV)' ) SHR REU"       
 000019 ----------- this is for SAS 9.2 (BCBSFL is on SAS 8.2 as at 01/29/10   
 000020 */                                                                     
 000021 "ALLOC DD(SASLOG) NEW SPACE(1) CYL DSORG(PS) LRECL(133) RECFM(V B)"     
 000022 "ALLOC DD(JFCLOG) DA('AD6W.SAS.JFCLOG') OLD"                           
 000023 /*                                                                     
 000024 "SASCP T('SYS2.MXG.PROD.MXG.FORMATS'), says it is not a PDS             
 000025 "SASCP T('ad6w.sas.library'), I dont have one of these                 
 000026 "SASCP T('SYS2.SAS802.TS2M0.LIBRARY'),                                 
 000027        E(SASHOST) O('SASHELP=SASHELP LOG=SASLOG,                       
 000028        SYSIN=SYSIN NOSASUSER')"                                         
 000029 */                                                                     
 000030 "SASCP T('SYS2.SAS802.TS2M0.LIBRARY'),                                 
 000031        E(SASHOST) O('SASHELP=SASHELP ALTLOG=JFCLOG,                     
 000032        SYSIN=SYSIN NOSASUSER VERBOSE NOSTAE')"                         
 000033 "FREE DD(SYSIN)"                                                       
 000034 "FREE DD(CONFIG)"                                                       
 000035 "FREE DD(WORK)"                                                         
 000036 "FREE DD(SASMSG)"                                                       
 000037 "FREE DD(SASLIST)"                                                     
 000038 "FREE DD(SASPARM)"                                                     
 000039 "FREE DD(SASAUTOS)"                                                     
 000040 "FREE DD(SASHELP)"                                                     
 000041 /*                                                                     
 000042 ----------- this is for SAS 9.2 (BCBSFL is on SAS 8.2 as at 01/29/10   
 000043 "FREE DD(TKMVSENV)"                                                     
 000044 ----------- this is for SAS 9.2 (BCBSFL is on SAS 8.2 as at 01/29/10   
 000045 */                                                                     
 000046 "FREE DD(SASLOG)"                                                       
 000047 say 'count after accessng SAS is => ' count                             
 000048 exit                                                                   
 000049                                                                         


count before accessing SAS is ==> 1
Code:

 --------------------------------------                                         
 OPTIONS SPECIFIED ON THE COMMAND LINE:                                         
 --------------------------------------                                         
 VERBOSE                                                                       
 -----------------------------------------                                     
 OPTIONS SET INTERNALLY AT INITIALIZATION:                                     
 -----------------------------------------                                     
 AUTOEXEC=''                                                                   
 MAPS=''                                                                       
 CTRANSLOC=''                                                                   
 SYSPREF=AD6W                                                                   
 BUFNO=3 PARMCARDS=SASPARM MSYMTABMAX=1048576 MVARSIZE=8192 CARDIMAGE UBUFNO=3 H
ELPLOC=HELPDOC UNIVERSALPRINT                                                   
 NOEXPLORER NODMSEXP DMS TERMINAL CONSOLELOG=SASCLOG SORTSHRB                   
 NOSYNCHIO                                                                     
 -----------------------------------------------                               
 OPTIONS SPECIFIED IN THE DEFAULT OPTIONS TABLE:                               
 -----------------------------------------------                               
 NOWORKTERM                                                                     
 OPLIST                                                                         
 SORTPGM=BEST                                                                   
 SORTWKNO=3                                                                     
 ***                                                                           
 WORK=WORK                                                                     
 -------------------------------------                                         
 OPTIONS SPECIFIED IN THE CONFIG FILE:                                         
 -------------------------------------                                         
   SYSIN=SYSIN                                                                 
   LOG=SASLOG                                                                   
   CTRANSLOC='SYS2.SAS802.TS2M0.SASC.TRANSLIB'                                 
   NEWS='SYS2.SAS802.TS2M0.NEWS(NEWS)'                                         
   SORTDEV=SYSDA                                                               
   BUFNO=3                                                                     
   YEARCUTOFF=1920                                                             
   MSGLEVEL=N                                                                   
   BLKSIZE(3380)=6144                                                           
   BLKSIZE(3390)=6144                                                           
   FILEBLKSIZE(3380)=23476                                                     
   FILEBLKSIZE(3390)=27998                                                     
   MEMLEAVE=512K                                                               
   NOS99NOMIG                                                                   
   SORTBLKMODE                                                                 
   SORTDEVWARN                                                                 
   DLDMGACTION=REPAIR                                                           
   CBUFNO=1                                                                     
   VALIDVARNAME=V7                                                             
 ***                                                                           
   ENGINE=BASE                                                                 
   SEQENGINE=TAPE                                                               
 --------------------------------------                                         
 OPTIONS SPECIFIED ON THE COMMAND LINE:                                         
 --------------------------------------                                         
 SASHELP=SASHELP ALTLOG=JFCLOG,       SYSIN=SYSIN NOSASUSER VERBOSE NOSTAE     
 -----------------------------------------                                     
 OPTIONS SET INTERNALLY AT INITIALIZATION:                                     
 -----------------------------------------                                     
 MEMSIZE=143106048                                                             

*****************************************                           
Then it cancels my TSO session!!!!!!!!!!@ 
*****************************************   

The log is empty:
Code:

DSLIST - Data Sets Matching AD6W.SAS.JFCLOG           Empty data set or member
  Command ===>                                                  Scroll ===> CSR 
                                                                                 
 Command - Enter "/" to select action                  Message           Volume
 -------------------------------------------------------------------------------
 B        AD6W.SAS.JFCLOG                                                TSS007
 ***************************** End of Data Set list ****************************


Thanks,

John Cooper
Configuration Administration & Support
DC6 4 127 ext 56357 (904 905 6357)




John,

A few suggestions/comments:

* Probably you have done this already, but you have invoked the SAS 8.2 CLIST (vs REXX exec) with the *same* userid that you are using without any problem, correct?
* Please change the option LOG=SASLOG to ALTLOG=XYZ, where "XYZ" is a DDname pointing to a permanent data set allocation.
* When invoking SAS in your REXX exec, I see you pass the SASHELP, LOG, SYSIN, NOSASUSER SAS system options. Please add the following 2 SAS options:

VERBOSE NOSTAE

*Once you invoke the REXX exec, please provide us with the output as well as the contents of the SAS Log, and verify if the SAS 8.2 clist works.

Thanks,

Cisco Ojeda
SAS Technical Support

Cisco,

"and verify if the SAS 8.2 clist works. " YES IT DOES! See below



Log
Code:
                                                         
  Command ===>                                                                 
  NOTE: At top.                                                                 
  NOTE: Copyright (c) 1999-2001 by SAS Institute Inc., Cary, NC, USA.           
  NOTE: SAS (r) Proprietary Software Release 8.2 (TS2M0)                       
        Licensed to BLUE CROSS BLUE SHIELD OF FLORIDA, Site 0003030001.         
  NOTE: This session is executing on the z/OS   V01R10M00 platform.             
                                                                               
  NOTE: Running on IBM Model 2097 Serial Number 04A002,                         
                   IBM Model 2097 Serial Number 04A002,                         
                   IBM Model 2097 Serial Number 04A002,                         
                   IBM Model 2097 Serial Number 04A002,                         
                   IBM Model 2097 Serial Number 04A002,                         
                                                                               
 Program Editor                                                                 
  Command ===>                                                                 
                                                                               
  00001 proc options;                                                           
  00002                                                                         
  00003                                                                         
  00004                                                                         
  00005                                                                         
  00006                                                                         
                                 


Thanks,

John Cooper
Configuration Administration & Support
DC6 4 127 ext 56357 (904 905 6357)
Back to top
View user's profile Send private message Send e-mail
linhofbiker
Beginner


Joined: 12 Aug 2005
Posts: 30
Topics: 10

PostPosted: Fri Mar 26, 2010 2:08 pm    Post subject: Reply with quote

I removed the NOSASUSER option and it now works. Thanks Cisco.
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 -> TSO and ISPF 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