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

I have data set loaded by CSV files having student marks (Engilish and Hindi )

But now I want to add English and Hindi marks and assign it to Tot variable

 

I tried this below code but its not working

 

Data test;   /* Creating new dataset */

set Student; /* Original data set */

Tot = English + Hindi;

Run;

 

the above code is not working

Kindly help me out on this

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Jagadishkatam
Amethyst | Level 16

Please try below code

 

Data test;   /* Creating new dataset */
set Student; /* Original data set */
Tot = sum(English , Hindi);
Run;
Thanks,
Jag

View solution in original post

4 REPLIES 4
Jagadishkatam
Amethyst | Level 16

Please try below code

 

Data test;   /* Creating new dataset */
set Student; /* Original data set */
Tot = sum(English , Hindi);
Run;
Thanks,
Jag
spsivamca
Calcite | Level 5

Thanks Jag, its working 

Jagadishkatam
Amethyst | Level 16
Could you mark as correct answer if it helped. So that it will helps others
Thanks,
Jag
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Just to note for future, saying something "does not work" does not provide any information.  In this instance, "does not work" means that you have data where one or the other result is missing, when using + a missing in either result means the output will be . (missing).  This does not mean it is not working, but just not working as you expect it to, its all in the documentation.  In this instance the sum() function ignores missing values, and returns either the one number, or the sum of both of them - again per documentation.  

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 4 replies
  • 2191 views
  • 0 likes
  • 3 in conversation