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;
n=anyalpha(substr(theline,version_loc));
v = substr(theline,version_loc-1);
rev=reverse("&fmt");
path=reverse(substr(rev,index(rev,"&dlm")+1));
filename=scan("&fmt",-1,'\/');
if index(v,'6.') then do;
pos=index(v,'CATALOG');
pos2=index(v,' ');
version=substr(v,1,pos2);
os=substr(v,pos+8,12);
end;
else do;
pos=anyalpha(v);
version=substr(v,1,pos+1);
os=substr(v,pos+2,10);
end;
if version ne ' ' and flag=0 then do;
output;
flag=1;
end;
end;
drop theline version_loc rev pos n v flag pos2;
run;
proc print data=catver;
run;
%mend cat;
%let fmt=V:\Choudma7_view\temp\formats.sas7bcat; /* Provided Input */
%cat ;
Thanks and regards,
Manoj P. Choudhary
At least since 9.2, SAS on AIX has been exclusively 64 bit, IIRC.
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,
Manoj
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;
run;
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:
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.
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)
Logic
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).
Thanks,
Manoj
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.