BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Zachary
Obsidian | Level 7

I am doing a very basic PROC FREQ such as the following:

proc freq data = SQUADS;

tables SVAR1 * SMNQ_D_POST_CODE

nopercent nocum norow nocol;

run;

The results look very normal:

Capture1.JPG

And it usually looks pretty normal when I paste it into Excel:

Capture2.JPG

If I go to cell A5 (the 1887) then arrow on over to the right the first row of 0 0 5 0 5 lies on row 4 instead of row 5. Yes, this is a trifle in the grand scheme of things, but it is a little annoying.

Is this the result of how I have set up my output to look? I am open to any suggestions. For now I am just cognizant of this when I work between platforms.

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Options and methods vary depending on the version of SAS / Enterprise Guide.

Generally instead of Proc Freq I would look to either Proc Report or Proc Tabulate for similar output as those procedures allow overrides and additional options such as text alignment, weight, font size and host of other appearance options. Or direct the Proc Freq output to a data set and use Proc Print with also allows more appearance controls.

Put I would start with a simple ODS output and see if the results are satisfactory.

View solution in original post

6 REPLIES 6
ballardw
Super User

More the behavior of copy from HTML and paste into Excel in general. What has happened is that in the paste the text vertical alignment is top. The cells are merged vertically so they appear in the wrong row. Options are to manually align the text vertically after pasting or use an approach that doesn't paste but generates a more appropriate Excel formatted document such as ODS tagsets.excelxp.

Zachary
Obsidian | Level 7

Thank you very much. I did a little investigating using the ODS tagsets.excelxp recommendation you provided. I am thinking it probably would be easiest to simply create the output in such a way so that it is .csv.

Is there an option to select in EG that would enable this? Or do I need to go through the processes of downloading the proper program/functionality and write the extra code?

Trying to keep as simple as possible.

Thank you.

ballardw
Super User

Options and methods vary depending on the version of SAS / Enterprise Guide.

Generally instead of Proc Freq I would look to either Proc Report or Proc Tabulate for similar output as those procedures allow overrides and additional options such as text alignment, weight, font size and host of other appearance options. Or direct the Proc Freq output to a data set and use Proc Print with also allows more appearance controls.

Put I would start with a simple ODS output and see if the results are satisfactory.

Zachary
Obsidian | Level 7

Thank you so much!!! I believe it is the former SPSS-er in me that realy wanted proc freq to work. I will try all of those suggestions.

ChrisHemedinger
Community Manager

One more thing you might look at: the LIST option on the TABLES statement.  The output will be cleaner, but oriented differently.

proc freq data=sashelp.cars;
tables origin * type /  nopercent nocum norow nocol LIST;
run;

freq.png

Chris

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
Zachary
Obsidian | Level 7

Thank you for all of the suggestions!

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 3446 views
  • 6 likes
  • 3 in conversation