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

Hi,

Yet an other Array Question..

If the in: and out: is missing then I want to set the dept: to missing too

In the below example since in2 and out2 are missing  dept2     dept2_2 must be missing

Same with Dept3 and Dept3_3


in1             out1      dept1     dept1_1        in2     out2     dept2     dept2_2       in3     out 3     dept3       dept3_3

28Dec       30dec    CM         CM             .            .         DM          DM           .            .            PM        PM   

WANT:

in1             out1      dept1     dept1_1        in2     out2     dept2     dept2_2       in3     out 3     dept3       dept3_3

28Dec       30dec    CM         CM              .            .         .          .           .            .            .       .               .

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Just loop over the array as in your other examples.

data want;

set have;

array in in1-in3;

array out out1-out3;

array d1 dept1-dept3 ;

array d2 dept2_1 - dept2_3 ;

do i=1 to dim(in);

  if 0=n(in(i),out(i)) then do; d1(i)=' ',d2(i)=' '; end;

end;

run;

View solution in original post

1 REPLY 1
Tom
Super User Tom
Super User

Just loop over the array as in your other examples.

data want;

set have;

array in in1-in3;

array out out1-out3;

array d1 dept1-dept3 ;

array d2 dept2_1 - dept2_3 ;

do i=1 to dim(in);

  if 0=n(in(i),out(i)) then do; d1(i)=' ',d2(i)=' '; end;

end;

run;

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!

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
  • 1 reply
  • 596 views
  • 0 likes
  • 2 in conversation