- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
Could you please explain what
put (_all_) (+0);
means in the code:
data _null_;
file 'cars_noheader.csv' dsd ;
set sashelp.cars;
put (_all_) (+0);
run;
Thank you!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
_all_ is a keyword that gives you all variables present in the PDV.
If you use _all_ without anything else, you get a list including automatic variables in this form:
Make=Acura Model=MDX Type=SUV Origin=Asia DriveTrain=All MSRP=$36,945 Invoice=$33,337 EngineSize=3.5 Cylinders=6 Horsepower=265 MPG_City=17 MPG_Highway=23 Weight=4451 Wheelbase=106 Length=189 _ERROR_=0 _N_=1
If you add the "pseudo-format-specification-with-pointer-control" +0 to all the variables (that's why you need the brackets), you get this:
Acura MDX SUV Asia All $36,945 $33,337 3.5 6 265 17 23 4451 106 189
I got this by applying Maxim 4 and running this code:
data _null_;
set sashelp.cars (obs=1);
put (_all_) (+0);
run;
data _null_;
set sashelp.cars (obs=1);
put _all_;
run;
and inspecting the log.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
_all_ is a keyword that gives you all variables present in the PDV.
If you use _all_ without anything else, you get a list including automatic variables in this form:
Make=Acura Model=MDX Type=SUV Origin=Asia DriveTrain=All MSRP=$36,945 Invoice=$33,337 EngineSize=3.5 Cylinders=6 Horsepower=265 MPG_City=17 MPG_Highway=23 Weight=4451 Wheelbase=106 Length=189 _ERROR_=0 _N_=1
If you add the "pseudo-format-specification-with-pointer-control" +0 to all the variables (that's why you need the brackets), you get this:
Acura MDX SUV Asia All $36,945 $33,337 3.5 6 265 17 23 4451 106 189
I got this by applying Maxim 4 and running this code:
data _null_;
set sashelp.cars (obs=1);
put (_all_) (+0);
run;
data _null_;
set sashelp.cars (obs=1);
put _all_;
run;
and inspecting the log.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the quick response and the explanations! It is very useful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have to say that I could not find a specific reference to the behaviour of _all_ with the modifier in the documentation of PUT. Only the named list output of _all_ without the modifier is documented.