BookmarkSubscribeRSS Feed
Suzbert
Calcite | Level 5

 

I inherited a snippet of code written in BASE (see below).  It works fine.  I need to run the code in STUDIO. Of course I'm brand new to the company and to STUDIO.

 

Here is the code:

PROC IMPORT OUT= WORK.Members
DATAFILE= "\\maskedforsecurity.txt"
DBMS=TAB REPLACE;
GETNAMES=YES;
DATAROW=2;
RUN;

 

DATA MEMBERS;
SET MEMBERS;
IDMEDICALC = PUT(MEMBERID, 12.);
RUN;

 

Here is what happened in Studio:

1. I could not get the "proc import out =" statement to work, so I imported manually.

2. The second statement creates a two variable file with no data (Originally, there were 300 some cases and 5 variables)

 

 

My questions:

a. what am I doing wrong?

b. where is a good resource that outlines differences in code behavior between Base and Studio?

 

 

5 REPLIES 5
Astounding
PROC Star

I can't address the IMPORT problem, but I wouldn't be surprised of SAS Studio can't run PROC IMPORT.

 

For your second issue, it's likely you forgot the semicolon at the end of the DATA statement.

SASKiwi
PROC Star

In my experience SAS code works identically between Base / EG / SAS Studio assuming that they are all using the same SAS servers with the same set up.

LinusH
Tourmaline | Level 20
When claiming that something isn't working - please attach the log!
Data never sleeps
Suzbert
Calcite | Level 5

Thank you.

Understood.

Being new to SASS, these boards, and my job, I debated including the log.

I would need to edit information out because I work for a state govt entity in health care and security policies are excruciatingly strict.

What's the minimum log information required?

s

mkeintz
PROC Star

How about doing a "find/replace" of all the privacy-related filenames and varnames?  Just use consistent, but unique replacement characters consistently throughout the log.

 

But more generally one is interested in the sas notes, warnings, and error messages - and (more problematic for your secutiy issues) the lines of code that precipitated those messages.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 5 replies
  • 796 views
  • 2 likes
  • 5 in conversation