I need to get to some code that I'd written in SAS EG 7.1 using EG 5.1
Is there a way to extract the code and run it in an earlier version of EG?
It's actually easy, but laborious.
An EG project is simply a .zip file. If you rename your xyz.egp to xyz.zip, you can browse it with anything that looks at .zip files. Among the included objects will be your code objects.
Tom
It's actually easy, but laborious.
An EG project is simply a .zip file. If you rename your xyz.egp to xyz.zip, you can browse it with anything that looks at .zip files. Among the included objects will be your code objects.
Tom
Thanks, will give it a shot.
You're right, a bit laborious trying to figure out what the flies are as names are not the same. However, works like a charm! Thanks much!!
--Sonia
An alternative to @TomKari's approach is to open the project in EG 7.1 and do a File - Export - Export All Code in Project.
Unfortunately don't have EG 7.1 installed (inadvertently reverted back to 5.1 when trying to restore older VM version). Downloading SAS 9.4, which comes with EG 7.1, in the VM takes forever 😞 so was looking for an easy solution for a quick turnaround on a project.
I guess its the @TomKari solution then...please confirm if this works for you.
Here's a piece of code I threw together a while ago...my apologies, but I don't have time to dive back into it and certify it. If you find it useful, I can tell my wife I wasn't wasting my time for once!
%let ProcessDir = C:\Users\directories;
%let DSN = DataSetName.egp;
%macro GetZipCode(ProcessDir, DSN, ZIPMember, SASMember);
filename inzip zip "&ProcessDir.\&DSN." member="&ZIPMember.";
data _null_;
infile inzip;
file "&ProcessDir.\&SASMember.";
input;
put _infile_;
run;
%mend; /* GetZipCode */
/* Assign a fileref wth the ZIP method */
filename inzip zip "&ProcessDir.\&DSN.";
/* Read the "members" (files) from the ZIP file */
data _null_;
length memname $200;
fid=dopen("inzip");
if fid=0 then
abort;
memcount=dnum(fid);
do i=1 to memcount;
memname=dread(fid,i);
if scan(memname, 2, "/") = "code.sas"
then call execute("%"||"GetZipCode(&ProcessDir., &DSN., "||trim(left(memname))||", "||trim(left(scan(memname, 1, "/")))||".sas);");
end;
rc=dclose(fid);
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.