BookmarkSubscribeRSS Feed
greesamu
Obsidian | Level 7

So I've uploaded plenty of .sas7dbat files with no issue, but for the first time I have one that's over 1 GB (it's 1.1 GB). I've been able to zip it and then upload the zipped file, but now I can't figure out how to unzip the file now that it's in SAS Studio.

 

I'd appreciate advice on how to unzip the file or some way to split it into two smaller files. Thanks!

4 REPLIES 4
AllanBowe
Barite | Level 11

Here's a macro to do the unzip: https://core.sasjs.io/mp__unzip_8sas.html

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs
Tom
Super User Tom
Super User

Just to spell it out.

Point a fileref at the file inside the ZIP file.

Point another at the place you want to store the SAS dataset.

Use FCOPY() to extract the file.

 

You need to use RECFM=F and set a specific LRECL value to force BINARY copy.

filename in zip "myfile.zip" member='myds.sas7bdat' recfm=f lrecl=512;
filename out "/mydirectory/myds.sas7bdat" recfm=f lrecl=512;
%let rc= %sysfunc(fcopy(in,out));

If you want the file created in the WORK directory use the PATHNAME() function to find out where that is for this session.

filename out "%sysfunc(pathname(work))/myds.sas7bdat" recfm=f lrecl=512;
Reeza
Super User
If you need to work with large data sets, you can also use filename URL to access data sets on public sites and a similar method to Tom's solution to copy them over from a cloud site to your SAS On Demand session.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 1151 views
  • 3 likes
  • 4 in conversation