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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

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
  • 9 replies
  • 3573 views
  • 2 likes
  • 3 in conversation