BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
zimcom
Pyrite | Level 9
data exex1; set exex;
	if EXWGTMD_DEC = 'Estimated' then 
		do;
			if EXRWGTU_DEC = 'kgs' then WEIGHT_Estimated = EXRWGT;
			else if EXRWGTU_DEC = 'lbs' then WEIGHT_Estimated = EXRWGT*0.45359237;
		end;
	if EXWGTMD_DEC = 'Actual' then 
		do;
			if EXMWGTU_DEC = 'kgs' then WEIGHT_Actual = EXMWGT;
			else if EXMWGTU_DEC = 'lbs' then WEIGHT_Actual = EXMWGT*0.45359237;
		end;
run;
SUBNUMEXRWGTEXRWGTU_DECEXWGTMD_DECEXMWGTEXMWGTU_DEC
0100170.0kgsEstimated72.5kgs
0100286.0kgsEstimated85.1kgs
01003180.0lbsEstimated70.8kgs
0100470.0kgsEstimated61.1kgs
0100565.0kgsEstimated63.5kgs
0100685.0kgsEstimated83.4kgs
0100765.0kgsEstimated84.8kgs
0100860.0kgsEstimated99.9kgs
01009240.0lbsEstimated101.7kgs
0101065.0kgsEstimated66.9kgs
0101160.0kgsEstimated64.8kgs
0101295.0kgsEstimated93.3kgs
1200197.0kgsActual  
1200261.0kgsEstimated68.0kgs
0101375.0kgsEstimated80.0kgs
1200375.0kgsActual  
1200472.0kgsActual  
01014115.0kgsEstimated109.4kgs
28001103.0kgsActual  
0101595.0kgsEstimated105.9kgs
1200589.0kgsActual  
0101675.0kgsEstimated56.5kgs
8800180.0kgsEstimated80.0kgs
0101785.0kgsEstimated70.5kgs
0101880.0kgsEstimated77.0kgs
12006104.0kgsActual  
8800270.0kgsEstimated70.0kgs
28002234.0lbsActual  
1200772.0kgsActual  
1200855.0kgsEstimated44.0kgs
2800389.0kgsActual  
3700172.0kgsActual  
28004111.0kgsActual  
12009107.0lbsActual  
3700259.0kgsActual  
1201086.0kgsActual  
7400180.0kgsEstimated80.0kgs
2800568.0kgsActual  
2800691.0kgsActual  
3700371.0kgsActual  
7400275.0kgsEstimated75.0kgs
2800772.0kgsActual  
1201147.0kgsActual  
1201275.0kgsEstimated63.5kgs
3700481.0kgsEstimated81.0kgs
1400189.0kgsEstimated88.9kgs
0101975.0kgsEstimated54.0kgs
1400277.0kgsActual  
0102070.0kgsEstimated88.3kgs
0102160.0kgsEstimated66.6kgs

 

Given the code and data in above.

Thanks!!

1 ACCEPTED SOLUTION

Accepted Solutions
japelin
Rhodochrosite | Level 12

Isn't it because the value of EXMWGTU_DEC for the observation EXWGTMD_DEC = 'Actual' is empty?

 

japelin_0-1647102574512.png

 

View solution in original post

2 REPLIES 2
japelin
Rhodochrosite | Level 12
The data you are presenting is exex1 or exex?
japelin
Rhodochrosite | Level 12

Isn't it because the value of EXMWGTU_DEC for the observation EXWGTMD_DEC = 'Actual' is empty?

 

japelin_0-1647102574512.png

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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