BookmarkSubscribeRSS Feed
Grandhi4
Calcite | Level 5

How to develop a code in SAS Macros like a XL (formulas) can i get any sample code or example ?

5 REPLIES 5
manojinpec
Obsidian | Level 7

Can you please give example of what you want to achieve

Grandhi4
Calcite | Level 5

Some thing like this

A                                           B                                     C (Total)

0-11      12-21                 0-11      12-21                 0-11           12-21
8,684      5,466                2,216      2,189               25.52%      40.05%

shivas
Pyrite | Level 9

Hi,

Is this what you want.

  proc fcmp outlib=sasuser.funcs.trial;

     function percent1(var1, var2);

        n = (var2/var1)*100;

          return (n);

   endsub;

  options cmplib=sasuser.funcs;

  data want;

    Total = percent1(8684,2216);

    Total1 = percent1(5466,2189);

  run;

Thanks,

Shiva

Grandhi4
Calcite | Level 5

Yeah some thing like similar...

But the task is need to develop in Base SAS, Macros, and out put would be Web SP...

Can i have your email id so that i wil sare the doc if you don't mind

Please help on this !?

Thanks,

Suresh

shivas
Pyrite | Level 9

Hi Suresh,

Proc fcmp is part of Base SAS procedure only in SAS 9.2,But if you are using SAS 9.1.3 then FCMP is part of SAS Risk dimensions procedure.

What version of SAS are you using.

I will send you my personal email to your id.

Bur,If you can post your questions in forum there are many SAS Experts who can guide you in the right path.

Thanks,

Shiva

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