BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ksharp
Super User
data ds1;
  input fc_1-fc_10 (dt_1-dt_10) (:$2.);
  datalines;
7 0 8 6 5 0 7 0 0 0 a b c d e f g h i j
7 0 3 10 3 2 10 8 4 7 a b c d e f g h i j
3 0 0 0 2 7 4 4 0 9 a b c d e f g h i j
3 0 0 4 3 10 1 9 4 7 a b c d e f g h i j
;

data ds2;
  set ds1;
  array fc[*] fc_1-fc_10;
  array dt[*] dt_1-dt_10;
  do i=2 to dim(fc) ;
    if fc(i-1) eq 0 and fc(i)>0 then stp_dt=dt[i-1];
  end;
run;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 15 replies
  • 3702 views
  • 1 like
  • 4 in conversation