Presentation is loading. Please wait.

Presentation is loading. Please wait.

Things You Should Know + Usage Tips

Similar presentations


Presentation on theme: "Things You Should Know + Usage Tips"— Presentation transcript:

1 Things You Should Know + Usage Tips
SAS on Alpha1 Things You Should Know + Usage Tips

2 Assumptions You know something about SAS
You know something about OpenVMS Directory structures Basic commands (DCL) You want to find out how SAS and OpenVMS mix

3 SAS is SAS SAS procs are platform-neutral Platform-specific aspects
Starting and stopping SAS Retrieving and storing files Executing operating system commands

4 Topics Ways to Run SAS on Alpha1 Files and Directories
DCL (VMS) commands within SAS Ways to Set SAS Options

5 Part 1 Ways to Run SAS on Alpha1

6 Ways to Run SAS OpenVMS interactive session OpenVMS batch job
SAS interactive line mode SAS display manager mode SAS “non-interactive” mode X Windows interface (n/a at UI) OpenVMS batch job SAS batch mode OpenVMS network connection SAS/Connect

7 OpenVMS Session Types OpenVMS interactive session OpenVMS batch job
PowerTerm at Urban (Start menu, Supported Applications, Alpha Connect) OpenVMS commands entered singly OpenVMS batch job Batch of OpenVMS commands executed in the background (unattended execution) Launched from an OpenVMS interactive session OpenVMS network connection Dialogue between PC & Alpha1

8 “Non-Interactive” Mode
Prepare a SAS program file in a text editor. Tell SAS to run it. $ sas myfile.sas Input: SAS program file Outputs SAS procedure output (myfile.lis) SAS messages (myfile.log)

9 Interrupting SAS While SAS is running: If you exit SAS in this manner:
ctrl-Y NOTE: Attention signaled. NOTE: Enter “Y” to exit SAS, or “C” to continue. If you exit SAS in this manner: $ cleanup

10 Batch Mode Like “non-interactive” mode, but in a VMS batch job
Batch job: unattended execution You submit the batch job for execution Your PowerTerm session and your PC are free for other activities

11 Submitting Batch Jobs $ sasbatch myfile.sas
myfile.sas: SAS program file to run You can list multiple files to run (separated by commas, no intervening spaces) $ sasbatch file1.sas,file2.sas Programs run in given sequence, in one batch job Batch log file: myfile_batch.log Trouble-shooting Updated every 60 seconds

12 Submitting Batch Jobs SASBATCH is a shortcut
In general, you can create your own “DCL command procedure” to run SAS as required Submit the command procedure $ submit mystuff.com $ submit mystuff.com /after=18:00 $ help submit

13 Checking Batch Jobs To list your current batch jobs:
$ show entry Explanation of responses No such entry: no current batch jobs Executing: job currently running Pending: job waiting in line for execution

14 Monitoring a Running Batch Job
Examine batch log file of running job (as it is so far) $ type/tail batchlogname List your current VMS processes (including batch jobs) $ me Batch jobs marked with “B” Monitor a running process $ show process /continuous /id=procid Ctrl-Z to exit Check on data set growth $ dir /size=all filename

15 Killing a Batch Job Why? Steps
The running job is doing the wrong thing Steps Find the entry number: $ show entry Delete the batch job: $ delete /entry=(entry-number) Remove the WORK directory: $ cleanup

16 SAS/Connect Run SAS on your PC
Have PC SAS send SAS statements to Alpha1 MS Windows interface Alpha1 computational speeds Alpha1 disk storage

17 SAS/Connect in a Nutshell
In your SAS program on the PC: signon; rsubmit; SAS statements executed on Alpha endrsubmit; signoff;

18 Part 2 Files and Directories

19 SAS Data Libraries Often: SAS data library = VMS directory
libname datain ‘[thisproj.data]’; Also possible: multiple data libraries, one directory libname dataout ‘[thisproj.data]’; Also possible: one data library, multiple directories $ define mylibs [thisproj.data1999], [thisproj.data2000] In LOGIN.COM, for example libname datain ‘mylibs’;

20 Estimating Data Set Size
Calculate observation size Numeric variables: 8 bytes each Character variables: 1 byte per character Multiply observation size by number of observations Result in bytes bytes / 512 = VMS disk blocks This is an underestimate “Overhead” in the data set

21 Pre-Allocating Space Performance improvement: minimize time spent “growing” a file Data inputs.year2000 (alq= deq=5000) ALQ (allocation quantity): initial file size, in blocks DEQ (default extension quantity): incremental file growth, in blocks, when file grows If ALQ or DEQ is too low Increased I/O Greater fragmentation If ALQ or DEQ is too high Wasted disk space Greater risk of inadequate disk space

22 Common File Names Something.SAS Something.SASEB$DATA Something.DAT
SAS program Something.SASEB$DATA SAS data set Something.DAT External data file Something.LIS SAS procedure output Something.LOG SAS messages Something.LOCK$SASEB SAS lock file (data set in use)

23 SAS Work Directories SAS work directories go to one of two scratch disks SAS cleans up after itself if it exits normally SAS does not clean up after itself if it exits abnormally To clean up after SAS yourself: $ cleanup

24 VMS Logical Names Logical name: a name that refers to a disk, directory, and/or file name Example: "SYS$SCRATCH" = "DISK$UI_SCRATCH1:[UI_SYSDA.MYPROJ]" Uses Short-hand notation for a long file specification “RAW” = “DISK$SPC02:[OURSTUFF.CY1999.RAW]” Parameterizing file specifications libname inputs ‘data:’; Commands $ define raw disk$spc02:[ourstuff.cy1999.raw] $ show logical raw $ deassign raw

25 DCL (VMS) commands within SAS
Part 3 DCL (VMS) commands within SAS

26 DCL Commands from SAS X ‘DCL-command’; Examples: Command output
X ‘dir/size’; to show file sizes X ‘purge/log’; to get rid of prior file versions X ‘!Finished DATA step’; to note progress Command output VMS interactive session: PowerTerm window Batch job: batch log file

27 Part 4 Ways to Set SAS Options

28 Ways to Set SAS Options SAS configuration file SAS command line
SAS autoexec file OPTIONS statement in SAS file Order of precedence: in order shown above, later settings overrule earlier settings

29 SAS configuration file
Affects all SAS runs, including SAS/Connect Create a file (e.g. mysas.cfg) containing desired command-line options (e.g. /nocenter) Description of command-line options $ help sas $ define sas$config disk:[dir]mysas.cfg Add to LOGIN.COM to make it “permanent”

30 SAS Command Line Affects single SAS run $ sas /obs=10 myfile.sas
Note: Some options have different names when used on command line $ help sas options

31 SAS Autoexec File Affects all SAS runs, including SAS/Connect
Create a file (e.g. autoexec.sas) containing desired OPTIONS statement (e.g. OPTIONS nocenter) Other SAS statements can be included also $ define sas$init disk:[dir]autoexec.sas Add to LOGIN.COM to make it “permanent”

32 The End Questions?


Download ppt "Things You Should Know + Usage Tips"

Similar presentations


Ads by Google