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

One of your variables was called "i" and I, without thinking, had suggested using "i" in the do loop.  As such, the loop was re-assigning the value of that variable (i.e., the eighth variable).

R_A_G_
Calcite | Level 5

Just curious to know why iii fixed the problem

thanks

R_A_G_
Calcite | Level 5

thanks didn't see the reply, please ignore the last question

Tom
Super User Tom
Super User

Why not just skip the PROC IMPORT?  Save the XLS files as a CSV file and then just read it with a data step where you get to define the names?

data want ;

  infile 'myfile.csv' dsd dlm=',' truncover lrecl=30000;

  input people col1-col116;

run;

Ksharp
Super User

Or a faster way.

Proc import out=data datafile="C:\temp\x.xls"  dbms=xls replace;
  getnames=no;
run;

data _null_;
 set sashelp.vcolumn(keep=libname memname name where=(libname='WORK' and memname='DATA')) end=last ;
 if _n_ eq 1 then call execute('proc datasets library=work nolist;modify data; rename a=people ');
  else call execute(cats(name,'=col',_n_-1));
 if last then call execute(';quit;');
run;

Ksharp

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
  • 19 replies
  • 12470 views
  • 1 like
  • 4 in conversation