DATA Step, Macro, Functions and more

how to create sas7bcat file?

Reply
Contributor
Posts: 41

how to create sas7bcat file?

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.

Super User
Posts: 5,888

Re: how to create sas7bcat file?

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
Contributor
Posts: 41

Re: how to create sas7bcat file?

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

Super User
Posts: 23,776

Re: how to create sas7bcat file?


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.

Community Manager
Posts: 3,442

Re: how to create sas7bcat file?

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.

Contributor
Posts: 41

Re: how to create sas7bcat file?

Posted in reply to ChrisHemedinger

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.

Community Manager
Posts: 3,442

Re: how to create sas7bcat file?

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.

Super User
Posts: 13,583

Re: how to create sas7bcat file?


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

Contributor
Posts: 41

Re: how to create sas7bcat file?

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.

 

 

Ask a Question
Discussion stats
  • 8 replies
  • 197 views
  • 2 likes
  • 5 in conversation