The SAS Output Delivery System and reporting techniques

ods Output

Reply
Contributor
Posts: 35

ods Output

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.

Regular Contributor
Posts: 226

Re: ods Output

[ Edited ]

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;

 

Contributor
Posts: 35

Re: ods Output

Thankyou wong!!

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

throwing warning again Smiley Sad

Regular Contributor
Posts: 226

Re: ods Output

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

Contributor
Posts: 35

Re: ods Output

thanks again however no luck!! same warning exist  Smiley Sad

Regular Contributor
Posts: 226

Re: ods Output

[ Edited ]

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;

 

Super User
Super User
Posts: 7,720

Re: ods Output

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;
Ask a Question
Discussion stats
  • 6 replies
  • 547 views
  • 0 likes
  • 3 in conversation