DATA Step, Macro, Functions and more

catalog 32 bits or 64 bits

New Contributor
Posts: 4

catalog 32 bits or 64 bits

Hello Friends,



Is there a way to find out information related to a catalog on "Whether it is a 32 bit catalog or 64 bit catalog"???


I have used one macro supplied by Michel Raithel to get the info. However for few of the catalogs created on AIX Operating System.


It is giving the result which is not saying about number of bits.


Any response will be greatly appreciated.

 Case 1 : Work well to say 64 bits for one catalog created on Windows

version                            path                                 filename                             os

9.0201M0AIX             V:\Choudma7_view              formats.sas7bcat              X64_SR12R2 

Case 2 : Donot work for the catalog created on AIX. As it gives the result as

version                            path                                 filename                                     os

9.0201M0AIX             V:\Choudma7_view\temp             formats.sas7bcat               0AIX


The available macro to fetch this information As of now:

%macro cat;                                                                                                                          
%if &SYSSCP = WIN %then %let dlm=\;                                                                                                   
%else %let dlm=/;
data catver;
 retain flag 0;
 length version $120;
 infile "&fmt" lrecl=500 truncover;
 input theline $500.;
 version_loc = findc(theline,'.');                /*9.0401M4X64_SR12R2 avialble in catalog*/
 if version_loc > 0 then do;
 v = substr(theline,version_loc-1);
 if index(v,'6.') then do;
 pos2=index(v,' ');
else do;
 if version ne ' ' and flag=0 then do;
drop theline version_loc rev pos n v flag pos2;
proc print data=catver;
%mend cat;

%let fmt=V:\Choudma7_view\temp\formats.sas7bcat;                /* Provided Input   */

%cat ;


Thanks and regards,

Manoj P. Choudhary

Super User
Posts: 9,924

Re: catalog 32 bits or 64 bits

Posted in reply to ChoudharyM

At least since 9.2, SAS on AIX has been exclusively 64 bit, IIRC.

Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
New Contributor
Posts: 4

Re: catalog 32 bits or 64 bits

Posted in reply to KurtBremser

Hello KurtBremser,


Thanks for your input. However I need a approach o solve the above program(One I have suggested but showing catalog created on AIX

).Any help will be greatly appreciated.


Thanks & Regards,



Community Manager
Posts: 3,383

Re: catalog 32 bits or 64 bits

Posted in reply to ChoudharyM

Here's a simple program that works for most SAS v9x catalogs.


/* replace with path to your catalog file */
filename test "/sas/data/mypath/sasmacr.sas7bcat";
data enc (keep=encoding); 
 length encoding $ 20;
 infile test truncover scanover; 
 input @'9.0' enc $14.; 
 encoding = '9.0' || enc; 
 output; stop;

It reads the encoding signature from the catalog file -- but note that this token does not always indicate the bit architecture.  And as far as I know, there isn't a published mapping of these values to platform/architecture values supported by SAS. 


Example values you might encounter:

  • 9.0202M3Linux (9.2M3 Linux)
  • 9.0301M2Linux (9.3M2 Linux)
  • 9.0401B0W32_7PRO (9.4 Windows 32-bit)
  • 9.0401B0X64_7PRO (9.4 Windows 64-bit)


You can use this only as a cue to help determine the provenance of a particular catalog, combined with a knowledge of what operating systems are supported by which versions of SAS.

New Contributor
Posts: 4

Re: catalog 32 bits or 64 bits

Posted in reply to ChrisHemedinger

Hello Chris,


Thanks for your suggestion.Sorry for delay in response.

I got the new approach I am sharing the logic: 


Problem : Need to check whether a Catalog is created on 32 bit or 64 Bits OS and display its attributes(Like Catalog name,  SAS Version used t create, Host created, Encoding.. etc..)


Consider catalog name as :

a.SAS7bCAT ( Created on 32 Bits OS )

b.SAS7BCAT (Created on 64 Bits OS)



1 Use proc catalog to display the content of A And B catalog. (In case proc catalog is successful for A means 64 bits catalog

in another case Proc catalog with content statement will be failed for Catalog B)

2 Capture the errorCode after proc catalog in code (It will give us Syserr as 0 and 4 for catalogs which are compatible otherwise some different return code).

3 Process further catalogs which are compatible and display its contents (using the approach suggested by Michel in earlier post).





Ask a Question
Discussion stats
  • 4 replies
  • 3 in conversation