Write and run SAS programs in your web browser

STC File Import

Reply
New Contributor
Posts: 3

STC File Import

Hi, 

 

I'm new to SAS studio and I'm having a problem opening an .stc file. I never had a problem opening this file until switching over to SAS studio. How do I go about importing/opening the file? 


Thanks, 

 

Ami

Contributor
Posts: 33

Re: STC File Import

Have you tried,

 

proc cport
 file = 'C:\path_to_file\filename.stc'
 library = WORK
 disk
;
run ;
New Contributor
Posts: 3

Re: STC File Import

Yup, that's what I tried first. Here's what I happened: 

 
x1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
x61
x62 proc cport
x63 file = 'C:\Users\acyares\Desktop\sppa1982-2012_nw.sas7bdat\35588-0004-Data.stc'
x64 library = WORK
x65 disk
x66 ;
x67 run ;
 
xERROR: Insufficient authorization to access
x/opt/sasinside/SASConfig/Lev1/SASApp/C:\Users\acyares\Desktop\sppa1982-2012_nw.sas7bdat\35588-0004-Data.stc.
xNOTE: The SAS System stopped processing this step because of errors.
xNOTE: PROCEDURE CPORT used (Total process time):
xreal time 0.00 seconds
xcpu time 0.00 seconds
 
x68
x69 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
82
Super User
Super User
Posts: 5,982

Re: STC File Import

First PROC CPORT is used to CREATE cport files. If you want to read one you need to use PROC CIMPORT.

Second the file needs to be in a location that the SAS program can read. Your logs is clearly showing that you are trying to reference a file using Windows filename (and most likely on the personal computer) and your SAS session is running on a Unix machine.

 

If you are using SAS University Edition the make sure to but the file into a folder that you mapped into the virtural machine that is runnng SAS. If you are running SAS/Studio on some physical Unix machine then put the file into a folder on that machine (or a drive that is mounted on that machine.) You could try using the SAS/Studio interface to upload the file from your PC as long as it is not too large.

 

Once you have copied it somewhere SAS can see then run code like this to convert it into a data set.  You should proabably save it as a SAS dataset to avoid having to run this step everytime you want to use it.

 

proc cIMport 
  infile = '/folders/myfolders/sppa1982-2012_nw.sas7bdat/35588-0004-Data.stc' 
  lib=work
;
run; 
Super User
Super User
Posts: 5,982

Re: STC File Import

What CODE did you run the past to convert the file?

Or did you just use the SAS Display Manager to auto convert it for you?

New Contributor
Posts: 3

Re: STC File Import

When the file was saved to my desktop, it opened automatically into SAS 9.4 but for some reason, I can't figure out why I can't open it on SAS Studio

Grand Advisor
Posts: 16,393

Re: STC File Import

Because SAS Studio is likely running on a server not on your desktop. So you need to upload it first to somewhere SAS Studio can see the file and then it will import it as it did previously. 

 

You're switching to a desktop environment to a server environment which has its pros/cons. What you're seeing is one of the learning curves. 

Community Manager
Posts: 2,606

Re: STC File Import

@DrAnnmaria created a very helpful tutorial about this topic!

 

See:  Getting STC files into SAS Studio

Post a Question
Discussion Stats
  • 7 replies
  • 102 views
  • 0 likes
  • 5 in conversation