BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
karti
Fluorite | Level 6

We cant do this manually by renaming, i suppose.

I tried like copiying the catlog from one location to another with a different name.

libname test 'location';

proc catalog catalog=test.sasmacr1 force;

copy in=test.sasmacr1 out=work.sasmacr;

quit;

By this way, i was able to rename from 'sasmacr1' to 'sasmacr'.

Is there a possible to do this even more simply? Is there a way to rename a macro catalog?

1 ACCEPTED SOLUTION
9 REPLIES 9
jakarman
Barite | Level 11

Proc catalog is for managing catalogs (sas7bcat) and proc datasets for datasets(sas7bdat). Their internal structure is different.

If you know what your are doing you could rename the datasets at the OS level.

---->-- ja karman --<-----
Ksharp
Super User

Jaap, Haha, actually that is not true. According to SAS documentation. it can change Macro entry name.

CHANGE Statement

Renames one or more SAS files in the same SAS library.

and I also give it a try :

390

391  proc datasets library=x nolist nodetails;

392  change sasmacr=mymac ;

393  quit;

NOTE: Changing the name X.SASMACR to X.MYMAC (memtype=CATALOG).

NOTE: PROCEDURE DATASETS used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

Xia Keshan

karti
Fluorite | Level 6

Thanks for the answers, I have another question on this,

If i have 2 catalogs in a single library, (eg., 'sasmacr' and 'mycat' - by copying mycat from a different location) , i am able to access macros from the catalog 'sasmacr' and not from the catalog 'mycat'.

after setting a macro library with options mstored and sasmstore=<libname>,,,

if i try to use the entries from 'mycat' i am getting error message like 'Macro not resolved'

Should i change any option so that i could use both the catalogs.?

Help me with a solution..

Reply for any clarification required in the question

Ksharp
Super User

You could try option :

options SASAUTOS= ( work 'c:\temp\')      MAUTOSOURCE    ;

Loko
Barite | Level 11

Hello,

This will do it:

proc datasets library=test memtype=catalog nolist;

change rest=eee;

quit;

jakarman
Barite | Level 11

Yep I have seen it, it is at the catalog level (sas7bcat name) possible.

your are right.

At some moment this was all worthless for me. So I must get that dust away for what was going on.

The situation:

- Fixed catalog names, part of the autoexec setup.   No need for rename just for managing the content of those catalogs.

- SCL usage needing to manage the members in a catalog.

  The datasets tables are manageable with proc datasets (Copy move) but failed at the catalog member content.

- As releasemanagement being setup supporting DTAP. The libraries having setup in concatenation.

  In this way you can solve the "which version is active" question. by moving the catalogmembers to the according locations.

  As there is no version present in D there can be also no mistake for getting seeing the wrong version.

  This worked for formats also with an addition to combine a data-defined version when it data-content related

- proc datasets is supporting a move statement (data only) but proc catalog is not.

  I ended up using proc upload/download for catalogs as with a copy that does a really merge with existing content.

It also does change the security context using another key so that the developer cannot develop code an other location than development.

O they like to change all  kind of things when incidents are coming in direct in the production environment without a change order.    

In some cases we did the rename/copy at the OS level verify some assumptions and went back to the original state.        

Looks to me usefull information for others.

---->-- ja karman --<-----
jakarman
Barite | Level 11

And see one question in the same direction.

I preferred macros at the source level being compiled when needed. It eliminates the question whether the source and the compiled version are belonging to each other.

Setting it up into a dtap concatenation as previous described.

For macros source type: SAS(R) 9.4 Macro Language: Reference, Second Edition (SASautos) I think there is something strange here as it can refer to libnames and filerefs.  

For compiled macros there is SASMStore SAS(R) 9.4 Macro Language: Reference, Second Edition  It does not have an concatenation type. The libarary def-s do support concatenation. SAS(R) 9.4 Statements: Reference, Third Edition

For FCMP binaries you can imagine a similar approach.  SAS(R) 9.4 System Options: Reference, Third Edition  (cmplib)

---->-- ja karman --<-----
jakarman
Barite | Level 11

There is a new method to insert values to existing system options.

SAS(R) 9.3 System Options: Reference, Second Edition (listinsertappend)    SAS(R) 9.3 Companion for UNIX Environments (insert example)

saving automamacros and using: SAS(R) 9.4 Macro Language: Reference, Second Edition

---->-- ja karman --<-----

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!

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.

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
  • 2390 views
  • 6 likes
  • 4 in conversation