Porting SAS Output from
UNIX or Mainframe to Desktop

 

by Dr. Alex Yu


Although many SAS users like to perform statistical computing on SAS for Mainframe and SAS for UNIX for their power, some users prefer to output the result in their LaserJet. First, some people do not like greenbar papers. Second, some people hate to take a long walk to get to the printer attached to the mainframe or UNIX computer.

To download SAS outputs from the mainframe or UNIX by FTP is easy. But it is frustrating that the format of the output becomes messy after the downloading. There are some ways to resolve this problem:

In your SAS program insert this line in the beginning:

options ls=80 ;

This will set the column width to 80 and the output will fit into the A4 format.

If the program cannot run correctly, you may use the following option statement instead:

options nocenter;

In TSO you can follow the procedure below to capture the output to a file for downloading:

  • At the Input-Output Facilities (IOF) select SASLIST.
  • At the commmand line type SD DSNAME('PDS_NAME(MEMBER_NAME)') and press Enter. PDS_name is the name of your partitioned data set. For example, you may enter SD DSNAME('wyl.aq.aaa.chy(output)').
  • At the command line type SNAP ALL. If you want to capture the entire output, type the command at the first page. If you want to capture only part of output, enter the command at the page where you want to start capturing.

After downloading, you may use a Word Processer such as Microsoft Word to edit the output:

 

  • Select the entire text (Press Control-A in a PC; Press Apple-A in a Mac)
  • Change the font to Courier New
  • Change the font size to 10
    (Word 97 set 10 point Courier New as the default).
  • Change the left and right margins to 0.5
  • Delete the sentence "The SAS System" on the first page only. Then use Replace All to replace "The SAS System" to "Page Break," which is denoted by "^m". SAS outputs have the header "The SAS System" on every page. The replacement will put page break at the right place on every place

Now you can send your nice looking output to the LaserJet.


If you want to download a dataset from SAS/TSO or SAS/UNIX to your desktop, you should watch out missing values in numeric variables. SAS automatically assigns a period for missing data. When you download them into Access or Excel, Access or Excel would recognize the data as text rather than numeric. To overcome this problem, you should change all missing values to 0 or 999.

 

	If var1 = . then var1 = 999
	
Further, you should watch out the data type when you import the downloaded data into Access or Excel. The default data type for imported data are "general." But if you have a variable called "ID," the data values would be treated as numeric even though they are text indeed. During the importation the leading zero would be truncated. For instance, ID number "00111" would become "111" instead. To avoid this probelm, you should select "text" rather than "general" for this type of data.


 

Navigation

 

Index

 

Simplified Navigation

 

Table of Contents

 

Search Engine

 

Contact