Hi, a simple program:
data pets;
input breed $ type $ number;
datatlines;
York A 3
GR A 4
York B 38
Puddle A 2
;
RUN;
proc print data = pets;
vartype breed;
sum number;
run;
two questions:
1. proc print only displays SOME variables, below is the output (see the difference). When I erase the line with VARTYPE, displays all variables.
- output when VARTYPE used in proc print
York | 3 |
GR | 4 |
York | 38 |
Puddle | 2 |
- output when VARTYPE not used in proc print
York | A | 3 |
GR | A | 4 |
York | B | 38 |
Puddle | A | 2 |
2. What does VARTYPE do? I know this would display the 'type' of variable breed, as a character, but what meaning does it have, when declared inside PROC PRINT? so far, from the output, there is no information on the type of variable 'breed'. (as you can see from the table (output) above)
Neither I, now the PROC PRINT SAS Documentation has heard of a VARTYPE Statement in PROC PRINT. What does your log say? When I run this
proc print data=sashelp.class;
vartype sex;
sum height;
run;
my log gives me the warning: "WARNING 1-322: Assuming the symbol VAR was misspelled as vartype.". I suspect this is also the case here, so use the VAR Statement instead.
Neither I, now the PROC PRINT SAS Documentation has heard of a VARTYPE Statement in PROC PRINT. What does your log say? When I run this
proc print data=sashelp.class;
vartype sex;
sum height;
run;
my log gives me the warning: "WARNING 1-322: Assuming the symbol VAR was misspelled as vartype.". I suspect this is also the case here, so use the VAR Statement instead.
Glad to be at service 🙂
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.