; PSPad code template for SAS ; Created by JSK okt 2003 ; [Macro definition] %TableName%=@E Table name:,,,, %Package%=@E Package:,,,, %Author%=@E Author:,,,, %Date%=@D Date:,,,, ; ; [COMMENT |r COMMENT BLOCK] /* |§ */ [IF | IF END IF] IF | THEN END IF; [IFE | IF ELSE END IF] IF | THEN NULL; ELSE NULL; END IF; [IFI | IF ELSIF END IF] IF | THEN NULL; ELSIF THEN NULL; ELSIF THEN NULL; ELSIF THEN NULL; ELSE END IF; [FOR iCnt | FOR iCnt IN .. LOOP] FOR iCnt IN |.. LOOP END LOOP; [FOR o | FOR o IN (SELECT LOOP] FOR o| IN ( SELECT ) LOOP NULL; END LOOP; ; ; -------------------------------------------------------------------------------- [PROC SORT |m PROC SORT]*CTRL+ALT+S PROC SORT DATA=%TableName% ; BY variable-1 <... variable-n>; -------------------------------------------------------------------------------- [PROC APPEND |m PROC APPEND]*CTRL+ALT+A PROC APPEND BASE=SAS-data-set SAS-data-set> ; -------------------------------------------------------------------------------- [PROC COMPARE |m PROC COMPARE]*CTRL+ALT+C PROC COMPARE ; BY variable-1 <... variable-n> ; ID variable-1 <... variable-n> ; VAR variable(s); WITH variable(s); -------------------------------------------------------------------------------- [PROC CONTENTS |m PROC CONTENTS]* PROC CONTENTS < option(s) >; -------------------------------------------------------------------------------- [PROC COPY |m PROC COPY]* PROC COPY OUT=libref-1 IN=libref-2 >; EXCLUDE SAS-file(s) ; SELECT SAS-file(s) >; /* Note: IN=libref-1 is required on PROC COPY, but is optional on the COPY statement */ -------------------------------------------------------------------------------- [PROC DATASETS |m PROC DATASETS]* PROC DATASETS < option(s) >; AGE current-name related-SAS-file(s) >; APPEND BASE= SAS-data-set SAS-data-set> ; AUDIT SAS-file-name ; INITIATE; >; >; or AUDIT SAS-file-name ; SUSPEND|RESUME|TERMINATE; CHANGE old-name-1=new-name-1 <...old-name-n=new-name-n > >; CONTENTS < option(s)>; COPY OUT=libref-1 ;> EXCLUDE SAS-file(s) < / MEMTYPE=mtype>; SELECT SAS-file(s) >; DELETE SAS-file(s) >; EXCHANGE name-1=other-name-1 <...name-n=other-name-n> >; MODIFY SAS-file <(file-option(s))> >; FORMAT variable-list-1 <...variable-list-n >; IC CREATE = (NOT NULL (variable) | CHECK(WHERE-expression) | PRIMARY KEY (variables) | UNIQUE (variables) | FOREIGN KEY (variables) REFERENCES .SAS-data-set ) >; IC DELETE constraint-name(s)| _ALL_; IC REACTIVATE foreign-key-name REFERENCES libref; INDEX CENTILES index(s) >; INDEX CREATE index-specification(s) >; INDEX DELETE index(s)|_ALL_; INFORMAT variable-list-1 <...variable-list-n >; LABEL variable-1=<'label-1'|' '> <...variable-n=<'label-n'|' ' >>; RENAME old-name-1=new-name-1 <...old-name-n=new-name-n>; REPAIR SAS-file(s) >; SAVE SAS-file(s) ; -------------------------------------------------------------------------------- [PROC EXPORT |m PROC EXPORT]* PROC EXPORT DATA=SAS-data-set OUTFILE="filename" | OUTTABLE="tablename" ; < data-source-statements;> -------------------------------------------------------------------------------- [PROC FORMAT |m PROC FORMAT]* PROC FORMAT ; EXCLUDE entry(s); INVALUE <$>name <(informat-option(s))> value-range-set(s); PICTURE name <(format-option(s))> value-range-set-1 <(picture-1-option(s) )> <...value-range-set-n <(picture-n-option(s))>>; SELECT entry(s); VALUE <$>name <(format-option(s))> value-range-set(s); -------------------------------------------------------------------------------- [PROC FREQ |m PROC FREQ]* PROC FREQ ; BY variable-1 <... variable-n> ; EXACT statistic-keyword(s) ; OUTPUT statistic-keyword(s) ; TABLES request(s) ; TEST statistic-keyword(s); WEIGHT variable; -------------------------------------------------------------------------------- [PROC IMPORT |m PROC IMPORT]* PROC IMPORT DATAFILE="filename" | TABLE="tablename" OUT=SAS-data-set ; < data-source-statements;> -------------------------------------------------------------------------------- [PROC MEANS |m PROC MEANS]* PROC MEANS ; BY variable-1 <... variable-n>; CLASS variable(s) ; FREQ variable; ID variable(s); OUTPUT ; TYPES request(s); VAR variable(s) < / WEIGHT=weight-variable>; WAYS list; WEIGHT variable; -------------------------------------------------------------------------------- [PROC PRINT |m PROC PRINT]* PROC PRINT < option(s)>; BY < DESCENDING> variable-1 <...< DESCENDING> variable-n>< NOTSORTED>; PAGEBY BY-variable; SUMBY BY-variable; ID variable(s); SUM variable(s); VAR variable(s); -------------------------------------------------------------------------------- [PROC REPORT |m PROC REPORT]* PROC REPORT ; BREAK location break-variable; BY variable-1 <... variable-n> ; COLUMN column-specification(s); COMPUTE location <[style-attribute-specification(s)]>>; LINE specification(s); /* ... select SAS language elements ... */ ENDCOMP; COMPUTE report-item ; CALL DEFINE (column-id, 'attribute-name', value); /* ... select SAS language elements ... */ ENDCOMP; DEFINE report-item / <'column-header-1' <...'column-header-n'>>