I need to create sas catalog file. But only thing I can find is proc catalog, which seems like manage catalog file but not create it. How to create a sas7bcat file?
Thank you for your help.
A catalogue by itself is quite useless without any entireties in it.
A catalogue is automatically created when you create an entry, like a format.
???? where is it saved? I need to use it to run R.
@mhollifi wrote:
???? where is it saved? I need to use it to run R.
What part of the catalog do you need for R?
If you need the formats for example, it's better to output those to a table and let R use that instead. PROC FORMAT with CNTLOUT will allow you to do this.
I don't know why a sas7bcat (catalog file) would be needed to run R. The only catalog entry of consequence in this scenario, I think, is a SAS format. A SAS format contains the rules for categorizing ranges of data values or creating an appearance format.
Some R packages can read sas7bdat (data sets) and sas7bcat (catalogs) -- that's what I hear, anyway. Catalogs are especially tricky, as they are very specific to the operating system and architecture. As @Reeza suggests, it's probably best to save that out as data anyway.
Well, I only want to know how to create sas7bcat file.
You didn't tell me how.
I cannot find from the manual.
I cannot find from Google.
Why there is no documentation?
If it's create automatically, then I guess, it will deleted automatically when the sas finished running. So how to save it permanently?
Thank you.
This SAS code will create one for you -- a minimum viable catalog file. Change the path as needed. The file will land in the path you specify as formats.sas7bcat.
libname catout 'c:\temp';
proc format lib=catout;
value min 1-10 = 'Lower';
run;
But -- curious what your next step will be with this.
proc gchart data=sashelp.class gout=work.graphcat; vbar age; run;@mhollifi wrote:
Well, I only want to know how to create sas7bcat file.
You didn't tell me how.
I cannot find from the manual.
I cannot find from Google.
Why there is no documentation?
If it's create automatically, then I guess, it will deleted automatically when the sas finished running. So how to save it permanently?
Thank you.
If you do not know what kind of entries your "catalog" needs then I suspect more problems down the line.
To create a catalog with Pmenu entries:
libname proclib 'SAS-data-library'; proc pmenu catalog=proclib.mycat; menu menu1; item end; item bye; run; menu menu2; item end; item pgm; item log; item output; run;
With macro entries in catalog work.sasmacr most likely though can be specified on the %macro statement.
%macro dummy(); %put This is a dummy macro.; %mend;
With graphic entries (any of Gplot G3d Gmap us this approach):
proc gchart data=sashelp.class gout=work.graphcat; vbar age; run;
and several other procedures such as Proc Build in SAS/AF or FSP
Proc gdevice catalog=library.catname ;
Proc Template
I finally figured out.
There is a file called "formats" in my work library. I copied it to my hard drive, and read it using R. It worked.
Thank you for your help. I figured out the concept.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.