BookmarkSubscribeRSS Feed
Vish33
Lapis Lazuli | Level 10


Hi,

I have an excel sheet with calculations which needs to be implemented through SAS to automate the report. Please find the attchment for the sample excel sheet. I want to get the field2 values as shown in the excel template using sas code. For example field2 first value is getting generated by calculating column values i.e. (C10+D11+E12+F13+G14+H15+I16+J17+K18+L19+M20+N21). So i want to implement these calculations using sas. Can anyone suggest on this.

Thanks.

2 REPLIES 2
ArtC
Rhodochrosite | Level 12

It sounds like you want to embed the formula into the worksheet so that it will be active.  This can be accomplished using the Output Delivery System, ODS.  There have been a number of papers written on the topic.  Try google: sas ods excel formula


Peter_C
Rhodochrosite | Level 12

Art's suggestion is right on the money, for straightforward calculations, like a difference column.

The formulas in the FIELD2 row in your "sample.xls" are just column totals, but your message seeks the total along the diagonal for the first FIELD2 cell. What plan have you for the next FIELD2 cells?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 836 views
  • 0 likes
  • 3 in conversation