I am currently taking the "Programming 2: Data Manipulation Techniques" course and trying to upload the _2createdata_pg2.sas file into my data folder onto SAS Studio 3.8. I am using SAS Studio 3.8 on a local server with a MAC. When I try to upload that file into my data folder I get an alert telling me I cannot upload files larger than 10 MB.
Are you trying to use SAS Academics on Demand or University Edition?
If SAS UE - then drop it in your myfolders, do not use the UPLOAD feature, that's designed for Server systems.
@ConnerM wrote:
I am currently taking the "Programming 2: Data Manipulation Techniques" course and trying to upload the _2createdata_pg2.sas file into my data folder onto SAS Studio 3.8. I am using SAS Studio 3.8 on a local server with a MAC. When I try to upload that file into my data folder I get an alert telling me I cannot upload files larger than 10 MB.
University Edition using VirtualBox.
I am not sure how to place files in virtual box?
Got it. Thank you so much!
Hi, where did you find the SAS programming 2 datafiles. Please share the link.
Run this.
%let course=epg294;
%let path=%qsysfunc(translate(%superq(path),/,\));
%let original_path=%superq(path);
/*options nomprint nosymbolgen nonotes nosource dlcreatedir;*/
options mprint symbolgen notes source;
%macro unpack(unzip /* Full path pointing to where to create the EPG294 data */
,zipfilename /* ZIP File name (used to download with PROC HTTP) */
,coursecode /* Represents the top level folder of the ZIP file; can be used for conditional logic */);
%local rc fid fileref fnum memname big_zip big_zip_found data_zip data_zip_found url;
%global cre8data_success path;
%let cre8data_success=0;
%let url=%str(http://dl.liveweb.sas.com/eldata/pg294_oda.zip);
/* Is the path specified valid? */
%let fileref=unzip;
%let rc=%sysfunc(filename(fileref,%superq(unzip)));
%let path_found=%sysfunc(fileref(unzip));
%if &path_found ne 0 %then %do;
%put %sysfunc(sysmsg());
%put ERROR: ************************************************************;
%put ERROR- Path specified for data files (%superq(unzip)) is not valid.;
%put ERROR- Remember: PATH values in UNIX and LINUX are case sensitive. ;
%put ERROR- ************************************************************;
%let rc=%sysfunc(filename(fileref));
%return;
%end;
/* Get just the filename of the zipfile, not the .ZIP extension */
%if %qscan(%qupcase(%superq(zipfilename)),2,.) = %str(ZIP) %then %do;
%let zipfilename = %qscan(%superq(zipfilename),1,.) ;
%end;
/* Test for the presence of the main ZIP file in the path */
%let fileref=bigzip;
%let rc=%sysfunc(filename(fileref,%superq(unzip)/%superq(zipfilename).zip,zip));
%let big_zip_found=%sysfunc(fileref(bigzip));
%if &big_zip_found ne 0 %then %do;
%put NOTE: %superq(zipfilename).zip not found in %superq(unzip).;
%put NOTE- Attempting to download the ZIP file from the internet.;
filename BigZip "%superq(unzip)/%superq(zipfilename).zip";
proc http
url="%superq(url)"
out=BigZip method="get";
;
run;
%let big_zip_found=%sysfunc(fileref(bigzip));
%if &big_zip_found ne 0 %then %do;
%put ERROR: *************************************************************;
%put ERROR- Attempt to download %superq(zipfilename).zip unsuccessful.;
%put ERROR- *************************************************************;
filename BigZip;
%return;
%end;
%end;
options dlcreatedir;
libname xx "%superq(path)";
libname xx clear;
/* Read the "members" (files) from the ZIP file */
/* Create the data folder structure and get a list of files in macro variables */
filename BigZip zip "%superq(unzip)/%superq(zipfilename).zip";
data _null_;
length memname pathname $500;
fid=dopen("bigzip");
if fid=0 then stop;
memcount=dnum(fid);
do i=1 to memcount;
memname=dread(fid,i);
/* Create and empty folder for each folder in the ZIP file */
/* check for trailing / in folder name */
isFolder = (first(reverse(trim(memname)))='/');
/* if isfolder then put memname= isfolder=;*/
if isfolder then do;
pathname=cats("&path/",substr(memname,1,length(memname)-1));
put "NOTE: Creating path " pathname;
rc1=libname('xx',pathname);
rc2=libname('xx');
end;
else do;
filecount+1;
call symputx(cats('out',filecount),memname,'L');
end;
end;
rc=dclose(fid);
call symputx('filecount',filecount,'L');
run;
%do i=1 %to &filecount;
filename out "%superq(unzip)/%superq(out&i)";
data _null_;
infile bigzip(%superq(out&i))
lrecl=256 recfm=F length=length eof=eof unbuf;
file out lrecl=256 recfm=N;
input;
put _infile_ $varying256. length;
return;
eof:
stop;
run;
%end;
filename bigzip;
filename out;
filename unzip;
%let setup=%superq(unzip)/setup.sas;
%let cre8data_ready=%sysfunc(fileexist(%superq(setup)));
%if not &cre8data_ready %then %do;
%put;
%put ERROR: ********************************************************************;
%put ERROR- After unzipping %superq(zipfilename).zip, setup.sas program not found ;
%put ERROR- in folder %superq(unzip).;
%put ERROR- Download and unzip %superq(zipfilename)_data.zip manually, then;
%put ERROR- run cre8data.sas again.;
%put ERROR- ********************************************************************;
%put;
%end;
%let path=%superq(unzip)/data;
%include "%superq(setup)";
%mend unpack;
%unpack(%superq(path),epg294.zip,epg294)
/* added to set &path for elearning */
%let path=/home/&sysuserid/EPG294/data;
options mprint notes source;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: