- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello All,
I am not sure what is wrong over here howerver my dataset is not creating.its throwing a warning.
.Please help me.
sample code is
data new;
set sashelp.class;
umra=put(age,$2.);
run;
ods listing close;
ods output "One-Way Frequencies"=app;
proc format; value $age
low-<15 = 'child'
16-< 30 = 'adult';
run;
proc freq data=new;
tables _char_;
format umra $age.;
run;
ods output close;
=============================
WARNING: Output ''One-Way Frequencies'' was not created. Make sure that the output object name,
label, or path is spelled correctly. Also, verify that the appropriate procedure
options are used to produce the requested output object. For example, verify that the
NOPRINT option is not used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It should be as below. Please also see the log window on how the ods trace on and off works Thanks.
data new;
set sashelp.class;
umra=put(age,$2.);
run;
ods listing close;
ods trace on;
ods output OneWayFreqs=app;
proc format;
value $age
low-<15 = 'child'
16-< 30 = 'adult';
run;
proc freq data=new; tables _char_; format umra $age.; run;
ods trace off;
ods output close;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thankyou wong!!
i tried your code as well still i am unable to create dataset.
throwing warning again 😞
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Sorry @Dd07. Please change 'ods listing close' to 'ods listing' instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
thanks again however no luck!! same warning exist 😞
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Dd07.
If you are just wanting to find out the frequency distribution of age, then you can just do this. Hope it works for you now. It didn't work because the ods output statement was not in the right order. Thanks.
proc format; value age low-15 = 'child' 16-< 30 = 'adult';run;ods output OneWayFreqs=app;proc freq data=sashelp.class; tables age; format age age.; run;ods output close;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The ODS output statement needs to be before the procedure which creates the object. The proc format does not create objects, hence the onewayfreq is not found. This code should work:
data new; set sashelp.class; umra=put(age,$2.); run; ods listing close; proc format; value $age low-<15 = 'child' 16-< 30 = 'adult'; run; ods trace on; ods output OneWayFreqs=app; proc freq data=new; tables _char_; format umra $age.; run; ods trace off; ods output close;