ISPF - sasCommunity Software As An... · continue) a POF edit session, browse a dataset, invoke...

10
SAS/DMI SOFTWARE AS AN INTERFACE TO THE SAS SYSTEM Robin Killingbeck - Legent Introduction Many managers and other, perhaps, non-technical analysts who are not familiar with the SAS system may need access to various SAS system based facilities. This paper provides an example of using SAS/DMI software in an IBM MVS environment to present a more familiar interface under TSO and ISPF to use the power and flexibility of SAS/GRAPH. The techniques may be used by an application developer as a front end to other SAS system based products, such as SAS/AF, etc., but still retaining some important elements of an environment which an unskilled SAS system user may be more at home with. SAS/DMI is a SAS Institute program product that allows the SAS Data step language to be used as an ISPF application development language. All of the facilities of the SAS system and ISPF are available to the application developer. ISPF In an IBM MVS environment (MVS/370, MVSjXA, or MVS/ESA), the standard IBM user interface is through the use of IBM I s TSO product, a time sharing facility, which gives a user access to the mainframe through a terminal. Under TSO another program product, ISPF, is usually run which allows applications to be.written to provide full screen access to such services as an editor, foreground compiiers, background submission of batch jobs as well as allowing application developers to write full screen applications for whichever services they like to provide. Along with ISPF, which provides application development services, specifically for screen panel display as well as other generalised dataset services, IBM also provides another program product, ISPF/PDF which is a prepackaged application giving menu based panel access to a full screen editor, a full screen dataset browse facility, dataset manipulation functions and foreground and background compilers. For the ISPF application developer a choice of the more traditional languages is given in which a program can invoke ISPF and/or PDF services. What SAS/DMI Software provides is the capability to allow the application to be written in the SAS system itself, allowing access not only to the ISPF services, but also to the full range of SAS services, functions, procedures and products. One of the most frequently invoked ISPF services, and arguably one of the most powerful, is the ability to "split" the ISFF screen and go and perform some other ISPF service, such as begin (or 318

Transcript of ISPF - sasCommunity Software As An... · continue) a POF edit session, browse a dataset, invoke...

Page 1: ISPF - sasCommunity Software As An... · continue) a POF edit session, browse a dataset, invoke another ISPF application, perhaps inquire on the status of a batch job or enter an

~:

SAS/DMI SOFTWARE AS AN INTERFACE TO THE SAS SYSTEM

Robin Killingbeck - Legent

Introduction

Many managers and other, perhaps, non-technical analysts who are not familiar with the SAS system may need access to various SAS system based facilities. This paper provides an example of using SAS/DMI software in an IBM MVS environment to present a more familiar interface under TSO and ISPF to use the power and flexibility of SAS/GRAPH. The techniques may be used by an application developer as a front end to other SAS system based products, such as SAS/AF, etc., but still retaining some important elements of an environment which an unskilled SAS system user may be more at home with.

SAS/DMI is a SAS Institute program product that allows the SAS Data step language to be used as an ISPF application development language. All of the facilities of the SAS system and ISPF are available to the application developer.

ISPF

In an IBM MVS environment (MVS/370, MVSjXA, or MVS/ESA), the standard IBM user interface is through the use of IBM I s TSO product, a time sharing facility, which gives a user access to the mainframe through a terminal. Under TSO another program product, ISPF, is usually run which allows applications to be.written to provide full screen access to such services as an editor, foreground compiiers, background submission of batch jobs as well as allowing application developers to write full screen applications for whichever services they like to provide.

Along with ISPF, which provides application development services, specifically for screen panel display as well as other generalised dataset services, IBM also provides another program product, ISPF/PDF which is a prepackaged application giving menu based panel access to a full screen editor, a full screen dataset browse facility, dataset manipulation functions and foreground and background compilers.

For the ISPF application developer a choice of the more traditional languages is given in which a program can invoke ISPF and/or PDF services. What SAS/DMI Software provides is the capability to allow the application to be written in the SAS system itself, allowing access not only to the ISPF services, but also to the full range of SAS services, functions, procedures and products.

One of the most frequently invoked ISPF services, and arguably one of the most powerful, is the ability to "split" the ISFF screen and go and perform some other ISPF service, such as begin (or

318

Page 2: ISPF - sasCommunity Software As An... · continue) a POF edit session, browse a dataset, invoke another ISPF application, perhaps inquire on the status of a batch job or enter an

continue) a POF edit session, browse a dataset, invoke another ISPF application, perhaps inquire on the status of a batch job or enter an electronic mail service. The possibilities are endless, many software vendors operating in the IBM marketplace write ISPF based products. What the "split" function provides is the opportunity to invoke some other service without the overhead and subsequent delay in terminating one function before invoking the next. Functions can be performed in parallel, by temporarily halting execution in one application by responding in the screen panel of the other. This allows the suspension, in other words, of one process while another takes place. In the author's experience, this is an extremely common occurrence for ISPF users and is certainly a very useful productivity tool. .

since IBM provides many facilities under ISPF and TSO to control and maintain the IBM MVS environment, ISPF is installed and in use in most of these installations (although there are competitive products .to TSO from other software vendors). Therefore it may be useful to write ISPF applications under TSO which provide a user interface which many TSO users are familiar with, that is ISPF, but in the SAS language, which the application developer may be familiar with, to access not only base SAS functions, but also such SAS products as SAS/GRAPH, SAS/FSP, SAS/AF and SAS/ETS, etc.

For the purposes of this paper, SAS/GRAPH will used as the example of a SAS product being used through the ISPF interface with SAS/OMI.

SAS/OMI

SAS/OMI allows a SAS Data step to control the flow through an ISPF application prompting the user with display panels, receiving responses and perf.orming actions dependent upon that input .. It also allows accesS to and from ISPF tables. to control panel·display and ISPF data areas arid can consequently interchange databetween.the two environments. . ISPFfunctions are. invoked using the CALL statement to perform the requested ISPF service and data sharing is accomplished by calling the VOEFINE service to allow SAS data variables to be recognised by ISPF.Although ISPF can quickly and easily be used to display panel information and to recE:;!ive, syntax check and validate input, the SASsystemcan be used and is much bet.ter at manipulating data with its own mathematical, string and statistical functions.

Although the SAS/OMI software is invoked in the data step, once the input has been decoded, the application developer can still use and invoke SAS procedures. It should be remembered though, that there is always the overhead of a,compile phase during the flow between SAS steps, so such actions such be kept to as small a minimum as possible. Also, while executing those procedures, the user will be locked out from entering into his screen. For·some SAS system procedures, the display·may be updated or refreshed by that procedure, in the case of this paper when

319

Page 3: ISPF - sasCommunity Software As An... · continue) a POF edit session, browse a dataset, invoke another ISPF application, perhaps inquire on the status of a batch job or enter an

SAS/GRAPH displays those graphs selected the screen will be under the control of the SAS product and not ISPF. Upon exiting that procedure, though, a further data step can be invoked and control returned back to the ISPF environment.

There are certain exceptions to this concerning SAS PROC steps, such as FSEDIT, FSCALC and DISPLAY which can use a SAS/DMI supplied format called $DMIw. to allow the user the ability to enter the ISPF environment from within the SAS procedure and then have the ability to split the screen and perform some other ISPF fUnction. Similarly, there is facility to do the same thing in the SAS system display manager by invoking the command DMISPLIT.

Details of all the above facilities are, obviously, documented in the SAS/DMI User's Guide.

SAS/GRAPH application

The application has been written to invoke SAS when the application is started to allow any overheads in SAS start up, such as initial program load and SAS environment establishment and the initial compile of the first SAS step to be completed and dispensed with at the first invocation to allow the main processing data step to flow with as low an overhead and fastest response time as possible.

Initially in the application, the variables used in the SAS data step need to be defined to ISPF so that it may use them too, and then to display the primary panel, allowing the user to select from a list of alternatives functions which will take him into lower level panels in a hierarchical flow.

Correct responses can be verified in the ISPF panels before processing is passed back to SAS to handle program flow between panels. This further reduces overhead and· response times, by avoiding switching between environments through the call interface, since most of the processing is trivial syntax checking.

The input, once verified, can be used by the application to drive the remaining actions in the SAS system which will invoke the requisite services to complete the transaction.

In this. example, users are presented with a panel, . as in Figure 1, allowing them to select lower level. panels depending on the graphical reports they are interested in. They can then select the group, or individual, graphs to be displayed as well as selecting and overriding certain options SAS/GRAPH uses in displaying them. A sample lower level panel is shown in Figure 2.

The lower level panels displayed are filled out from ISPF tables through the ISPF table display service where previously defined information is saved in an ISPF table and used through a skeleton to populate lines on the panel through the rows in the

320

Page 4: ISPF - sasCommunity Software As An... · continue) a POF edit session, browse a dataset, invoke another ISPF application, perhaps inquire on the status of a batch job or enter an

ta~le, each data element being displayed from the columns in the table. The use of ISPF tables allows information to be displayed much faster by IS.PF than returning to SAS and retrieving the information from a SAS file and then having to reformat it into specific variables for panel display. In this 'particular .case, the ISPF table was pre~built by SAS, so that it could be used subsequently during the panel display.

Two options were open to the author in building this table. Since the table defines the list of graphs or groups of graphs available for display, either a list of the existing graphs in the graphics catalog could be read and .the ISPF table generated, or when each particular graph is added to the graphics catalog then a corresponding entry could be added to the ISPF.table. There are di·fferent considerations in building the ISPF table in each case.

, For the first case, it is difficult to obtain, in a SAS data

step ,the list of graphs in a graphics catalog in a machine readable form. SAS/GRAPH PRoe GREPLAY can ,be used with the non full screen option, but the list is written to the SAS log file, not to a print or directed file, therefore not allowing the post processing of this list in a simple fashion. To get round this, a simple SAS program can be invoked to only perform a SAS/GRAPH PRoe GREPLAY with the SAS log directed to a dataset, so that a subsequent SAS program can read the file containing the redirected SAS log to extract the required information and build the ISPF table. Unfortunately, it requires two SAS invocations and is a rather tortuous route to take, but the only way in which to obtain the information required.

For the second case, an entry could be added to an ISPF table every time a graph is saved in a graphics catalog. It has the advantage of not having to invoke SAS twice and can be very easy to implement. Using SAS macros the same name can be used both in the SAS GOUT keyword and to add the name of the graph into the ISPF table •. Unfortunately as time progresses graphs may need to be deleted or renamed in the catalog and unless similar deletions or renames are made in the ISPF table then confusion may result as the ISPF table gets out of synchronisation with the catalog.

The approach recommended by the author then is a combination of both of the above options. When the graphics are built a %LET statement is used to assign a macro variable with the name of the graph and them resolved in.the GOUT name, and then subsequently in the data step building the ISPF table row entry . Since at some time some form of management on the graphics catalog must be done, it is suggested that at this time, a list of graphs in the catalog be produced and the ISPF tablerefreshed,perhaps regularly on a once per day basis, and that any changes to the graphics catalogs, such as renaming and deleting of members, etc., be performed just prior to the refresh. .

The ISPF table ''lill then contain accurate information on the state of the graphics catalog • Once any new grappics are built they

'321

Page 5: ISPF - sasCommunity Software As An... · continue) a POF edit session, browse a dataset, invoke another ISPF application, perhaps inquire on the status of a batch job or enter an

will be automatically added to the graphics catalog and the ISPF table updated, and consequently, recognised immediately by the application. .

Returning to the application design once more, when all graphics have been displayed, the· SAS data step can be started again and the user prompted to select further graphs.

All of the techniques explained here are taken from the examples in the SAS/OMIUser's Guide in chapter 5 where there are suggestions on creating ISPF tables from SASfiles, although in this application, the ISPF table was built initially from an os sequential file containing the SAS log. Panel flow was accomplished again with the example given in Appendix 4.

Exit from the application can be performed through the use of the ISPF "ENO" and "RETURN" functions, which can be transmitted through to the SAS system in the ISPF return code. The SAS system can then terminate with an ENOS AS statement.

Conclusion

It is possible through the use of SAS/OMI software to give users the power of SAS facilities and to allow the application developer the opportunity to use these, while still giving the end user in an MVS environment under TSO a familiar terminal environment and user interface.

SAS/OMI adds the SAS system as an application development language having all of the possible SAS products, but without totally removing the user from the ISPF terminal environment in which he may want to remain in order to access other non SAS based applications in parallel.

Facilities of both SAS and ISPF can then be intermingled to supply the application·end user with a range of facilities to meet his needs.

Legent 17. Bath Road Slough SL1 3UL united Kingdom 0753-31222

322

Page 6: ISPF - sasCommunity Software As An... · continue) a POF edit session, browse a dataset, invoke another ISPF application, perhaps inquire on the status of a batch job or enter an

---------------------- S E U G I - Graphics Display Menu OPTION ===> DATE: 89/05/09

TIME: 05:57

1 - Calendar Overview Reports

2 - Application Reports

3 - Special Reports

x - or enter END command to Terminate Application

Figure 1

----------------------- S E U G I - Application Reports -------- ROW 1 OF OPTION ===> DATE: 89/05/09

TIME: 11:15 Report Name Title

CSS1 CSS CPU USAGE BY DEPT. MONTH=FEB89 CSS2 CSS CPU USAGE BY INTL USER MONTH=FEB89 CSS1 CSS CPU USAGE BY DEPT. MONTH=MAR89 CSS1 CSS CPU USAGE BY DEPT. MONTH=APR89 CSS2 CSS CPU USAGE BY INTL USER MONTH=MAR89 CSS2 CSS CPU USAGE BY INTL USER MONTH=APR89 CSS3 CSS SERVICE UNIT CONSUMPTION CSS4 CSS AVERAGE RESPONSE TIMES

****************************** BOTTOM OF DATA *****************************

Figure 2

323

Page 7: ISPF - sasCommunity Software As An... · continue) a POF edit session, browse a dataset, invoke another ISPF application, perhaps inquire on the status of a batch job or enter an

APPLICATION

? •

Page 8: ISPF - sasCommunity Software As An... · continue) a POF edit session, browse a dataset, invoke another ISPF application, perhaps inquire on the status of a batch job or enter an

Selection Panel 1

Primary Menu

Selection Panel 2

325

3rd Function

Page 9: ISPF - sasCommunity Software As An... · continue) a POF edit session, browse a dataset, invoke another ISPF application, perhaps inquire on the status of a batch job or enter an

>< ''XI

Ct..

c o

G)

co Cr:: ...::c:

o II ::;; . .£..::

0....

C)

!:...-

Cl

C.c::: :=) LLJ

I"J ~~ ( ...... J I.{)

L()

"'":I.' \'-. 1;"'"--'

'Y."~.-

eel ~-. ",j-

~-V) Cl

CJ)

I>.J f-- .. -Cl)

r:::::' ~ .... ") .,::( i·~·-···

"""~to. :J;.~:

".:;f- !,·.t)

.. "j-

C) tel GJ

326

I· ... ")

1---Ij~)

[J::) ~,.,~

Ct':::: ':--'. Cl LLl (Cl -,- C::J . .1-

1-- [>J I_n C) r.>J t·r )

r:::) b~

c-·,.1 ~ ......

Cr::1 1.0 .0;._ •••. r---·-'0;---- "t;--..

Page 10: ISPF - sasCommunity Software As An... · continue) a POF edit session, browse a dataset, invoke another ISPF application, perhaps inquire on the status of a batch job or enter an

t ~ ~; ',~~ ),

" ~, F ~

I l' Cry ~~

cO f t· [t:: 1:: f 'I ~, (L ", fr , .,:(

l' I I ~:,

1 ;-,

1 :i

f' 0) r: ~/.t'~ I C(J ;.r, :. ~ "f':. 0 ct::: ~ ··:r: t I

I ",' I :~ ~?

l + f' I " 0

t }: 0)

t I Cl)

~" IlI~Jtilll1ill

J a::i " Ld } X ~: <Xl

~ u_

r.

~ CL

t 1 I::) ,}:

~ E C}'] ··I·~·J

U) 0 I co 0 i

~ :,.'~ iii' u 'I :;:~ f-._-

.\ ,. II I -«

i (/) I 1 I "'~'::I

t L..) I~ I ~

f. ~ !

.' 2: I C~J

~: II

I l 0:) ~\

I C) ;r. ~'I~ h=

t ;

II

I..d ,: "'1. 0 I' .~ C::::J ..c ,-" e :? I -1-' :::; ~ ; -+-'

I 1 <:..) ~:=

:=:;

t c() 0 -(:;I

~ ""t.,"?

I ClJ :~ (tl

K I:::J ::::,-::-... 2:

~ '1 l- e)

i [ ll- ~:~:

~: ~'

<:..;, DC) I; c

I C()

P L!~ t f---

t·, e.! t' "J.

f C) ." .. J

~ Cl

C !--

~

t ~ :~~I~ ~

C)

ii lo_ cO _c::

I 0 IX) Ij)

;. ~ I CL .. j r ,I Ld l ~, I i

l.-/) i:: l ~ t C;() ):

II II I i: co 1-I I " l ,.

+

c., " ::21

"

/1 .' .,; .«

/ ,I

/ t' I -t c() * I

I' ,I ,I cO I I'

-r--r-.--·r--·'----l I . --.---·-.... -T--,---r .....J

~ 0 0 C) 0 C) I:::::) --::1" C) 0 0 0 0 c)

LO "';;1'- r .... ') C·..J 0

0::: <'.J.) (0 ,::::L (:::J l.- ('J '-v (I) , ............ (I) (l) <:...:>

327