Index
A
ABS function 167–168
absolute column pointers 374
ACROSS variables 254–255
advanced INPUT techniques
about 359
creating multiple observations 372–373
detecting ends of files 364–365
handling missing values 360–361
informat lists 373–374
problems 375–376
reading data conditionally 369–371
reading data from multiple files using FILENAME statement 366
reading external filenames from data files 366–367
reading external files 363
reading multiple lines of data 367–369
reading portions of raw data files 365
reading short data lines 362–363
trailing @ sign 373
using relative column pointers 374
variable lists 373–374
alignment parameter 133
ALL keyword 303–304
ampersand (&) 38, 425–426
analysis variables, combining with CLASS statements in tables 306–307
AND operator 93–94
ANYALNUM function 192–193
ANYALPHA function 192–193
ANYDIGIT function 192–193
ANYPUNCT function 192–193
ANYSPACE function 192–193
apostrophe (') 46
APPEND procedure 391
arrays
about 205
changing bounds 210
converting character values to propcase 208–209
loading initial values of temporary 211–212
multidimensional 212–215
problems 215–216
setting values 206–208
temporary 210–211
using to create new variables 209–210
ARRAY statement 206, 207, 209–210, 213
assignment statement 17
asterisk (*) 17, 294, 302–303, 366
at (@) sign 33, 110, 167, 380
attributes, of permanent data sets 64–66
AUTONAME option 268–269, 276
B
bar charts 337–340
BARWIDTH= option 338
basics, problems 8
BINWITH= option 347
blanks, reading data values separated by 26–27
Boolean logic 93–94
bounds, array 210
box plots
generating simple 347–348
generating with grouping variables 348–349
breaks, report 248–251
BREAK statement 248–251
BY statement 142–143, 145–147, 151–152, 230–233, 263–264, 266, 269–270, 415
BY SUBJECT statement 407–408
C
CALL SORTN function 177–179
CARDS statement 30
CATALOG procedure 380
CAT function 184–185
CATS function 184–185, 399, 400, 459
CATX function 184–185
CEIL function 161–162, 172
CENTER option 242
character data, reading 382–384
character functions
about 181
changing case of characters 182–183
data cleaning with NOT functions 193–194
dividing strings into words 196–197
extracting parts of strings 194–195
joining strings 184–185
performing fuzzy matches 197–198
problems 201–204
removing characters from strings 183–184, 186–188
removing leading/trailing blanks 185–186
searching for character classes 192–193
searching for individual characters 190–191
substituting strings or words 199–201
characters
searching for characters 189–190
searching for words in strings 191–192
character values, determining length of 182
CHART procedure 337–340
charts and graphs
about 337
adding confidence limits to plots 342–343
adding regression lines to plots 342–343
creating bar charts 337–340
creating box plots with grouping variables 348–349
creating histograms 346–347
creating scatter plots 341–342
creating simple box plots 347–348
creating smooth curves 345–346
creating time series plots 343–344
displaying statistics for response variables 340–341
overlays 349–350
problems 351–356
transparency 349–350
CHARTYPE procedure 272–273, 274, 276
CLASS statement 60, 264–266, 270–275, 300–301, 306–307, 316, 396–397
CLI option 342–343
CLM option 342–343
CNTLIN= option, FORMAT procedure 386–390, 387–388, 392
CNTLOUT= option, FORMAT procedure 390–392
colon delimiters 29
colon notation 92
column indices 212
column percentages 310–311, 313
column pointers 33, 374
columns
See variables
COLUMN statement 239, 243–245, 247, 251–252, 254–256
commas, reading data values separated by 27–28
comment statements 17, 18
COMPBL function 183
COMPRESS function 153–154, 183–184, 186–188, 189–190, 459
COMPUTE blocks 253–254
COMPUTE statement 253, 254
concatenation
of data sets 140
in TABULATE procedure 301–302
concatenation operator (|| or !!) 184
conditional processing
about 87
Boolean logic 93–94
ELSE IF statement 87–90
IF statement 87–90
multiple OR operators 94–95
NOT operator 93–94
AND operator 93–94
IN operator 91–92
OR operator 93–94
problems 96–97
subsetting IF statement 90–91
using SELECT statements for logical tests 92–93
WHERE operator 96
WHERE statement 95
confidence limits, adding to plots 342–343
CONSTANT function 168
constants
computing 168
dates 125–126
CONTENTS procedure 45–48, 51, 64–66, 75, 80, 83, 126–127, 143, 341–342
CONTINUE statement 116–117, 405
CSV files, reading data values separated by 27–28
curly brackets ({}) 206
customized reports
See reports
D
data
See also raw data
about 219, 261
adding BY statements to MEANS procedure 263–264
adding footnotes to listings 224–226
adding number of observations to listings 234
adding subtotals to listings 230–232
adding titles to listings 224–226
adding totals to listings 230–232
applying formats to CLASS variables 265–266
basics 219–220
changing appearance of listings 220–222
changing appearance of values 222
changing listing order 226–228
controlling observations in listings 223–224
creating summary data sets using MEANS procedure 266–267
delimited 19
displaying 219–236
getting into SAS 4
labeling column headings 229–230
listing first n observations to data sets 234–235
making listings easier to read 233
MEANS procedure 261–263
naming variables in output data sets 268–269
outputting descriptive statistics with MEANS procedure 267–268
outputting summary data sets using CLASS statement 270–271
outputting summary data sets with BY statement 269–270
printing combinations of class variables 276–277
problems 235–236, 278–279
reading conditionally 369–371
reading from multiple files 366
reading multiple lines of 367–369
selecting different statistics for each variable 276
sorting by multiple variables 228–229
BY statement compared with CLASS statement 266
summarizing 261–279
using CLASS statement with MEANS procedure 264–265
using two CLASS variables with MEANS procedure 271–275
data cleaning, with NOT functions 193–194
data lines, reading short 362–363
DATALINES statement 30, 90, 214, 367, 456–457
DATA_NULL_ 53–54
DATA= option 172
Data portion, of permanent data sets 51–52
data sets
See also permanent data sets
about 137, 403
adding observations to 139–142
combining detail and summary data 143–144
concatenating 446–449
controlling observations in merged 147–149
converting Excel spreadsheets to using SAS Output Delivery System 79–80
converting with multiple observations 406, 408–409
converting with one observation 403–405, 407–408
creating Excel spreadsheets from 76–78
creating multiple in one DATA step 139
creating user-defined formats with 386–390
descriptor portion of 18
interleaving 142–143
IN= variables 149–150
listing first n observations to 234–235
many-to-many merges 154–156
merging two 144–146
merging with different BY variable data types 152–154
merging with different BY variable names 151–154
naming variables in output 268–269
omitting BY statement in merges 146–147
one-to-many merges 154–156
one-to-one merges 154–156
problems 158–159, 409–411
restructuring 403–411
sending output to 333–335
subsetting 137–139
summary 266–267, 269–271
updating master files from transaction files 156–157
when do they end 150–151
DATASETS procedure 75
DATA statement 43–44, 139
DATA steps
converting data sets with multiple observations 406
converting data sets with one observation 403–405
creating multiple data sets in one 139
defined 5
using data steps as input to 52–53
using FORMAT statement in 36
data types 7
data values
reading separated by blanks 26–27
reading separated by commas (CSV files) 27–28
reading separated by delimiters 29
DATE function 126
dates
about 121
computing current 126
computing number of years between two 124–125
constants 125–126
creating from Month, Day, and Year values 127–128
extracting Day of the Week, Day of the Month, Month, and Year 126–127
interval functions 129–134
problems 134–136
reading values of from text data 122–124
storing 121–122
substituting 128–129
DAY function 126–127
DEFINE statement 240–241, 242, 245–246, 249, 251–252, 267
DELETE statement 101, 373, 405
delimited data 19
DELIMITER= option 29
delimiters
embedded 37–38
reading data values separated by 29
DENSITY statement 346–347
descriptive statistics
outputting with MEANS procedure 267–268
producing 304–306
descriptive statistics functions 164–166
Descriptor portion
of data sets 18
of permanent data sets 45–47
viewing using point-and-click approach 48–51
detail reports 240–241
DIF function 174–177
DLM= option 29
DO groups 99–101
dollar sign ($) 10, 26, 380
DO loop 106–111, 169, 207, 209, 405
DO statement 100–101
double asterisk (**) 17
double dash (--) 126–127
double @ sign 373
double trailing @ 167
DO UNTIL statement 112–115, 115–116, 367
DO WHILE statement 112–115
DROP= option 138, 408, 417
E
EBCDIC files 29
EDA (exploratory data analysis) 347
ELSE IF statement 87–90, 149
embedded delimiters, using list inputs with 37–38
ENDCOMP statement 253, 254
END= option 364–365, 366, 391
END statement 100–101, 107, 115
engines, reading Excel spreadsheets with 78–79
Excel spreadsheets
about 71
converting data sets to using SAS Output Delivery System 79–80
converting to data sets using Import Wizard 71–75
creating from data sets 76–78
problems 84–85
reading with engines 78–79
EXCLUDE statement 68
EXP function 167–168
exploratory data analysis (EDA) 347
EXPORT procedure 78
external filenames, reading from data files 366–367
external files
reading raw data from 25–41, 363
specifying with alternative methods 28
F
FILENAME statement 28, 366–367
FILE= option, HTML statement 326
FILE PRINT statement 364–365
files
detecting ends of 364–365
reading data from multiple 366
FILE statement 54
FILEVAR option, INFILE statement 367
FINDC function 190–191
FIND function 189–190, 190–191, 191–192
FINDW function 191–192
FIRSTOBS= option 75, 235, 365
fixed columns, reading raw data from 31–35
FLOW option, REPORT procedure 242–243
FMTLIB option 67–68, 380, 387, 392, 400
FMTSEARCH statement 65–67
footnotes, adding to listings 224–226
FOOTNOTE statement 224–226
FORMAT= option 301–302
FORMAT procedure 58–61, 64, 68, 311, 380–382, 386–390, 393–395, 399, 400
CNTLIN= option 386–390, 392
CNTLOUT= option 390–392
FMTLIB option 67–68
formats
See also user-defined formats
accessing with permanent data sets 66–67
applying to CLASS variables 265–266
displaying definitions for 67–68
enhancing outputs using 58–61
problems 68–69
ranges for 63
regrouping values using 61–62
storing in format library 64
using to group values 288–289
using to label outputs 286–287
using within formats 392–394
FORMAT statement 34, 36, 58–61, 62, 64–66, 107, 123, 222, 229–230, 265–266
forward slash (/) 17, 369
FREQ procedure
about 11, 13, 60, 62, 281–284, 329
changing order of values in 292–294
counting number of visits with 416–418
displaying missing values in frequency tables 290–291
grouping values with 289–290
producing three-way tables 296–297
producing two-way tables 294–295
selecting variables for 284–286
user-defined formats and 377
using formats to group values 288–289
frequencies
about 281
changing sort order of values in FREQ procedure 292–294
counting 281–284
displaying missing values in frequency tables 290–291
grouping values with FREQ procedure 289–290
problems 297–298
producing three-way tables 296–297
producing two-way tables 294–295
requesting multiple two-way tables 295–296
selecting variables for FREQ procedure 284–286
using formats to group values 288–289
using formats to label outputs 286–287
frequency tables, displaying missing values in 290–291
from-string 199–200
FULL JOIN 444–446
functions
See also numeric functions; specific functions
character 181–188, 190–204
summary 449–450
fuzzy matching 197–198, 451–452
G
GCHART procedure 337
global statements 5, 10
GPLOT procedure 337
graphs
See charts and graphs
GROUPDISPLAY=CLUSTER option 340
GROUP= option 339–340, 348–349
H
hashtag (#) 368
Haworth, Lauren E.
PROC TABULATE By Example 299
HBAR statement 338, 340–341
HBOX statement 347–349
HEADLINE option, REPORT procedure 244
hexadecimal constants 29
histograms, generating 346–347
HISTOGRAM statement 346–347
HTML files, sending SAS output to 325–326
HTML statement 326
HTML style, selecting different 328
I
ID statement 61, 221–222, 233, 408–409
IF statement 87–90, 90–91, 100
IF-THEN-ELSE statement 393
IMPORT procedure 74
Import utility (SAS Studio) 80–83
Import Wizard, converting spreadsheets to data sets using 71–75
INDEX function 190
INFILE option 30, 361, 363, 365
INFILE statement 10, 12, 18, 26, 28, 29, 54, 71, 122, 362–367
infinite loop 115
informat lists 373–374
informat modifier 36
informats, using with list input 36
INFORMAT statement 37
IN operator 91–92
IN= option 147–150
input buffer 18
INPUT function 153–154, 172–174, 189–190, 195, 381–385, 394, 398
INPUTN function 398–401
INPUT statement 10, 18, 20, 26, 28, 31–32, 36–38, 52, 71, 110, 167–168, 212, 362–363, 368, 371, 373, 374, 456–457
INPUT techniques
See advanced INPUT techniques
INTCK function 129–134
INT function 161–162
INTNX function 129–134
INVALUE statement 380–382, 399
iterative processing
about 99
CONTINUE statement 116–117
DO groups 99–101
DO loop 106–109, 110–111
DO UNTIL statement 112–115, 115–116
DO WHILE statement 112–115
LEAVE statement 116–117
problems 117–120
SUM statement 101–105
J
job control language (JCL) statement 18
JUST option 381
K
KEEP= option 138, 139
KEEP statement 138, 139, 405
KEYLABEL statement 308–309, 311, 313
keyword parameters 429–431
L
labels
adding to variables 57–58
problems 68–69
LABEL statement 58, 64–66, 229–230, 234
LAG function 174–177, 343–344, 418–419, 420
LAG2 function 343–344
LARGEST function 165, 178
LEAVE statement 116–117
LEFT function 185–186, 200
LEFT JOIN 444–446
LEFT option 242
LENGTHN function 182
LENGTH statement 110, 141, 168, 195, 196, 200, 391
less than (<) sign 63
%LET statement 427
LIBNAME statement 43–44, 47, 49, 68, 74, 78–79
list input
defined 19, 25
specifying missing values with 27
supplying INFORMAT statement with 37
using informats with 36
using with embedded delimiters 37–38
LOESS statement 346
LOG function 167–168
logical tests, using SELECT statement for 92–93
Log window 16
longitudinal data 413
looping
See iterative processing
LOWCASE function 183, 198
LRECL= option 363
M
macros
about 425
built-in macro variables 426
demonstrating 427–429
keyword parameters 429–431
macro variables 425–426
positional parameters 429–431
problems 435–436
tokens 431–432
using macro variables as prefixes 432–433
using macro variables to transfer values 433–435
%MACRO statement 427–429
macro variables
about 425–426
assigning values to 427
using as prefixes 432–433
using to transfer value 433–435
many-to-many merges 154–156
master files, updating from transaction files 156–157
mathematical functions 167–168
MAX function 165
MDY function 127–128
MEAN Function 53, 164
MEANS procedure 11, 13, 60, 78–79, 143–144, 261–268, 271–277, 325–326, 377, 395, 434, 449–450
%MEND macro 427–429
MERGE statement 145–146, 155
METHOD= option 172
MIN function 165
MISSING function 89, 101, 128–129, 405
MISSING option, TABLES statement 290–291, 317
missing values
displaying in frequency tables 290–291
effect on TABULATE procedure of 315–318
handling 360–361
numeric functions for 163
specifying with list input 27
MISSOVER option 361, 363
MISSTEXT= option 317, 397
MLF option, CLASS statement 395
MONTH function 126–127
MPRINT option 428–429
multi-column reports 247–248
multidimensional arrays 212–215
multilabel formats 394–397
MULTILABEL option, VALUE statement 394–397
multi-level sort 228–229
N
names 6
NBINS= option 347
nesting 18, 302–303
N function 164
NMISS function 165
NOCENTER option 13
NOCOL option, TABLE statement 296–297
NOCUM option, TABLES statement 284–285
NODS option, CONTENTS procedure 48
NOFILL option 338
NOOBS option, PRINT procedure 222
NOPERCENT option, TABLES statement 286, 296–297
NOPRINT option 251–252, 261, 267, 333
NOPROCTITLE option 11
NOROW option, TABLE statement 296–297
NOTFIGIT function 193–194
NOT functions, data cleaning with 193–194
NOT operator 93–94
numeric data, reading 382–384
numeric functions
about 161
CEIL function 161–162
computing constants 168
computing sums within observations 166
descriptive statistics functions 164–166
generating random numbers 168–172
INT function 161–162
mathematical functions 167–168
for missing values 163
problems 179–180
ROUND function 161–162
setting character and numeric values to missing 163–164
sorting within observations 177–179
special functions 172–174
that return values from previous observations 174–177
numeric variables, computing percentages on 314
NWAY Option 270–271, 273
O
observations
adding number of to listings 234
adding to data sets 139–142
computing differences between 418–419
computing differences between first/last using LAG function 420
computing differences between first/last using RETAIN statement 421
computing sums within 166
controlling in listings 223–224
controlling in merged data sets 147–149
converting data sets with multiple 406, 408–409
converting data sets with one 403–405, 407–408
creating multiple 372–373
defined 4, 16
identifying first/last 413–416
n 234–235
numeric functions that return values from previous 174–177
problems 423–424
sorting within 177–179
working with multiple 413–424
OBS= option 75, 365
ODS
See Output Delivery System (ODS)
ODS CLOSE statement 79
ODS EXCLUDE statement 329
ODS HTML statement 326
ODS SELECT statement 329
ODS TRACE OFF statement 330
ODS TRACE ON statement 330
one-to-many merges 154–156
one-to-one merges 154–156
options
See specific options
ORDER clause 450
ORDER= option, FREQ procedure 292–294
ORDER usage, applying to two variables 246–247
OR operator 93–95
otherwise-expression 92
OTHERWISE statement 92
OUT= option 172, 227–228
Output Delivery System (ODS)
about 325
converting Excel spreadsheets to data sets using 79–80
creating Table of Contents 327–328
excluding portions of SAS output 329–333
problems 335
selecting destinations 329
selecting different HTML style 328
selecting portions of SAS output 329–333
sending output to data sets 333–335
sending SAS output to HTML files 325–326
OUTPUT option 143–144, 268–269
OUTPUT statement 20, 106, 107, 116–117, 139, 169, 267, 333–335
overlays 349–350
P
PAD option, INFILE statement 362–363
PAGEBY statement 231
PANELS= option, REPORT procedure 247–248
parentheses (()) 206
PATH= option, HTML statement 326
PBSPLINE statement 345–346
percentages
computing on numeric variables 314
displaying in two-dimensional tables 312
percent sign (%) 425–426
Perl regular expressions
about 455
checking for valid zip codes 457–458
problems 461–462
PRXPARSE function 460–461
syntax of 455–456
testing Social Security numbers 456–457
verifying phone numbers 458–459
permanent data sets
about 43
accessing with user-defined formats 66–67
attributes of 64–66
examining Descriptor portion of using CONTENTS procedure 45–47
LIBNAME statement 43–44
listing in SAS libraries using CONTENTS procedure 48
problems 55
reason for creating 45
using as input to DATA steps 52–53
viewing Data portion using PRINT procedure 51–52
PERSIST option 333
plus sign (+) 374
point-and-click approach, viewing Descriptor portion of data sets using 48–51
positional parameters 429–431
POSITION option, CONTENTS procedure 47
PREFIX= option 408–409
PRELOADFMT option, CLASS statement 396–397
PRINTALLTYPES option, MEANS procedure 276–277
PRINTMISS 397
PRINT procedure 26–27, 34, 37, 51–52, 60, 61, 74, 79, 123, 219–220, 222, 226–235, 237–239, 245–246, 268, 274, 325–326, 368–369
PRINTTO procedure 333–335
problems
advanced INPUT techniques 375–376
arrays 215–216
basics 8
character functions 201–204
charts and graphs 351–356
conditional processing 96–97
data 235–236, 278–279
data sets 158–159, 409–411
dates 134–136
Excel spreadsheets 84–85
formats 68–69
frequencies 297–298
iterative processing 117–120
labels 68–69
macros 435–436
numeric functions 179–180
observations 423–424
Output Delivery System (ODS) 335
Perl regular expressions 461–462
permanent data sets 55
programming basics 21–22
raw data 38–41
reports 256–260
structured query language (SQL) 452–454
tabular reports 318–323
user-defined formats 401–402
processing
See conditional processing
See iterative processing
PROC steps 5
PROC TABULATE By Example (Haworth) 299
Program Data Vector (PDV) 138
programming basics 21–22
programs, enhancing 16–18
PROPCASE function 183, 184, 198
PRX function 456
PRXMATCH function 456–457
PRXPARSE function 460–461
PUTC function 400
PUT function 153, 172–174, 379, 385, 394
PUTN function 400
PUT statement 53–54, 148, 364–365, 415
Q
question mark (?) 207
quotation marks 46
R
RAND function 168–172
random numbers generating 168–172
raw data
loading initial values of temporary arrays from 211–212
problems 38–41
reading 9–22
reading from external files 25–41
reading from fixed columns 31–35
reading portions of files of 365
RBREAK statement 248–251
regression lines, adding to plots 342–343
RENAME= option 151–152, 173, 387, 408, 417
RENAME statement 274
REPORT procedure 54, 235, 237–241, 245–248, 251–255, 334–335
reports
See also tabular reports
about 237–238
applying ORDER usage to two variables 246–247
breaks 248–251
changing order of rows in 245–246
changing order of variables in COLUMN statement 244–245
comparing detail and summary 240–241
computing character variables in COMPUTE blocks 253–254
computing variables with REPORT procedure 252–253
creating 9–22
creating ACROSS variables with REPORT procedure 254–255
FLOW option, REPORT procedure 242–243
multi-column 247–248
problems 256–260
selecting variables to include in 239
summary 241–242
using ACROSS usage to display statistics 255–256
using nonprinting variables to order reports 251–252
using REPORT procedure 238–239
using two grouping variables 243–244
RESPONSE= option, HBAR statement 340–341
response variables, displaying statistics for 340–341
retained variables 52
RETAIN statement 102–105, 387, 406, 421
RIGHT JOIN 444–446
RIGHT option 242
ROUND function 125, 161–162
row indices 212
rows
See also observations
changing order of in reports 245–246
computing percentages 310–311
RTS= option, TABLE statement 312
RUN statement 10, 20
S
SAS
about 3
data types 7
getting data into 4
how it works 18–20
names 6
sample program 4–6
website 3, 8
writing programs 9–22
SAS Enterprise Guide 7
SAS Help Center (website) 311, 398
SAS libraries 43–44, 48
SAS Studio
about 7
Import utility 80–83
SAS University Edition 7
SASWindowing Environment 7
SCAN function 196–197, 251–252
scatter plots, creating 341–342
SCATTER statement 341–342, 342–343
select-expression 92–93
SELECT statement 68, 92–93, 391, 392, 400
SERIES statement 343–344
SET statement 52, 138–143, 144, 151, 200, 207, 208, 414, 434, 446–447
SGPLOT procedure 109, 130–134, 337–340, 343–346, 349–350
slash (/) 340
slash star (/*) 18
SMALLEST function 166
smooth curves, generating 345–346
SMOOTH option, PBSPLINE statement 345–346
SORT procedure 143, 226–229, 245–246
special functions 172–174
SPEDIS function 197–198, 451–452
spelling distance 197–198
spreadsheets
See Excel spreadsheets
SQL procedure 437
See also structured query language (SQL)
SQRT function 167–168
square brackets ([]) 206
star slash (*/) 18
statements
See also specific statements
assignment 17
comment 17, 18
global 5, 10
statistics
displaying 255–256
selecting different for each variable 276
strings
defined 191
dividing into words 196–197
extracting parts of 194–195
joining 184–185
removing characters from 186–188
searching for words in 191–192
substituting 199–201
STRIP function 185–186
structured query language (SQL)
about 437
basics 437–439
concatenating data sets 446–449
FULL JOIN 444–446
fuzzy matching 451–452
joining two tables 439–444
LEFT JOIN 444–446
ORDER clause 450
problems 452–454
RIGHT JOIN 444–446
summary functions 449–450
style comments, nesting 18
subscript 207
subsetting
data sets 137–139
IF statement 90–91
SUBSTR function 194–195, 459
subtotals, adding to listings 230–232
SUM function 165, 166
SUMMARIZE option 249, 250
summary data sets 266–267, 269–271
summary functions 449–450
SUMMARY procedure 267, 395
See also MEANS procedure
summary reports 240–241, 241–242
SUM statement 101–106, 230–232, 364–365
SUPPRESS option 250–251
SURVEYSELECT procedure 172
syntax, of Perl regular expressions 455–456
&SYSDATE9 macro 426
&SYSTIME macro 426
T
table lookups, performing 384–385, 398–401
Table of Contents, creating 327–328
tables
combining CLASS statement and analysis variables in 306–307
customizing 307–309
demonstrating more complex 309–310
joining two 439–444
two-dimensional 312
TABLE(S) statement 11, 62, 284–286, 290–291, 294–297, 300–303, 309, 312, 317
tabular reports
about 299–300
ALL keyword 303–304
combining CLASS and analysis variables in tables 306–307
computing column percentages 313
computing percentages on numeric variables 314
computing row and column percentages 310–311
customizing tables 307–309
demonstrating more complex tables 309–310
displaying percentages in two-dimensional tables 312
effect of missing values on TABULATE procedure output 315–318
problems 318–323
producing descriptive statistics 304–306
TABULATE procedure operators 301–303
TABULATE procedure table 300–301
TABULATE procedure
about 256, 263, 299–300, 395, 396
ALL keyword 303–304
combining CLASS statement and analysis variables in tables 306–307
computing column percentages 313
computing percentages on numeric variables 314
customizing tables 307–309
demonstrating more complex tables 309–310
effect of missing values on 315–318
operators 301–303
producing descriptive statistics 304–306
simple table 300–301
temporary arrays 210–212
three-way tables 296–297
time series plots, generating 343–344
titles, adding to listings 224–226
TITLE statement 10, 13, 46, 224–226, 426
TODAY function 126
tokens 431–432
to-string 199–200
totals, adding to listings 230–232
trailing @ sign 369–371, 373
TRANSLATE function 199–201, 214
transparency 349–350
TRANSPOSE procedure
See also data sets
converting data sets with multiple observations 408–409
converting data sets with one observation 407–408
TRANWRD function 199–201
TRIMN function 185–186, 194
TRUNCOVER option 122, 363
TTEST procedure 333–335
two-dimensional tables, displaying percentages in 312
two-way tables 294–296
TYPE=KERNEL option 346–347
U
underscore (_) 6, 75
UNIVARIATE procedure 329
UPCASE function 198
UPCASE option 381, 383–384, 399
UPDATE statement 156
user-defined formats
about 377
creating variables 379
creating with data sets 386–390
maintaining 390–392
multilabel formats 394–397
problems 401–402
reading character data 382–384
reading numeric data 382–384
updating 390–392
using formats within formats 392–394
using INPUTN function 398–401
using to perform table lookups 384–385
using to recode variables 377–378
using with PUT function 379
user-defined informats
creating 380–382
using to perform table lookups 384–385
V
VALIDVARNAME option 78
values
See also missing values
assigning to macro variables 427
changing appearance of 222
changing order of in FREQ procedure 292–294
grouping with FREQ procedure 289–290
loading initial, of temporary arrays 211–212
reading of dates 122–124
regrouping using formats 61–62
remembering previous 422
setting 206–208
using formats to group 288–289
using macro variables to transfer 433–435
VALUE statement 59, 63, 394–397
variable lists 373–374
variable names 10
variables
See also specific variables
ACROSS 254–255
adding labels to 57–58
analysis 306–307
applying ORDER usage to two 246–247
built-in macro 426
changing order of in COLUMN statement 244–245
character 253–254
CLASS 271–275
computing with REPORT procedure 252–253
creating box plots with grouping 348–349
creating using arrays 209–210, 379
defined 4, 16
grouping 243–244
naming in output data set 268–269
nonprinting 251–252
printing combinations of 276–277
response 340–341
retained 422
selecting different statistics for each 276
selecting for FREQ procedure 284–286
selecting to include in reports 239
sorting by multiple 228–229
using user-defined formats to recode 377–378
VARNUM option, CONTENTS procedure 47, 51, 126–127
VAR statement 11, 61, 126–127, 143–144, 220–222, 268–269, 300–301, 304–306
VBAR statement 338, 340
VBOX statement 347–348, 348–349
W
websites
Cody, Ron 10
SAS 3, 8
SAS Help Center 311, 398
WEEKDAY function 126–127
when-expression 92
WHERE operator 96
WHERE statement 91, 95, 137–138, 223–224, 334–335
Y
YEARCUTOFF option 124
YRDIF function 124–125