3

Click here to load reader

SHARE and - sascommunity.org Gibson.pdf · SHARE and SHARE ALIKE ... This paper will show the three key features of my implementation SAS/SHARE at Gates, ... CNTL data libraries

Embed Size (px)

Citation preview

Page 1: SHARE and - sascommunity.org Gibson.pdf · SHARE and SHARE ALIKE ... This paper will show the three key features of my implementation SAS/SHARE at Gates, ... CNTL data libraries

SHARE and SHARE ALIKE

Michael R. Gibson, The Gates Rubber Company

As The Gates Rubber Company's SAS® Wizard, 1 needed a way to share SAS libraries efficiently among several groups of users. SAS/SHARE®, a relatively new product in the SAS system, helped me accomplish this objective. This paper will show the three key features of my implementation SAS/SHARE at Gates, using examples from my TSO CLIST for operating in a MVS/XA environment on an IBM 3084, and my SAS AUTOEXEC files.

STANDARDIZED LIBRARY NAMES:

The first key to the effective use of SAS/SHARE is standardizing library names. The SAS system at Gates is supported by the Computer Information Center, therefore, I use ·CIG" as the high-level prefix for all library names. The following suffixes form the last element of all SAS libraries:

1. SASLIB 2. SASPROF--3. SASFMT 4. CNTL

data libraries. SAS/ AF catalog libraries. permanent format libraries. code libraries that are standard OS partition data set with PS organization.

Middle level names are based on application usage. At Gates, applications fall into one of three categories - single user, departmental or divisional. For single user applications, I use the individual's TSO logon id as the middle level name. My logon is MG9950, for example, and my SAS data library, therefore, is "CIC. MG9950. SASLlB." Libraries are allocated to individual users as follows:

1. SASLIB as "user." 2. SASPROF as "sasuser." 3. CNTL as "code."

Department names are abbreviated to form a meaningful acronym. For instance, the Advertising Department at Gates is "ADVERT," and their data is stored as "CIC.ADVERT.SASLIB. "

1362

To allocate departmental libraries, I have adopted the follOwing conventions:

1. SASLIB is allocated as "dept. " 2. SASPROF is allocated as "deptuser. " 3. CNTL is allocated as "deptcode. "

Similarly, my one divisional application, for our Operations Division, is named to "OPERDlV," and their libraries are allocated as "oper" and "opertiser." There is no "opercode" at present.

Standardized library names greatly simplifies implementing SAS/SHARE as my TSO CLIST will show.

TSO CLlST:

For convenience, my entire TSO CLIST is appended to the end of this paper, but I would like to draw attention to a few major points.

• Lines 26 - 30 set up the default library names. This is greatly simplified by using the naming conventions discussed in the previous section.

Lines 32 - 38 allocate a special, permanent, department level format library. This must be done before starting SAS, and is the only time I have to hard-code user TSO logon ids within the CLIST.

• Lines 40 - 47 check for user libraries. If none are found, the defaults are set to missing, and allocations are controlled with the AUTOEXEC file.

• Now for the magic: lines 65 - 72 check to see if the user has an individual AUTOEXEC file. If not, a default AUTOEXEC file is used.

• Finally, in lines 73 - 74, SAS is invoked using the CLIST provided at installation, and the TSO CLIST variables from the previous lines.

Page 2: SHARE and - sascommunity.org Gibson.pdf · SHARE and SHARE ALIKE ... This paper will show the three key features of my implementation SAS/SHARE at Gates, ... CNTL data libraries

SAS AUTOEXEC:

Standardized names and the TSO CLIST lead us to SAS AUTOEXEC. If the user has a member in the AUTOEXEC Library, the SAS DMS Editor will execute the program for the user. PD9703, for example, has such a member in the AUTOEXEC Library:

BROWSE - PROD.USER.SASEXEC(PD9703) - ..... _-... , .. , """'TOP OF DATA m."""...., __ ~ 10 PGM: 20 CAPS ON: 30 X ALLOC F(DEPTCODE) DA('CIC.ADVERT.CNTL·) SHR: 10 SUB 'LlBNAME DEPT SERVER·MCR ·CIC.ADVERT.SASLIB';': 50 SUB 'LlBNAME DEPTUSER ·CIC.ADVERT.SASPROF' DlSP-SHR;': 60 SUB 'LlBNAME USER ·CIC.PD9703.SASLIB':": 70 SUB 'PROC DlSPLA Y C-SASUSER.STARTUP,MAIN.PROGRAM: RUN:': ------BOTTOM OF DATA ------

Line 10 puts DMS into the program editor screen, while line 20 sets caps on as the user's preference. Line 30 is a TSO system command to allocate PD9703's departmental code library. TSO Allocate is recommended here because I have found that SAS libname sometimes does not work properly in allocating control libraries.

Line 40 is the key to bringing up SAS/SHARE. At the present time, I bring up only two servers, SHARE and MCR, using a Ubname statement to allocate the shared library to the correct server.

Line 50 submits a libname statement to allocate a shared, departmental SASI AF® catalog library. Note that it is allocated with "disp=shr," because at the present, SAS/SHARE cannot handle catalog entries. Individual catalog members, therefore, cannot be updated unless all server users exit SAS, and the catalog library is re-a1located with "disp=old. "

1363

As an aside here, I might mention an additional naming convention that expedites updating department level applications. Whenever possible, related datasets, SAS/FSP® screens and code are given the same name within given catalogs. For instance, in "CIC,ADVERT ... ; catalog "Deptuser. Traffic" makes use of a data set named -Dept. TralTic," which is associated with ·a permanent fsedit screen, "TraffiC. Screen," and is invoked by "Deptcode(Traffic). "

Line 60 allocates the individual user's SAS library, again with a libname statement. I suggest using the libname statement to allocate all SAS libraries. It has proved to be easier and cleaner, with the added advantage that when the user exits SAS, the libnames' are automatically de-allocated.

Finally, line 70 submits a "proc display" to start up the user's applications. At Gates, I have made it a standard that all SAS users have a SASUSER librer with a "Startup" catalog containing an SASI AF program called "Main. Program." This is a very powerful tool because a SASI AF program can start any other member type. This also simplifies adding users to or deleting them from shared library environments.

As we have seen, SAS/SHARE administration and implementation can become relatively simple and transparent with a little pre planing. I have to insure that the servers have been started correctly and I have to maintain the AUTOEXEC files when there is a change in user status.

Page 3: SHARE and - sascommunity.org Gibson.pdf · SHARE and SHARE ALIKE ... This paper will show the three key features of my implementation SAS/SHARE at Gates, ... CNTL data libraries

,DIT --- TSO.ClISnCICSCOO) - 01.20

.. ***** .. ** .. *** .... ************ TOP OF DATA ************************** 00000 I PROC 0 + 000002 PRE (Clc) " USER PREFIX" + 000003 USER (&SYSUID) " USER HUmR" • 000004 INPUT 0 '* SAS INPUT FILE *' + OOOOOS LOG 0 '* SAS LOG FILE *' + 000006 OPTIONS 0 '* SAS OPTIONS *' + 000007 TRACE 000009 IF & TRACE NE THEN + 000010 CONTROL END(DEND) MSG SYMLlST CONLIST 000011 ELSE 000012 CONTROL END(DEND) MSG NOSYMLlST HOCONLIST NOflUSH 000015 /"'--______________ ----------- Jlj

000016 f* NAME: CICSCOO *f 000017 '* WRITTEN 6Y: Michael Gibson June 1966 version5.t6 *1 000018 '* DESC; InvokeSAS INTERACTIVE *' 000019 /'" MOO: To include SPECIAL user AUTOEXEC for SAS/SHARE "'/ 000020 lilt USER-ID must have a member in PROO.usER.SASEXEC lib. II /

000022 1* --------------------------------------------- * f 000025 ,,------ SET USER DA TASETS NAMES -----------------" 000026 SET &L1B = 1>.PRE..&USER .. SASLIB " SAS DSN LIBRARY" 000027 SET &PRO = &PRE .. II.USER .. SASPROF " SAS AF CAT LIBRARY" 000028 SET II.COO = &PRE .. Il.USER..CNT " SAS COIlE LIBRARY" 000029 SET &MAC = &PRE .. &USER .. SASMACRO " SAS MACRO LIBRARY" 000030 SET &FMT = &PRE .. &USER .. SASFMT " SAS PERM FORMAT LIBRARY " 000031 "---- ------- CHECK FOR DEPARTMENTIAL FORMA TlIBRARY ---------- " 000032 IF &USER = DJ5075 OR + 000034 &USER = TW9316 OR + 000035 &USER = 150074 OR + 000036 &USER = PD9703 OR + 000038 "USER = L 58072 THEN SET &FMT = CIC .ADVERT.SASFMT 000039 "--------- CHECK FOR USER LIBRARIES --------------------------- " 000040 IF &SYSDSNC&LfS·, NE OK THEN SET &L18= 000041 ELSE SET &lIB=··&L18" 000042 IF &SYSDSNC/.PRO·) N£ Of( THEN SET &PRQ= 000043 ELSE SET &PRQ="&PRO-000044 IF &SYSDSNCII.COIYJ NE OK. THEN SET &COO= 000045 ElSE SET &COO="&COO" 000046 IF &SYSDSNC&MAC·l NE OK THEN SET &MAC= 000047 ElSE SET &MAC="&MAC 000049 "--------- FORMAT LIBRARY MUST 6E ALLOCATED BEFORE " 000050 ,,---.. ---- START OF SAS SYSfEM " 000051 IF II.SYSDSNC&FMTJ EQ OK THEN + 000052 ALLOC HSASlfBl DAC&FMrJ REUSE SHR 000064 "----------- ALLOC AUTOEXEC FILE AND 5T ART SA5 ----------------- " 000065 SET DSN=PRoo .USER.5ASEXEC(&USERI " CHECK FOR AUTOEXEC " 000066 IF &SVSDSN(·&DSN·' NE OK THEN + 000067 ALLOC F(SASEX£C) DACPRoo.uSER.SASEXEC(DEFAUL m SHR REUSE 000009 lLSE DO 000070 000071 000072 DEND

ALLOC F(SASEXEC) DA(PRoo.USER.5ASEX£C(&USERl"l SHR REUSE SET &lIB=

000073 DOlT: 000074 000075 000076 000077

SAS AUTOSC&MAC·) UCODECII.COD"l SASUSERCII.PRO·) + USER('&lf8·) OPTlONSr&OPTIONSI & TRACE

/* -------------------------- EXIT SYSTEM -------------------- *! END; IF &SYSISPF EO ACTIVE THEN EXIT

ELSE LOGOFF *If .*M_ •• II II Ii*.* If._._ ill * _******** BOTTOM OF DATA*.1f III II _ •• * .***** .If.lilt *1f*1I II

SAS, SAS/ AF, SAS/FSP, and SAS/SHARE aTe registered trademarks of The SAS Institute Inc., Cary, NC, USA

1364