BookmarkSubscribeRSS Feed
MarkusWeick
Barite | Level 11

Hi all,

I would be grateful for some help on how to access the content of a .sas7bcat file in enterprise guide.

Cheers, Markus

Please help to keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles
14 REPLIES 14
ballardw
Super User

Do you know which version of SAS made the file?

The extension SAS7BCAT means that the file is a catalog. You may not be able to access a catalog created on a different operating system.

What is supposed to be in the catalog that you want to access?

 

The general approach is to have the file in a LIBRARY that your session has access to prior to use. How to use the contents depends on what is in it.

MarkusWeick
Barite | Level 11

I assume it was made with the same 9.4 I am using now. It should contain a collection of macros.

Please help to keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles
ChrisHemedinger
Community Manager

This is a catalog file from SAS. If you assign a library to the folder that contains the file, you can then use the Catalog and Formats Explorer tool in SAS Enterprise Guide (under the Tools menu) to see the entries, such as compiled macros and formats.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
MarkusWeick
Barite | Level 11

Yes @ChrisHemedinger , I now can see the macro I am looking for. How can I open it?

Please help to keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles
SASKiwi
PROC Star

@MarkusWeick  - While you can report on the contents of SAS catalogs with PROC CATALOG. macro entries can't be "opened", only executed and the source code of the macro cannot be extracted. You need to refer to the SAS code that created the macro originally.  

MarkusWeick
Barite | Level 11

I just tried the tip in Extracting a macro code from Catalog File - SAS Support Communities.

But got the the error message "The /SOURCE option was not specified when the macro M_UC was compiled. So I give up for the moment  and search for the source code tomorrow.

Thanks to @Solamente@ballardw@ChrisHemedinger@SASKiwi. You all brought me some steps further even if I haven't reached my goal yet.

Please help to keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles
AlanC
Barite | Level 11

Another tip: do not store code/macros in catalogs. If you can't find the source, you are hosed. I have seen that happen as well.

 

IMO, catalogs are an archaic format and should be avoided at all costs.

https://github.com/savian-net
MarkusWeick
Barite | Level 11

Hi @AlanC , thanks for the advice. After my experience so far I definitely won't store code/macros in catalogues.

Cheers, Markus

Please help to keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles
AlanC
Barite | Level 11
I dont even store formats there. It is easier to %include everything.

Computers are just way more powerful than they were back in the day.
https://github.com/savian-net
Patrick
Opal | Level 21

@AlanC wrote:
I dont even store formats there. It is easier to %include everything.

Computers are just way more powerful than they were back in the day.

Which of course then stores the macros and formats in this archaic format in WORK 😄

 

 

But agree with what you say except for the rare exception where one needs secure compiled macros.

ballardw
Super User

@Patrick wrote:

@AlanC wrote:
I dont even store formats there. It is easier to %include everything.

Computers are just way more powerful than they were back in the day.

Which of course then stores the macros and formats in this archaic format in WORK 😄

 

 

But agree with what you say except for the rare exception where one needs secure compiled macros.


Which is why I keep project specific formats in a permanent library and add the library to the FMTSEARCH path.

That way, as needed, I can override the same named format by making a version in WORK that appears first in the search path and still have both available as needed...

 

Macro's not so much.

yabwon
Amethyst | Level 16

Continuing @AlanC suggestion. Maybe you consider using SAS Packages and SAS Packages Framework.

It allows you to easily share complex codes (a lot of macros, formats, functions, etc.) with others in easy way and at the same time it keeps source code (which is also easily accessible to user [not only developer]). 

 

The latest YouTube video describing SPF is here: https://www.youtube.com/watch?v=T52Omisi0dk

Video about how to build your firs package is here: https://www.youtube.com/watch?v=hqexaQtGw88

 

Bart

_______________
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



SASKiwi
PROC Star

@MarkusWeick - If you switch to using AUTOCALL macro libraries, then by definition you are working off macro source code files stored in a defined AUTOCALL folder. In my experience this is the best way to manage macros and you are a lot less likely to lose them. If you do they stop working...🙂

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 14 replies
  • 7048 views
  • 18 likes
  • 8 in conversation