BookmarkSubscribeRSS Feed
williamty
Calcite | Level 5

I have a very large sd2 dataset file which is about 42GB. I can only load it into SAS by a script which qualifies certain variables. I cannot read the dataset structure nor open it in SAS universal viewer. I have tried all the methods I can find on the Internet and forums, including but not limited to using old v6. For example, all of the following scripts don't work:

libname in v6 'path';
libname out v9 'path';
proc copy inlib=in outlib=out;
run;
libname new 'path';
libname old v6 'path';
data new.test;
set old.test; 
run;
libname out v9 'path';                                                                                                        
libname in v6 'path';                                                                                                               
                                                                                                                                        
data in.test;                                                                                                                       
  infile 'path';                                                                                                       
  input;                                                                                                                                
run;                                                                                                                                    

I think the main error is that: Write access to member 'IN.TEST.DATA' is denied. I don't know why. How can i convert the sd2 file to sas7bdat?

5 REPLIES 5
Tom
Super User Tom
Super User

SAS does not have any trouble with a directory having mixed version 6 and version 7/8/9 format files in the same directory.

 

But you do need to tell it which engine to use for which libref.  Otherwise it will pick one for you (and I am not sure what logic it uses to pick).

libname in v6 'path';
libname out v8 'path';

@Kurt_Bremser wrote:

Avoid having two LIBNAMEs pointing to the same path. You can't have test.sd2 and test.sas7bdat in the same directory, SAS does not allow this.


 

Tom
Super User Tom
Super User

Your first step looks right.  You are copying the V6 dataset to a V9 dataset.

Your second step also looks right, but the libref NEW is WRONG (or at least potentially wrong or confusing).   If you don't tell SAS what engine to use it will pick one based on the files in the directory.  If the only SAS datasets that are there are V6 then it will pick V6.

 

Use BASE as the engine and SAS will use the default engine for whatever version of SAS you are running.

libname new base 'path';

 

The last one is flat out wrong.  You cannot write a V6 dataset unless you are running SAS 8 or earlier.  INFILE is for reading TEXT files (or reading binary files as text).  You cannot use it to read a SAS dataset or a directory.

yabwon
Onyx | Level 15

Hi @williamty 

1) can you share log from the 1st and 2nd steps.

2) and you are working on Windows, right? (e.g. Linux does not have v6 engine)

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



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!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 2109 views
  • 2 likes
  • 5 in conversation