BookmarkSubscribeRSS Feed
ChoudharyM
Fluorite | Level 6

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

4 REPLIES 4
ChoudharyM
Fluorite | Level 6

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

 

ChrisHemedinger
Community Manager

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:

  • 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.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
ChoudharyM
Fluorite | Level 6

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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 4 replies
  • 1268 views
  • 0 likes
  • 3 in conversation