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-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!

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.

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