**Interacting with the CMS Mainframe\
from a PC using SAS^®^ Connect**

Rick Andrews, Office of Research, Development, and Information,
Baltimore, MD

**ABSTRACT**

SAS/CONNECT is a software package that allows client/server
functionality for the SAS System providing the ability to manage,
access, and process data in a distributed environment. It enables direct
processing to remote data sources and the ability to retrieve results
from the server. SAS/CONNECT allows for the development of local
graphical user interfaces that process remote data sources and the
transfer of data.

This document is meant to provide examples of these remote processing
capabilities between the Centers for Medicare and Medicaid Services
(CMS) mainframe and personal computers within the CMS network. It is not
meant to be a step by step tutorial. SAS/CONNECT software must be
installed on the local machine and access to the mainframe must be
granted.

**CONTENTS\
**

1 [Signon to Mainframe](#b1)

2 [Signoff the Mainframe](#b2)

3 [Download a Flat File](#b3)

4 [Upload a Flat File](#b4)

5 [Identify Data Sets within a SAS Library](#b5)

6 [View MetaData (contents) of SAS Data Set](#b6)

7 [Output MetaData of a SAS Data Set](#b7)

8 [Determine the Size of a SAS Data Set](#b8)

9 [Download a SAS Data Set](#b9)

10 [Download Multiple SAS Data Sets](#b10)

11 [Allocate Partitioned Data Set (PDS)](#b11)

12 [Allocate Sequential Data Set](#b12)

13 [Allocate SAS Library - Short Version](#b13)

14 [Allocate SAS Library - Long Version](#b14)

15 [Delete a Mainframe Library](#b15)

16 [Print List of PDS Members](#b16)

17 [Print Contents of a PDS Member](#b17)

18 [Get Information about Members of a PDS](#b18)

19 [Obtain a List of Libraries for a High Level Qualifier](#b19)

20 [Create MS Excel or HMTL File on the CMS Mainframe](#b20)

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b1 .anchor}**1) Signon to Mainframe \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

%let rmthost=cmsdev;

options remote=rmthost comamid=tcp device=win;

signon rmthost.5227 user=\_prompt\_ ;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b2 .anchor}**2) Signoff the Mainframe \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

signoff;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b3 .anchor}**3) Download a Flat File \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

RSUBMIT RMTHOST.5227;

**proc** **download**

infile = \"A243.@DCH7801.LIB.SAS.PROG(RA0507D1)\"

outfile = \"F:\\tracker\\A243.@DCH7801.LIB.SAS.PROG(RA0507D1).txt\";

**run**;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b4 .anchor}**4) Upload a Flat File \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

RSUBMIT RMTHOST.5227;

**proc** **upload**

infile = \"F:\\sas\\sasprog\\FILELIST.txt\"

outfile = \"A243.@DCH7800.EXAMPLES(FILELIST)\";

**run**;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b5 .anchor}**5) Identify the Data Sets within a SAS Library
\*;**

**\* NOTE: Output goes to the Log Window \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

RSUBMIT RMTHOST.5227;

libname MVS \'A243.@DCH7801.RA0505A1.SASDATA\' disp=shr;

**proc** **datasets**

lib = MVS;

quit;

libname MVS clear;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b6 .anchor}**6) View MetaData (contents) of SAS Data Set
\*;**

**\* NOTE: Output goes to the Output Window \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

RSUBMIT RMTHOST.5227;

libname MVS \'A243.@DCH7801.RA0507D1.BESS\' disp=shr;

**proc** **contents**

data = MVS.BESS_PHYS_AGG;

**run**;

libname MVS clear;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* 7**[]{#b7 .anchor}**) Output MetaData of a SAS Data Set \*;**

**\* NOTE: Output goes to SAS Data Set \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

RSUBMIT RMTHOST.5227;

libname MVS \'A243.@DCH7801.RA0507D1.BESS\' disp=shr;

**proc** **contents**

data = MVS.BESS_PHYS_AGG

out = BESS_PHYS_AGG

noprint;

**run**;

**proc** **download**; **run**;

libname MVS clear;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b8 .anchor}**8) Determine the Size of a SAS Data Set \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

RSUBMIT RMTHOST.5227;

libname MVS \'A243.@DCH7801.RA0507D1.BESS\' disp=shr;

**proc** **sql**;

select libname,

memname,

nobs as Num_of_Obs format=comma16.,

bufsize \* npage as Bytes_Alloc format=comma16.2,

nobs \* obslen as Bytes_Used format=comma16.2

from dictionary.tables

where upcase(libname) = \'MVS\'

and upcase(memname) = \'BESS_CPT\';

quit;

libname MVS clear;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b9 .anchor}**9) Download a SAS Data Set \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

libname D_Drive \'D:\\Temp\';

RSUBMIT RMTHOST.5227;

libname MVS \'A243.@DCH7801.RA0505A1.SASDATA\' disp=shr;

**proc** **download**

data = MVS.DENOM_2003

out = D_Drive.DENOM_2003;

**run**;

libname MVS clear;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b10 .anchor}**10) Download Multiple SAS Data Sets \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

libname D_Drive \'D:\\Temp\';

RSUBMIT RMTHOST.5227;

libname MVS \'A243.@DCH7801.RA0508C1.SASDATA\' disp=shr;

**%macro** Download_It(TBL);

proc download

data=MVS.&TBL

out=D_Drive.&TBL;

run;

**%mend** Download_It;

\%***Download_It***(MEDPAR_20PCT_2002_DIAG_3);

\%***Download_It***(MEDPAR_20PCT_2002_DIAG_4);

\%***Download_It***(MEDPAR_20PCT_2002_DIAG_5);

\%***Download_It***(MEDPAR_20PCT_2002_DRG_3 );

\%***Download_It***(MEDPAR_20PCT_2002_PROC_2);

\%***Download_It***(MEDPAR_20PCT_2002_PROC_3);

\%***Download_It***(MEDPAR_20PCT_2002_PROC_4);

libname MVS clear;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b11 .anchor}**11) Allocate Partitioned Data Set \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

RSUBMIT RMTHOST.5227;

filename pds \'A243.@DCH7800.MYPDS\'

disp=(new,catlg)

space=(cyl,(**1**,**1**,**1**))

recfm=VB

lrecl=**255**;

filename pds clear;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b12 .anchor}**12) Allocate Sequential Data Set \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

RSUBMIT RMTHOST.5227;

filename seq \'A243.@DCH7800.MYSEQ\'

disp=(new,catlg)

space=(cyl,(**1**,**1**))

recfm=VB

lrecl=**80**;

filename seq clear;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b13 .anchor}**13) Allocate SAS Library - Short Version \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

RSUBMIT RMTHOST.5227;

libname mysas \'A243.@DCH7800.SASDATA\' disp=new;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b14 .anchor}**14) Allocate SAS Library - Long Version \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

RSUBMIT RMTHOST.5227;

libname mysas2 \'A243.@DCH7800.SASDATA2\'

disp=(new,catlg)

space=(cyl,(**2**,**1**))

blksize=**27648**; \*\<\-- Used for Half-Tracking \*;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b15 .anchor}**15) Delete a Mainframe Library \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

RSUBMIT RMTHOST.5227;

**data** \_null\_;

%sysexec delete \'A243.@DCH7800.SASDATA\';

**run**;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b16 .anchor}**16) Print List of PDS Members to the Log using
Proc PDS \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

RSUBMIT RMTHOST.5227;

options orientation=landscape linesize=**133**;

**proc** **pds**

ddname = \'A243.@DCH7801.LIB.SAS.PROG\';

**run**;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b17 .anchor}**17) Print Contents of a PDS Member to the Log
\*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

RSUBMIT RMTHOST.5227;

**proc** **source**

indd = \'A243.@DCH7801.LIB.SAS.PROG\'

print;

select RA0507D1;

**run**;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b18 .anchor}**18) Get Information about Members of
Partitioned Data Set \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

RSUBMIT RMTHOST.5227;

%let PDS = A243.@DCH7800.EXAMPLES;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* Create Input / Output File References \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

filename inpds \"&PDS\";

filename outdd temp;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* Output List of PDS Member using Proc Source \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**proc** **source**

indd = inpds

dirdd = outdd

nodata

noprint;

**run**;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* Import PDS Data from Proc Source \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**data** work.proc_source_output;

length filename \$**44**

member \$**8**;

infile outdd truncover;

input @**1** member \$8.;

filename = \"&pds\";

**run**;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* Clear File References \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

filename inpds clear;

filename outdd clear;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* Download the SAS Data Set \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**proc** **download**; **run**;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\*** []{#b19 .anchor}**19) Obtain a List of Libraries for a High Level
Qualifier \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

RSUBMIT RMTHOST.5227;

%let HLQ = A243;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* Create Input / Output File References \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

filename sysin \'&temp\'

disp=(new,delete)

space=(trk,(**1**,**1**))

lrecl=**80**

blksize=**6160**

recfm=fb;

filename catout \'&temp\'

disp=(new,delete)

space=(trk,(**1**,**1**))

lrecl=**133**

recfm=vba;

filename sysprint sysout=a;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* Place LISTCAT Command into Temp SYSIN File \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**data** \_null\_;

file sysin;

put @**2** \"LISTCAT LEVEL(&HLQ) OUTFILE(CATOUT)\";

**run**;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* Execute IDCAMS to Submit LISTCAT Command \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**proc** **idcams**; **run**;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* Import Data from Proc IDCAMS Output \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**data** work.proc_idcams_output;

length file_type \$8.

file_name \$44.;

infile catout truncover;

input @**1** temp_var \$133. ;

file_type = substr(scan(temp_var,**1**,\' \'),**2**);

file_name = scan(temp_var,**3**,\' \');

if file_type in (\'NONVSAM\',\'CLUSTER\',\'DATA\',\'INDEX\');

drop temp_var;

**run**;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* Clear File References \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

filename sysprint clear;

filename sysin clear;

filename catout clear;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* Download the SAS Data Set \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**proc** **download**; **run**;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* 20**[]{#b20 .anchor}**) Create an Excel or HTML File on the
Mainframe \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

RSUBMIT RMTHOST.5227;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* Create Output for HTML or Excel File \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

filename xlsfile \"&temp\"

disp=(new,catlg)

space=(cyl,(**25**,**10**))

dsorg=po

recfm=vb

lrecl=**8000**;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* Create HMML or Excel File \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

ods listing close;

ods html body = \"MYFILE\"

path = xlsfile (url=none)

trantab = ascii

style = sasweb

nogtitle;

title \"My Excel File\";

**proc** **print**

data=work.proc_idcams_output;

**run**;

ods html close;

ods listing;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* Download the HTML or Excel File \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**proc** **download**

infile = xlsfile(MYFILE)

outfile = \"d:\\temp\\myfile.html\"

binary;

**run**;

ENDRSUBMIT;

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

**\* Open HTML or Excel File \*;**

**\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*;**

%sysexec \"d:\\temp\\myfile.html\";

#### 

#### CONCLUSION

The SAS/CONNECT software is a powerful client/server application for
individuals familiar with the SAS System and can also be used to create
interfaces that allow those with little experience using mainframe or
Unix platforms the power of remote these servers.

#### REFERENCES

## SAS Institute (1999). "SAS/CONNECT User\'s Guide" SAS OnlineDoc®. Copyright 1999.

\<<http://v8doc.sas.com/sashtml/>\> (August 1, 2005).

**ACKNOWLEDGMENTS**

The author wishes to thank David Gibson and Jim Summe for presenting the
challenges that facilitated the need to create these connectivity.

**CONTACT INFORMATION**

Your comments and questions are valued and encouraged.

#### Rick Andrews

Centers for Medicare and Medicaid Services

Office of Research, Development, and Information

7500 Security Boulevard

Baltimore, MD 21244

Phone: (410) 786-4088

E-mail: <Richard.Andrews@cms.hhs.gov>

SAS and all other SAS Institute Inc. product or service names are
registered trademarks or trademarks of SAS Institute Inc. in the USA and
other countries. ® indicates USA registration.