BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mikegia5
Obsidian | Level 7

Is there a way to call a SAS program "under the covers" from an ISPF/REXX application?  I know there is an interactive SAS, but I don't want my users to necessarily know they are using SAS.  I just want them to enter some parameters on an ISPF screen and then get the results.  Today the ISPF application builds SAS JCL and then puts them into an ISPF Edit session for them to review the jobcard and then submit.  I would like to give them a "Foreground/Background" option so they can choose.  I would write the results to a dataset and then put them into a browse session showing them the results. 

 

The 2nd part of the problem is that the ISPF application allows user to choose to see the report in one of several ODS formats (CSV/EXCEL/PDF/HTML) so it would be really nice if I could open a window with the spreadsheet, but today I send that over an email and I can continue to do that.

1 ACCEPTED SOLUTION

Accepted Solutions
mikegia5
Obsidian | Level 7

Here's what I was finally able to make work.   It worked well and faster than I thought.

My next step will be to enable the SAS code to issue ISPF commands and build an ISPF table to display the results.  Currently the output is sent to SYSOUT and/or sent via email, so the ISPF output option will be another option.

 

ADDRESS TSO "ALTLIB ACT APPL(EXEC)  DA(SAS.SASRX.LIB)"

call sasrx "-input 'my.sas.source(fritz)' log(2) print(2)"
ADDRESS TSO "ALTLIB DEACTIVATE APPL(EXEC)" 

RETURN                                

View solution in original post

7 REPLIES 7
jimbarbour
Meteorite | Level 14

Sounds very sophisticated.  👍

 

You should be able to build JCL that can be submitted to the internal reader without human review.  The JCL would run the SAS program(s) and send out an email with the output as an attachment.  I would think that would be workable.

 

Jim

 

 

 

mikegia5
Obsidian | Level 7

Jim,

I was looking for more of a "Foreground/Background" option.  I don't want to submit the JCL without giving someone a chance to review the jobcard options. 

I did find two methods for invoking SAS - once is via the SAS clist and another via SASRX.  And there is an input option that should allow SAS to startup and run a SAS program.  I'll continue trying to get them to work - as soon as I find a little free time!

Mike

SASKiwi
PROC Star

I'm pretty sure this should be possible. Back in the dim, distant past when I used SAS on mainframes you could invoke SAS interactively by just typing something like TSO SAS on a TSO command line to invoke a SAS interactive session. Perhaps invoking SAS via SASRX and supplying a SAS program name on the command will get you what you want.

mikegia5
Obsidian | Level 7

That's exactly what I'm working on - trying to find the right combination of options and TSO allocations to get it to work.  I'm trying both SAS and SASRX and I'm close, but, can't work on this now because of other priorities.  I'll get back to it soon and post what I found.

 

data_null__
Jade | Level 19

See the documentation for using SAS on z/OS.  You want "non interactive mode"

 

Capture.PNG

mikegia5
Obsidian | Level 7

Yes, thanks.  I have all that doc and I've been experimenting with SAS INPUT and SASRX -INPUT, allocate, etc.  It might be an installation problem as most of the times I get an error about an unbalanced comment and it hasn't even begun to execute my code.   I'll try to get back to this when I can!

mikegia5
Obsidian | Level 7

Here's what I was finally able to make work.   It worked well and faster than I thought.

My next step will be to enable the SAS code to issue ISPF commands and build an ISPF table to display the results.  Currently the output is sent to SYSOUT and/or sent via email, so the ISPF output option will be another option.

 

ADDRESS TSO "ALTLIB ACT APPL(EXEC)  DA(SAS.SASRX.LIB)"

call sasrx "-input 'my.sas.source(fritz)' log(2) print(2)"
ADDRESS TSO "ALTLIB DEACTIVATE APPL(EXEC)" 

RETURN                                

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1472 views
  • 6 likes
  • 4 in conversation