BookmarkSubscribeRSS Feed
mhollifi
Obsidian | Level 7

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.

8 REPLIES 8
LinusH
Tourmaline | Level 20

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.

Data never sleeps
mhollifi
Obsidian | Level 7

????  where is it saved?  I need to use it to run R.

Reeza
Super User

@mhollifi wrote:

????  where is it saved?  I need to use it to run R.


What part of the catalog do you need for R? 

http://documentation.sas.com/?docsetId=lrcon&docsetTarget=p01gryeviu67qwn1m9wue2t0k8sk.htm&docsetVer...

 

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.

ChrisHemedinger
Community Manager

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.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
mhollifi
Obsidian | Level 7

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.

ChrisHemedinger
Community Manager

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.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
ballardw
Super User

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

mhollifi
Obsidian | Level 7

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.

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 8 replies
  • 5239 views
  • 2 likes
  • 5 in conversation