BookmarkSubscribeRSS Feed
student_a123
Calcite | Level 5

I have a problem with the output of proc freq. I probably changed its base format somehow, how can I return it?

No I see outpt like this:

 
alicja123_0-1651855856153.png

 

But i want to see it like in base format with all descriptions and additional information box:

alicja123_1-1651856116202.png

 

 

Thank you in advance for your help!

 

9 REPLIES 9
student_a123
Calcite | Level 5

I have a problem with the output of proc freq. I probably changed its base format somehow, how can I return it?

No I see outpt like this:

 

alicja123_1-1651854948761.png

But i want to see it like in base format with all descriptions.

 

Thank you in advance for your help!

 

PaigeMiller
Diamond | Level 26

I don't know what you mean by "Base format". Please show us an example.

--
Paige Miller
Reeza
Super User

Is this using SAS Visual Analytics or SAS Studio? You've posted this question under VA.

 

Assuming this is the same question?

https://stackoverflow.com/questions/72102639/i-dont-see-an-explanatory-legend-in-sas-proc-freq?nored...

student_a123
Calcite | Level 5
Yes, in which forum should I ask this question
Reeza
Super User

@student_a123 wrote:
Yes, in which forum should I ask this question

Yes doesn't indicate if it's SAS Visual Analytics or SAS Studio. 

They are different tools.

 

And if its Studio, the answer will be the same as on Stack Overflow.

 

SASJedi
SAS Super FREQ

Best forum for this type fo question is probably the SAS Programming forum unless you are using a point-and-click tool...

Check out my Jedi SAS Tricks for SAS Users
SASJedi
SAS Super FREQ

Not sure what you are trying to get as output. For example, this output looks similar to what you are getting:

data have;
  call streaminit(12345);
  do id=1 to 100;
     flag1=rand('integer',0,1);
     flag2=rand('integer',0,1);
     output;
  end;
run;

proc freq data=have;
   tables flag1*flag2;
run;
Table of flag1 by flag2
flag1 flag2
0 1 Total
0
16
16.00
38.10
36.36
26
26.00
61.90
46.43
42
42.00
 
 
1
28
28.00
48.28
63.64
30
30.00
51.72
53.57
58
58.00
 
 
Total
44
44.00
56
56.00
100
100.00

 

If the values 1 and 0 represent something that you want to be reflected in the report, you might create a custom format and apply the format in proc freq:

proc format;
 value flag 0='False' 
            1='True' 
            .='Missing' 
        other='Miscoded'
  ;
run;

proc freq data=have;
   tables flag1*flag2;
   format flag1 flag2 flag.;
run;

This changes the values in the output like this:

Table of flag1 by flag2
flag1 flag2
False True Total
False
16
16.00
38.10
36.36
26
26.00
61.90
46.43
42
42.00
 
 
True
28
28.00
48.28
63.64
30
30.00
51.72
53.57
58
58.00
 
 
Total
44
44.00
56
56.00
100
100.00
Check out my Jedi SAS Tricks for SAS Users
Reeza
Super User

I've merged your posts and moved them to the ODS REPORTS forum as that's the most appropriate. You should include the image from SO as well, the second one that shows what you actually want. 

Reeza
Super User

If you edit your posts, no one see's that. You need to reply to the post. 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 9 replies
  • 599 views
  • 4 likes
  • 4 in conversation