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

Thanks Tom and Art. It works like a charm now.

MikeZdeb
Rhodochrosite | Level 12

Hi ... here's another idea.  The attached JPEG is a screenshot of TEST.XLS.

I think it looks like what you say is your spreadsheet.

libname x 'z:\test.xls';

data x;

set x.'sheet1$'n;

nrec+1;

run;

libname x clear;

proc transpose data=x out=y (where=(_name_ ne "nrec"));

var _all_;

by nrec;

run;

data z;

do j=1 by 1 until(done);

  set y end=done;

  select;

     when (mod(j,2)) date = col1;

     otherwise do; var = col1 ; id = _label_; output; end;

  end;

end;

keep id date var;

format date mmddyy10. var 10.3;

run;

proc sort data=z;

by id date;

run;

proc print data=z noobs;

var id date var;

run;

   id             date           var

254063AC    07/01/1987         9.349

254063AC    07/02/1987         9.330

254063AC    07/06/1987         9.292

3134A4DQ    01/31/2001         5.191

3134A4DQ    02/08/2001         5.316

3134A4DQ    02/09/2001         5.239

345370BX    07/23/1998         6.525

345370BX    07/24/1998         6.539

345370BX    07/27/1998         6.566


test.jpg

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 16 replies
  • 4130 views
  • 1 like
  • 5 in conversation