Question

data _null_;
    put "hello world"; 
 run;

will print hello world to the console.

but

data _null_;
put 1; 
run; 

gives me

Encountered " "put" "put "" at line 2, column 1.
Was expecting one of:
<EOF> 
";" ...
"*" ...
"data" ...
"proc" ...
(and 41 more)"
Was it helpful?

Solution

data _null_;
put "1";
run;

You put text to the console. Therefore, "1" and 1 are identical, practically speaking. You cannot put unformatted numbers, only formatted (ie, text). Even putting a numeric variable would work that way:

data _null_;
x=1;
put x;
run;

That actually puts the number 1 formatted with BEST1. format (you can override the format if you choose).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top