Write and run SAS programs in your web browser

Base to Studio: Code that works in Base but not Studio

Reply
New Contributor
Posts: 2

Base to Studio: Code that works in Base but not Studio

 

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?

 

 

Super User
Posts: 5,228

Re: Base to Studio: Code that works in Base but not Studio

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.

Super User
Posts: 3,172

Re: Base to Studio: Code that works in Base but not Studio

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.

Super User
Posts: 5,307

Re: Base to Studio: Code that works in Base but not Studio

When claiming that something isn't working - please attach the log!
Data never sleeps
New Contributor
Posts: 2

Re: Base to Studio: Code that works in Base but not Studio

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

Valued Guide
Posts: 820

Re: Base to Studio: Code that works in Base but not Studio

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.

Ask a Question
Discussion stats
  • 5 replies
  • 147 views
  • 2 likes
  • 5 in conversation