BookmarkSubscribeRSS Feed
hemasai98
Fluorite | Level 6

We are migrating SAS code from windows to Unix operating system. One of the program is utilizing a catalog file which consists of 4 macros. Macros are not working due to change in operating system. Unfortunately, we are not able to find the source code for this catalog file.

 

Is there any way we can read the source code of this catalog file macros or is there any way to create or convert them in order to make it work on unix operating system.

4 REPLIES 4
Tom
Super User Tom
Super User

Try the %COPY statement.  https://documentation.sas.com/?docsetId=mcrolref&docsetTarget=p0oltlodtnemugn109vxxa76sref.htm&docse...

Note that this requires that the macro was compiled using the / source option on the %MACRO statement.

 

Why do you have macros stored in catalog instead of as text in program files?

SASKiwi
PROC Star

@hemasai98  - As far as I'm aware a MACRO catalog is a compiled macro and you can't extract the source code. Even if you could you would need to do it under Windows in your source SAS version, not your migrated one.

 

Correction: @Tom 's suggestion might work but it must be run on your Windows SAS.

ChrisNZ
Tourmaline | Level 20

Do not use a PDF to add a photo.

There is a camera icon just for that usage.

Kurt_Bremser
Super User

See Maxim 26, but you already know what it says, out of dire experience.

You can only extract the code with the original SAS version on Windows if the macros were stored with the source option. If not, your best bet is to re-engineer them.

And NEVER AGAIN store macros in catalogs. Basically, avoid all use of catalogs except for temporary means.

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Early bird rate extended! Save $200 when you sign up by March 31.

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 2710 views
  • 1 like
  • 5 in conversation