BookmarkSubscribeRSS Feed
rajat1
Fluorite | Level 6

Import smb usage data into sas and provide labels from "Churners and label ' file . (9999 OBSERVATIONS AND 400 VARIABLES )

 

 

I  am only able to import the file

4 REPLIES 4
Reeza
Super User

I think the answer is the same as this question. 

 

https://communities.sas.com/t5/Base-SAS-Programming/proc-sql/m-p/406565

rajat1
Fluorite | Level 6

this is the second data file

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Sorry, the title of your post bears no resemblance to your post.  You have not provided any clear indication on what your question is.  It appears you have copied part of a question from some test and expect a response.  Please review the guidance on how to post a question to get a good response - from the main page, or by the Post button.  At a guess - as I wouldn't download Excel files from the web, you have data in one tab and labels in another.  If so read in both datasets, then using the one with labels generate a statement to label the data, e.g.:

data _null_;
  set labelstab end=last;
  if _n_=1 then call execute('data want;  set have;');
  call execute('label ',varfromtab,'="',label,'";');
  if last then call execute(';run;');
run;

Alternatively, convert the file into two CSV files - far better data format, then read the labels one into SAS first using a datastep import, then use that data, much like the above, to write the datastep import for the second set of data.  That way you can read the second in directly without need for post processing.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Sorry, the title of your post bears no resemblance to your post.  You have not provided any clear indication on what your question is.  It appears you have copied part of a question from some test and expect a response.  Please review the guidance on how to post a question to get a good response - from the main page, or by the Post button.  At a guess - as I wouldn't download Excel files from the web, you have data in one tab and labels in another.  If so read in both datasets, then using the one with labels generate a statement to label the data, e.g.:

data _null_;
  set labelstab end=last;
  if _n_=1 then call execute('data want;  set have;');
  call execute('label ',varfromtab,'="',label,'";');
  if last then call execute(';run;');
run;

Alternatively, convert the file into two CSV files - far better data format, then read the labels one into SAS first using a datastep import, then use that data, much like the above, to write the datastep import for the second set of data.  That way you can read the second in directly without need for post processing.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4 replies
  • 1405 views
  • 0 likes
  • 3 in conversation