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

I am importing data from SPSS to SAS and creating several new variables within the SAS dataset that I wish to save to a permanent file that can be accessed later. I don't want to have to run the code to set up my new variables for analysis every single time I open SAS. I have been using the following statements, but it does not seem to work. Suggestions are much appreciated.

libname survey 'C:\location-of-file';

data survey.apr30data;

IF-THEN-ELSE statements;

proc print data=survey.apr30data;

run;

1 ACCEPTED SOLUTION

Accepted Solutions
CarmineVerrell
SAS Employee

You are almost there, you need to set the imported file(SPSS) into the data step procedure. 

 

libname survey 'C:\location-of-file';

data survey.apr30data;

   set importedspssfilehere;

  IF-THEN-ELSE statements;

run;

 

proc print data=survey.apr30data;

run;

View solution in original post

1 REPLY 1
CarmineVerrell
SAS Employee

You are almost there, you need to set the imported file(SPSS) into the data step procedure. 

 

libname survey 'C:\location-of-file';

data survey.apr30data;

   set importedspssfilehere;

  IF-THEN-ELSE statements;

run;

 

proc print data=survey.apr30data;

run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 497 views
  • 0 likes
  • 2 in conversation