BookmarkSubscribeRSS Feed
karen8169
Obsidian | Level 7

I want to create a nwe column following the rules.

  1. Under the same COUN, VILL and HOUSE, if the age in the P1_5 is the smallest and in P1_4 is male, we set 1.
  2. Under the same COUN, VILL and HOUSE, if the age in the P1_5 is the smallest and in P1_4 is female, we set 0.
  3. Under the same COUN, VILL and HOUSE, if the age in the P1_5 is the smallest and in P1_4 are twins (both male and female) , we set 3.

How to get the result by using Add A New Computed Column?

2 REPLIES 2
karen8169
Obsidian | Level 7

I want to create a new cloumn to do the same effect. Under the same COUN, VILL and HOUS, I can calculate the mount of male and female in P1_4 using Add A New Computed column.  The picture I attached is made by summary tables (that's the effect I want.) 5.PNG.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Post test data in the form of a datastep!!

 

 

Look at the guidance found when entering a new post.  Show your test data clearly as as datastep - attachments are not recommended as they are a security risk.  Then present your logic between the two.  From the given output it looks like you want a proc report output for this not a dataset, so you can use across variables in the proc report:

http://www2.sas.com/proceedings/forum2008/265-2008.pdf

 

Although as you have not followed the guidance I am just guessing here.

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
  • 2 replies
  • 811 views
  • 0 likes
  • 2 in conversation