BookmarkSubscribeRSS Feed
Kayellen61
Calcite | Level 5

Does anyone know of a tool that I can run to search for specific tables or data columns being used in an egp file?

 

Thank you.

12 REPLIES 12
ChrisHemedinger
Community Manager

You can try using this "unofficial" tool that I built a while ago. Lots of folks have had success with it.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
Kayellen61
Calcite | Level 5

Hello for some reason, I was not able to download the version for SAS EG 8.1.  The link did nothing.

ChrisHemedinger
Community Manager

Direct link: http://support.sas.com/documentation/onlinedoc/guide/blog/EGPSearcherTool.zip

 

But unfortunately there is not a version specifically for EG 8.1 -- we have versions for 7.x and 8.2/8.3.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
Kayellen61
Calcite | Level 5

Thank you for your quick response.

Kayellen61
Calcite | Level 5

Is there another way for me to receive this tool?

ChrisHemedinger
Community Manager

I fixed the link in the blog. But as I said, it won't address the specific version of SAS Enterprise Guide 8.1, which has been updated for a long time to 8.2/8.3.

 

As an alternative you could use SAS Enterprise Guide automation -- via scripts -- to export and examine much of the content in EGP files.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
Quentin
Super User

Hi,

 

This might not help, but I think needs like this are a great reason to store .sas code outside of .egp files (and link to them from EG process flows).  To my mind, EG became a much better tool for developers when it added that option.  Storing code outside of EG gives you the ability to execute it from other SAS sessions / environments, and also search code using any text search tools.

 

Too approach this problem, I might be tempted to script a process that would extract all the code from EG projects and dump it to .sas files as a first step.

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
ChrisHemedinger
Community Manager

Good advice @Quentin -- and to get you started I have several scripts on GitHub -- in PowerShell or VBScript.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
AlanC
Barite | Level 11

I have C# code to work with EG files and do similar processes.

 

Ping me offline Quentin if you need help. I am busy until after the holidays but can look at it after new years.

https://github.com/savian-net
Quentin
Super User

Thanks Alan. I'm not the OP for this question, but appreciate the offer!

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
AlanC
Barite | Level 11

I was responding to your mention of writing a script: I should have made that clear.

 

Ultimately, you need to open the egp XML, get the elements, find the one with SAS code, and extract it. i am pretty sure I have that already. the OP question regarding the datasets should also be discoverable in a similar manner.

https://github.com/savian-net
yabwon
Onyx | Level 15

I would use SAS Packages for storing and sharing my SAS code (https://github.com/yabwon/SAS_PACKAGES).

 

Other thing, wouldn't a macro like one below solve the issue?

 

Bart

 

%macro getSASfilesFromEGP(
  path
 ,libOut
);
%local inZIP inF outF;
%let inZIP = z%sysfunc(datetime(),hex7.);
%let   inF = i%sysfunc(datetime(),hex7.);
%let  outF = o%sysfunc(datetime(),hex7.);
data _null_;
  rc0 = filename("&inZIP.", "&path.", "ZIP", "lrecl=1 recfm=n");
  did = dopen("&inZIP.");

  did = dopen("&inZIP.");
  if not did then
    do;
      put "ERROR- Aborting.";
      stop;
    end;

  do i=1 to dnum(did);
    file = dread(did, i);

    if upcase(scan(file,-1,".")) ne "SAS" then continue;

    rc1 = filename("&inF.", "&path.", "ZIP", "member='" !! strip(file) !! "' lrecl=1 recfm=n");

    rc2 = filename("&outF.", catx("/", dequote(symget("libOut")), translate(file,"_","/")), "DISK", "lrecl=1 recfm=n");
    rc3 = fcopy("&inF.", "&outF.");

    if ^fexist("&outF.") then put "WARNING: UnZIP failed.";
    put i= file=;
    put (rc:) (=);

    rcY = filename("&inF.");
    rcZ = filename("&outF.");
  end;

  did = dclose(did);
run;

%mend getSASfilesFromEGP;

%getSASfilesFromEGP(
  C:\Users\bart\Desktop\Project.egp
 ,C:\Users\bart\Desktop\TEST123
)

 

 

 

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



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!

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
  • 12 replies
  • 1467 views
  • 0 likes
  • 5 in conversation