BookmarkSubscribeRSS Feed
Dd07
Fluorite | Level 6

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.

6 REPLIES 6
Miracle
Barite | Level 11

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;

 

Dd07
Fluorite | Level 6

Thankyou wong!!

i tried your code as well still i am unable to create dataset.

throwing warning again 😞

Miracle
Barite | Level 11

Sorry @Dd07. Please change 'ods listing close' to 'ods listing' instead.

Dd07
Fluorite | Level 6

thanks again however no luck!! same warning exist  😞

Miracle
Barite | Level 11

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;

 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 2313 views
  • 0 likes
  • 3 in conversation