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.
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;
Thankyou wong!!
i tried your code as well still i am unable to create dataset.
throwing warning again 😞
Sorry @Dd07. Please change 'ods listing close' to 'ods listing' instead.
thanks again however no luck!! same warning exist 😞
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;
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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.