BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sliou
Calcite | Level 5

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
TomKari
Onyx | Level 15

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

View solution in original post

9 REPLIES 9
TomKari
Onyx | Level 15

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

sliou
Calcite | Level 5

Thanks, will give it a shot.

sliou
Calcite | Level 5

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

 

SASKiwi
PROC Star

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.

sliou
Calcite | Level 5

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.

SASKiwi
PROC Star

I guess its the @TomKari solution then...please confirm if this works for you.

sliou
Calcite | Level 5
Yup, @TomKari's solution worked well.
TomKari
Onyx | Level 15

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;

sliou
Calcite | Level 5
Thanks! I'll definitely let you (your wife) know no time was wasted if this proves to work 🙂
As with pending deadline of project, might not be able to dive into this for a little while.
cheers,
--Sonia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 9 replies
  • 4281 views
  • 2 likes
  • 3 in conversation