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.

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
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.

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
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.

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
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.

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
ChrisHemedinger
Community Manager

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

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
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!

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 12 replies
  • 1971 views
  • 0 likes
  • 5 in conversation