Upload
dominh
View
220
Download
0
Embed Size (px)
Citation preview
SAS Version 8 Interface Prepared by
International SAs®Training and Consulting
Destiny Corporation -100 Great Meadow Rd Suite 601- Wethersfield, CT 06109-2355 Phone: (860) 721-1684- 1-80D-7TRAINING- Fax: (860) 721-9784
web: www.destinycorp.com Email: [email protected]
Copyright 1999
New Display Manager Interface
This section is designed to cover some of the finer aspects of what has changed in Display Manager. The Pull Down menus and navigational tools are covered.
Copyright 1999 Destiny Corporation
292
The new application work space appears.
: BAS initio) izatlon ll$0d: real t.iae 10.59· seconds
Copyright 1999 Destiny Corporation
293
Display Manager Operations
Nums Command Turn the number column on if desired.
Copyright 1999 Destiny Corporation
294
Enhanced Editor (Version 8 and above) SAS offers a new window that performs interactive editing. It is called the Enhanced Editor. It examines syntax as it is typed. Notice how colors change based on the words typed and when semicolons are input. ·
:BAS Initialization used: reel tlae 31.02 seconda
Copyright 1999 Destiny Corporation
295
work.one; infile •c:\sas\data\demograf.'; input age gender $ salary;
work.one; infile 'c:\sas\data\deroograf.; input age gender $ salary;
print data=work.one;
Copyright 1999 Destiny Corporation
298
Opening a SAS Program
Select.
To see the following dialog box.
Copyright 1999 Destiny Corporation
299
For specific file type, select the down arrow.
All Files (•. •) Log Files (".log) List Files (".1st) Data Faes •. dat
To navigate and find the file, click on the appropriate button.
Copyright 1999 Destiny Corporation
300
Opening an Object
The file opens into the program editor and executes immediately.
From the File Pull Down Menu, use the Open Object selection and the following screen appears.
Select on Enlly 1o Open
Ubraries E1J"·ID Maps E!I· .. IJ Seshelp $·-·ID Sesuser GJ·i8Wo1k
Sashelp Map< Sasuser Work
II ••
Ent1y Name: (_ ,,,,,.,,,,,,,,,,, .- , , .......................... . ...................... "" .................................................................................... ,. .......................... ,. ....... , ........................................... J __________________ jj
You can create a new library:
Go up a level:
Toggle details:
Change to Advanced entry selection
The following screen appears.
Copyright 1999 Destiny Corporation
302
--"·---~~------------------~-~- ~- ~ --- ~~" ~- ~ -~--~~------Open i •"
Select on Ent~y to Open
COoOo C1515 cmr
Entoy Name: L""'"''""''"'''·"'·'"''"''"''"''" '"'"''"'""'""'""'"""""''"'"""'""''""''"'"""'"'-'"""""'"'""'"""""'""'"" ,."""''"""'""'"""······
EnllyType: I soURCE Enlly(SOURCE)
Select a Catalog and an Entry
• ••
'''"''"''"'"''·"'"'"'"'"''"""i ·-· flr)t•n ------------ ·• " •• "'"'""-------------------------- ~;
Solect an Entoy to Open • •• Mdcl .. o Q..-1 Mdci:J QQ..-2
t Obi>ool QQ ...... 3 Olutor Qsompeoi
j._, Oui!U ... L Pdevice Qsampbb i
t~ Qoooiol
I Q Somp_ocl
QLIOIJI Qs.~ ~-· Regoct j,, Report as-' QSysqm ~-· Sasdesk ·-· Scm
Select- or double click on the item and it opens into the Program Editor.
Copyright 1999 Destiny Corporation
303
NAI'IE LANGUIIGE Pli'IPOSE
USAGE
SASHELP.QASSIST.SAnPLSAS.SOURCE 8118-SQI.. Creates s-le SAS tabl.,.. for the "Query and Reporting tool In 8118/1\SSIST. Optionally change the llbnaae stat ....... t below th...., c0111111ent 1 ines. Furthermare, relations between tables are defined. lifter the -ple tables are cr""ted, the relation table needs to be IIOYed to the location........., the~ Manager tables are stored. For exsanple, If you are creating the sample tabl..., In the 1\IRI.INE 1 ibrar-y, nm this code: proc dataseta dd•a lrll-ne;
append base=sasuser._sarels data=_sarels; delete _sarels;
run;
Ill 1 <klta lines are Included in the source below. The program creates the following SAS tables:
COLS
Copyright 1999 Destiny Corporation
304
Filing a Program To Save a program, log or output to a flat file, select File, Save
Type in the name of the file.ftest I and click extension is needed. SAS automatically creates the appropriate extension.
Copyright 1999 Destiny Corporation
305
Notice no
Filing to a Catalog Alternatively, information can be saved into a catalog. Select File,
The following screen appears.
~------------------------------------------------~ ! s-.~ g,
Select a Destination Enby
Ubreries ~···8 MOps
' ~Hlf Soshelp 1$HDS-r 00·!1; Wmk
EnllJI Type: I soURCE Entry (SOURCE)
Select the Entry Type.
Sashelp Maps
Sawser Wmk
•••• I !-~-·
•
Another button has appeared. It allows you to create a new catalog.
Copyright 1999 Destiny Corporation
306
Importing Data
Menu driven importing is available in SAS. Select File,
The following dialog box appears.
Click the • and the choices appear, dependent on the software installed. (Note: this selection uses SAS/ACCESS to PC File Formats as one of the installed products.)
Copyright 1999 Destiny Corporation
307
The following screen prompts for the file location.
Select if you need to search for the location of the file. The following screen appears.
Copyright 1999 Destiny Corporation
308
Once the file is found, click
to select the destination library.
Copyright 1999 Destiny Corporation
309
Click to see the following screen for creation of a SAS program that can be used after this process.
Click and the following message appears in the Log.
Ill gaptions tan;aet=<;~if; ~OTE: WORK. TEST was successfully created.
To see the program just built, include it into the Program Editor.
Copyright 1999 Destiny Corporation
310
The following code appears.
PROC CIMPORT is a new procedure available in SAS.
PROC IMPORT: Introduction The IMPORT procedure reads data &om an external data source and writes it to a SAS data set. Extema1 data sources can include DBMS tables, PC 61es, spreadsheets, and delimited extemal61es (which are 61es containi!lg columns of data values that are separated by a delimiter such as a blank. or a comma).
Once you invoke PROC IMPORT, the procedure reads the input 61e and writes the data to a SAS data set, with the SAS variables defined based on the input records. PROC IMPORT imports the data by one of the following methods:
• generated DATA step code
• generated SAS/ACCESS code
• translation engines.
You control the results with options and statements that are specific to the input data source. PROC IMPORT produces the specified oulput SAS data set and writes information regarding the import to the SAS log. fu the log, you will see the DATA step or the SAS/ACCESS code generated by PROC IMPORT. If a translation engine is used, then no code is submitted.
PROC IMPORT is available for Version 7 on the following hosts:
eOS/2
• UNIX
• VMS
• Windows 95
• WmdowsNT
Copyright 1999 Destiny Corporation
311
PROC IMPORT: Syntax
PROCIMPORT
DATAFILE=':filenalM" I TABLE= "table name"
OUT=SAS'-data-set
< DBMS=identifier>
<REPLACE>;
< data-source-statements>;
Copyright 1999 Destiny Corporation
312
Exporting Data
To export SAS data set or view information, select File,
The following screen appears.
Select the source data file or view.
Copyright 1999 Destiny Corporation
313
Click
The following dialog box will appear.
Select the destination and click
Copyright 1999 Destiny Corporation
314
To save the PROC EXPORT code, type in the name and click ITo see the code, include it into the Program Editor.
PROC EXPORT syntax is as follows.
Copyright 1999 Destiny Corporation
315
Overview
The EXPORT procedure reads data from a SAS data set and writes it to an external data source. External data sources can include DBMS tables, PC files, spreadsheets, and delimited external files (which are 61es that contain colunms of data values that are separated by a delimiter such as a blank or a comma).
Once you invoke PROC EXPORT, the procedure reads the input data set and writes the data to the external data source. PROC EXPORT exports the data by one of the following methods:
• generated DATA step code
• generated SAS/ACCESS code
• translation engines.
You control the results with options and statements that are specific to the output data source. PROC EXPORT produces the specified output file and writes information about the export to the SAS log. In the log, you see the DATA step or the SAS/ACCESS code generated by PROC EXPORT. If a translation engine is used, then no code is submitted.
PROC EXPORT is available for Version 7 on the following hosts:
.oS/2
• UNIX
• VMS
• Wmdows 95
• WindowsNr
Procedure Syntax
PROC EXPORT DATA=ZAS-data-set OUTFILE="fiknanw"l OtTITABLE="table-name'
<DBMS=identifier> <REPLACE>;
<data-source-Gtat.enwnts;>
Copyright 1999 Destiny Corporation
316
Page Setup This is for defining standard settings for particular files, regardless of the Printer. This information is stored on this SAS machine.
Select File, I The following screen appears.
Copyright 1999 Destiny Corporation
317
Print Setup
Print Setup is designed to structure how printed SAS output is represented, based on the printer selected.
Copyright 1999 Destiny Corporation
318
Print Preview This selection is designed to allow viewing of the printed output with all settings, prior to printing .
... - ·- ... ... -· 1 -· -· • • .,_,. - • • ..,_,. .... . • • _,. ...... • • ..,_,. ..... • • .._,. - • ' - - • • - - • .... • ..,_,. _ ... • .. -· - 0
" _,. - • ....... ,. .,_,. - • U.,IUIUI89
•• - -· • -.. .. - ....... • .. ..._,. - 0 • .. ....... ,. - 0 - .... "
_,. - • -.. _,. - • • .. - . ....... • • .. -· ... ... • • .. - ... _ • • .. - - • --.. - ....... • ---1 .. - - • • .. ..,....,. - • • .. ,_,. - • .. .._.. lt1
_,. -.. ....... ,. -.. ..,_,. -., - -" ,.._,.,. -· • <iii~J~$~,8)~~
" - ..... • ... -.. .,_,. - • • .. _,. - • "" • _,. - 0 ""-" .. .,_,. - • .........:! .. - - • ,. _,. -- • .. - ...... • .... .. - -· • .. - ·- 0 .... .. _,.,. - • '····"'---
Copyright 1999 Destiny Corporation
319
Printing
To print anything, select
To see the following dialog box.
Copyright 1999 Destiny Corporation
320
Sending Mail
If the Mail Interface has been set up, the can be sent from within a SAS session.
Copyright 1999 Destiny Corporation
selection will work. E-Mail
321
Exiting SAS
To exit SAS, Select File,
The following dialog box appears.
Copyright 1999 Destiny Corporation
322
View Pull Down Menu
Results Option
This selection takes you to the Results window, which is a window that displays all SAS/HTML output generated in the current SAS session.
The SAS 5 _ystem
Select the following to see the HTML output.
Copyright 1999 Destiny Corporation
324
If Microsoft Internet Explorer is installed, the right click will bring up the following menu.
Select View Source to see the code behind the HTML.
Copyright 1999 Destiny Corporation
325
-->
content="text/htllll; charset= windows-1252">
II<IIDD'Y onload="startup( )" vlink=''IIUU41188" link=''IIUU66AA" leftmargin=B bgcolor="IIEOEOEO"> PT LAHGUAGE=''JavaScript"'>
all object unload() functions
Hduetica, Helv'' size="3" color= .. IIOU22BB"><A tlfii'IE•"IDK"><IA>
Face=''Arial, Helvetica, Helv" size="3" color="llllll2288") cellspacing=1 rules•HOHE Fraiiii!=UOID border•ll width=11ft cellpadding=1
bgcolor•"IEIEIIEII .. ><Font Face="Arial, Helvetica, Helu" sizl!•"5"
face•"Arial Heluetica Helv" sizl!•"3" color•"IIIIII228B"> cellspacing•1 rules•GRDUPS fra111e=BDX bor.der=1 cellpadding=7 bgcolor="llfllfllfll" bol•de'r<
Copyright 1999 Destiny Corporation
326
Explorer Option
The Explorer option yields the SAS Explorer.
11111999:53 PM tqodsoul 9KB SAS System 1... 1111199 6:54 PM
~s- 3KB T em Docunenl 1111199 9:56 PM saogopt 5KB SAS System ... 1n11996:55PM
r~ 28KB Microsoft HT ... 1111199 9:53PM
Sasmono.fot 21<8 FOT Fde 1111199 6:54 PM Sasmonob.fot 21<8 FOT Fie 1111199 6:54 PM test 225KB SAS System ... 1111199 9:21 PM
Copyright 1999 Destiny Corporation
327
Right click and select
The SAS data set will appear in viewtable.
Copyright 1999 Destiny Corporation
329
This allows for printing the file.
Not only to a printer, but to the OUTPUT window.
Obs region yl920 yl930 yl940 yl950 yl960 yl970 .. I New England 7401 8166 8437 9314 10509 11842 1000 2 NY NJ Pa 22261 26261 27539 30146 34168 37199 1000 3 Great Lake 21476 25297 26626 30399 36225 40252 1000 4 Plidweat 12544 13297 13517 14061 15394 16319 1000 5 South lltlent ic 13990 15794 17823 21182 25972 30671 1000 6 Ky Ten lila l'lis 8893 9887 10778 11447 12050 12803 1000 7 Ill'" La Ok Tex 10242 12117 13065 14538 16951 19321 1000 8 Plountaln 3336 3702 4150 5075 6855 8282 1000 9 Pacific 5567 8195 9733 14486 20339 25454 1000
10 111-ka 55 59 73 129 226 300 -1000 II Hawaii 256 368 423 500 633 769 -1000
Copyright 1999 Destiny Corporation
331
Query
The Query selection takes you into the Query Window with the file selected.
I lEI ;
I 13]
~ Col...,... 1111as/Labe1
· Column Formats I l~~u~nooar~: Funct ions I I t~a:;:e Before I iL """'" lf'lfter
Build a Column ;
-
Copyright 1999 Destiny Corporation
332