BookmarkSubscribeRSS Feed
ballardw
Super User

@CathyVI wrote:

@PaigeMiller @ballardw  Thank you for sharing your knowledge. This means alot to me as I continue to learn SAS. Two last question please.

1. How do I learn data manipulation? Is there any book/material you can recommend.

The first step in anything related to programming, at least in my sometimes humble opinion: Clearly define the manipulation. 

 

I often find that when I don't get desired or expected results from code it is because I did not state clearly enough what the output would be and identify which step handles which requirement.

 

Let's look at your second question about the column headings.

When you looked @PaigeMiller's Column statement did you consider how the text "Active" is placed about the count and percent? or "Reserve"?

 

Let's see this:

proc report data=test2;
    columns serv table ("Component" ("Active" active active_pct) ("Reserve" reserve reserve_pct));
    define serv/group "Serv";
    define table/group "Table";
    define active/'N' format=comma10.0;
    define active_pct/'%' format=percent8.2;
    define reserve/'N' format=comma10.0;
    define reserve_pct/'%' format=percent8.2;
run;

The ( ) on the Columns statement does column heading grouping. Adding an extra layer of () around the Active and Reserve groups places the text Component above those groups.

The appearance was about COLUMN HEADING, not grouping by defines.

 

PaigeMiller
Diamond | Level 26

@CathyVI wrote:

 

1. How do I learn data manipulation? Is there any book/material you can recommend.

 


Also, Maxims of Maximally Efficient SAS Programmers

Especially maxims 10, 12, 14 and 19, and all the rest are important too.

--
Paige Miller

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 16 replies
  • 2216 views
  • 4 likes
  • 3 in conversation