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

Hi,

I am trying to generate missing value with "IFN" function, like this,

proc sql;

    create table E0 as

    select    A.stkcd,

            A.year,

            ifn(missing(A.sales)+missing(B.sales)+missing(C.sales)=0,std(A.Sales,B.sales,C.sales),"") as std

    from firmchar.CAL_Earnings as A

    left join firmchar.CAL_Earnings as B on A.stkcd=B.stkcd and A.year=B.year+1

    left join firmchar.CAL_Earnings as C on A.stkcd=C.stkcd and A.year=C.year+2;

quit;

Well, it seems generating missing value with IFN function is NOT allowed.

Yet I do not want calucalte standard error if any one of three variables is missing. So, is there any way to solve this? say, some similar alternative functions.

Many THX!!!

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

Just use . rather than " " to indicate the missing value result.

View solution in original post

2 REPLIES 2
art297
Opal | Level 21

Just use . rather than " " to indicate the missing value result.

rpg163
Calcite | Level 5

Wow, yes, I works.

Many Thanks!!!

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