SAS on OS/390 Interacting with USS Hsiwei Yu (Michael), Consultant, Gaithersburg, MD Michael Mcinerney, Consultant, Centreville, VA
Total Page:16
File Type:pdf, Size:1020Kb
SAS on OS/390 Interacting With USS Hsiwei Yu (Michael), Consultant, Gaithersburg, MD Michael McInerney, Consultant, Centreville, VA Note the HFS parameter on FILENAME statement is for USS only. ABSTRACT When dealing with regular Unix or Windows text file, we don’t need it at all. SAS on OS/390, a.k.a. MVS, can read and write text files and can store data in Hierarchy File System (HFS). HFS is the file system CREATE HTML FILES USING OUTPUT DELIVERY SYSTEM used by Unix Support Services (USS) when USS runs under With Output Delivery System (ODS), it is straightforward to create OS/390. Since SAS data set in USS, i.e. Unix from IBM, is in Cross- HTML files under USS. A brief outline: Environment Data Access (CEDA) form, this SAS data is recognized by SAS running on directory (or ASCII) based operating ODS HTML BODY= ’abc.html’ systems, for example Windows and other vendor’s Unix (such as ( TITLE= ‘ .. ‘ ) HP or Sun). PATH= ’/USS/directory’ ( URL= NONE ); INTRODUCTION We found out about these new OS/390 SAS features because we Proc print data= .. ; need to create HTML files based on SAS data, and to transfer SAS run; data from OS/390 to Windows. The OS/390 system can have USS running under it. In effect, an IBM OS/390 machine can appear to a ODS HTML close; Unix user simply as a Unix machine. (We use the term USS to mean the Unix variant from IBM.) Some IBM software requires USS, such Note the PATH parameter in the ODS statement is referring to an as web server and Notes. On such system, SAS can be used to actual USS directory, and it is sufficient to refer to this USS directory generate HTML files in HFS so that they can be viewed from only once in the ODS PATH parameter. The resulting HTML file is Internet. In addition to reading and writing text files, SAS can read named as the BODY parameter, and is created under the USS and write SAS data sets in HFS. This SAS data set is in CEDA directory identified by PATH parameter. form, meaning it can be sent to, say by FTP, other ASCII based system, say Windows. These new OS/390 SAS features enabled us This is easy to create HTML files in HFS from OS/390 SAS; to generate HTML files from SAS data sets, and facilitated SAS data however, this author tried and failed to create HTML file under native exchange between OS/390 and Windows. MVS file system. It failed because no matter how large the record READ AND WRITE TEXT FILES IN HFS length, i.e. LRECL=, may be, SAS ODS always writes a truncated record, causing the HTML file unrecognizable by web browser. A new HFS parameter in the FILENAME statement identifies USS files, for example, READ AND WRITE SAS DATA IN HFS For the LIBNAME statement, no special parameter, just specify the filename abc HFS ‘/Unix/directory/FileName’; USS directory as if regular MVS data set name, like: data _null_; infile abc .. ; /* INFILE for read */ Libname abc ‘/Unix/SAS/data/directory’; input .. ; Libname mvs_reg ‘OS data set name’ disp=shr; .. run; /* Read from MVS SAS data. Write to USS SAS data. */ Alternatively, a USS (or HFS) file can be specified though job control data abc.one; language (JCL), like set mvs_reg.two; .. .. ; //STEP1 EXEC SAS run; //ABC DD PATH=‘/Unix/directory/FileName’ // .. Note the actual file name ‘/Unix/directory/one.sas7bdat’ for the //SYSIN DD * created SAS data set, abc.one. This SAS data set in USS can be data _null_; directly transferred to Windows and operable there. This is because infile abc .. ; /* INFILE for read */ it is in Cross-Environment Data Access (CEDA) form. input .. ; .. PRACTICAL USES run; In our situation, corporate data is stored o n MVS as SAS data. We // were able to use MVS SAS for creating HTML files based on SAS data. This helps us to disseminate information within the enterprise. The examples above are for reading a USS text file. The only modification needed for writing to USS text file is changing from For SAS data in HFS directly usable by Windows, it potentially INFILE to FILE, like: allows us not to have SAS/CONNECT. Without this new feature, we would have to use Proc Import and Proc Export for converting SAS filename abc HFS ‘/Unix/directory/FileName’; data between MVS and other operating systems. With data _null_; SAS/CONNECT, Proc Upload and Proc Download are for data transfer across environments. Now if we store SAS data in HFS, file abc .. ; /* FILE for write */ then Windows, HP, Sun and other Unix variants can access without put .. ; extra steps. .. run; LIMITATIONS: CEDA FOR DATA ONLY, ETC. Currently the CEDA feature is for SAS data only. It does not handle SAS format entries. This is really a user-friendliness issue for we can convert a format into a SAS data set and transfer from there. For ease of use and relieving users of unnecessary steps, it would be nice if SAS Institute someday enhance CEDA to deal with all their different file types, i.e. format, informat, macro entries, and so on. Also note there is no direct SAS interface operating in USS. For USS user accustomed to other Unix environments, while working on OS/390, one would have to switch to the regular MVS interface for invoking SAS or submit JCL for batch SAS processing. This presents the USS user a learning curve to overcome. SAS Institute should adapt its interface on other Unix systems to be available under USS. This would entice USS users on OS/390 to treat SAS as an integral part of tools for solving their business challenges. CONCLUSION OS/390 SAS can deal with USS HFS files just like the traditional MVS data sets. This makes easy both report distribution, i.e. writing HTML files, and data exchange, i.e. the CEDA format, between USS and other ASCII based operating systems. CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the authors at: Hsiwei Yu (Michael) Consultant Gaithersburg, Maryland Work Phone: 301-948-9803 Email: [email protected] Michael McInerney Consultant Centreville, Virginia Email: [email protected] 2 .