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
PROC Star

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
Opal | Level 21

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

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

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