Viewing contents of catalog files in SAS Studio

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 17
Accepted Solution

Viewing contents of catalog files in SAS Studio

[ Edited ]

Hello SAS'ers,

 

I'm working with a catalog file I got from the CMS website (checking out their HCC risk model https://www.cms.gov/Medicare/Health-Plans/MedicareAdvtgSpecRateStats/Risk-Adjustors.html  After downloading and unzipping the files I came across one called "F221690P".  I managed to determine that it is a catalog file.  When I run the following code,

 

filename inf "/folders/myfolders/sasuser.v94/2017/F221690P";
libname cmshccfm "/folders/myfolders/sasuser.v94/2017";
proc cimport library=cmshccfm infile=inf;
run;

I notice a file called formats.sas7bcat appears in the file browser on the left (I'm using SAS Studio University Eddition).  I've also been able to see some high level data about the catalog using the following code,

proc catalog catalog = cmshccfm.formats;
contents stat;
run;

that produces output that looks like this ...

#       Name            Type            Create Date             Modified Date           Description                                             PgSi    BlkSi   NmBlk   LBB     LBS    Pages
1 AGEL FORMATC 09/04/2015 15:45:46 09/04/2015 15:46:21 Age should be greater or equal to the format number 4096 4096 1 405 508 1 2 AGEU FORMATC 09/04/2015 15:45:46 09/04/2015 15:46:21 Age should be less or equal to the format number 4096 4096 1 407 508 1 3 AGE_EDITS FORMATC 09/04/2015 15:45:46 09/04/2015 15:46:21 MCE AGE EDIT CATEGORIES 4096 4096 1 490 1016 1 4 FSEX FORMATC 09/04/2015 15:45:46 09/04/2015 15:46:21 SEX CATEGORIES 4096 4096 1 314 508 1 5 I0AGEY16MCE FORMATC 09/04/2015 15:46:20 09/04/2015 15:46:21 ICD10 list for MCE AGE FY 2016 EDITS 4096 4096 5 2089 2286 5 6 I0DUPV22Y16RC FORMATC 09/04/2015 15:46:20 09/04/2015 15:46:21 FY 2016 ICD10: duplicate assignments to CC V22 4096 4096 3 323 508 3 7 I0SECV22Y16RC FORMATC 09/04/2015 15:46:20 09/04/2015 15:46:21 FY 2016 ICD10: secondary assignments to CC V22 4096 4096 1 465 508 1 8 I0SEXY16MCE FORMATC 09/04/2015 15:46:21 09/04/2015 15:46:21 ICD10 list for MCE SEX FY 2016 EDITS 4096 4096 2 2275 2540 2 9 I0V22Y16RC FORMATC 09/04/2015 15:46:19 09/04/2015 15:46:21 FY 2016 ICD10 xwalk to CC V22 4096 4096 111 2256 2540 111 10 I9AGEY15MCE FORMATC 09/04/2015 15:46:02 09/04/2015 15:46:21 ICD9 list for MCE AGE FY 2015 EDITS 4096 4096 1 1503 2032 1 11 I9DUPV22Y15RC FORMATC 09/04/2015 15:46:01 09/04/2015 15:46:21 FY 2015 ICD9: duplicate assignments to CC V22 4096 4096 1 409 508 1 12 I9SEXY15MCE FORMATC 09/04/2015 15:46:02 09/04/2015 15:46:21 ICD9 list for MCE SEX FY 2015 EDITS 4096 4096 1 2653 3048 1 13 I9V22Y15RC FORMATC 09/04/2015 15:46:01 09/04/2015 15:46:21 FY 2015 ICD9 xwalk to CC V22 4096 4096 39 2706 3048 39 14 TABLE_AGE FORMATC 09/04/2015 15:45:46 09/04/2015 15:45:46 4096 4096 1 390 508 1 15 TABLE_SEX FORMATC 09/04/2015 15:45:46 09/04/2015 15:45:46 4096 4096 1 290 508 1

This seems to be equivalent to what the code snippet "List Catalog Entries" produces.   My question is how do I see the format numbers associated with these entries?  For example, the first two entries AGEU and AGEL are upper and lower age limits for a particular model.  I might be misunderstanding what is actually in this catalog file, but I feel like there is more information to see, I just dont know the commands I need to give in order to see it.  Any help appreciated! I'm attaching the file in case anyone wants to poke around on their system (note that I had to add the "txt" extension so the system would accept the upload.  in the zipfile on the CMS website the file has not extension).


Accepted Solutions
Solution
‎03-11-2017 05:09 PM
PROC Star
Posts: 7,364

Re: Viewing contents of catalog files in SAS Studio

You don't have to know or type in all of the variables. The following will also work (although you'd have to change the libname):

 

proc format lib=work.formats;
  select a-zzzzzzzz  $a-$zzzzzzzz;
run;

Art, CEO, AnalystFinder.com

 

View solution in original post


All Replies
Trusted Advisor
Posts: 1,401

Re: Viewing contents of catalog files in SAS Studio

[ Edited ]

Assuming your formats catalog is in library cmshccfm and you have the formats names 

then use next code to get the format details:

proc format lib=cmshccfm;
  select AGEL AGEU  ;    /* any format list */
run;

I have tested it with SAS UE.

Solution
‎03-11-2017 05:09 PM
PROC Star
Posts: 7,364

Re: Viewing contents of catalog files in SAS Studio

You don't have to know or type in all of the variables. The following will also work (although you'd have to change the libname):

 

proc format lib=work.formats;
  select a-zzzzzzzz  $a-$zzzzzzzz;
run;

Art, CEO, AnalystFinder.com

 

Occasional Contributor
Posts: 17

Re: Viewing contents of catalog files in SAS Studio

Thanks Art!  That does indeed expose the details I was looking for in the file.  On the off chance that anyone else is working with the CMS HCC risk models and stumbles on this question here is the full code snippet I used,

 

filename inf "/folders/myfolders/sasuser.v94/2017/F221690P";
libname cmshccfm "/folders/myfolders/sasuser.v94/2017";
proc cimport library=cmshccfm infile=inf;
run;

proc catalog catalog = cmshccfm.formats;
contents stat;
run;

proc format lib=cmshccfm.formats;
  select a-zzzzzzzz  $a-$zzzzzzzz;
run;

The output of that last "proc format" statement looks like this in SAS Studio,

 

                            ----------------------------------------------------------------------------                            
                            |       FORMAT NAME: $AGEL    LENGTH:    2   NUMBER OF VALUES:    5        |                            
                            |   MIN LENGTH:   1  MAX LENGTH:  40  DEFAULT LENGTH:   2  FUZZ:        0  |                            
                            |--------------------------------------------------------------------------|                            
                            |START           |END             |LABEL  (VER. V7|V8   04SEP2015:15:45:46)|                            
                            |----------------+----------------+----------------------------------------|                            
                            |0               |0               |0                                       |                            
                            |1               |1               |0                                       |                            
                            |2               |2               |12                                      |                            
                            |3               |3               |15                                      |                            
                            |**OTHER**       |**OTHER**       |-1                                      |                            
                            ----------------------------------------------------------------------------                            
                                                                                                                                    
                                                                                                                                    
                            ----------------------------------------------------------------------------                            
                            |       FORMAT NAME: $AGEU    LENGTH:    3   NUMBER OF VALUES:    5        |                            
                            |   MIN LENGTH:   1  MAX LENGTH:  40  DEFAULT LENGTH:   3  FUZZ:        0  |                            
                            |--------------------------------------------------------------------------|                            
                            |START           |END             |LABEL  (VER. V7|V8   04SEP2015:15:45:46)|                            
                            |----------------+----------------+----------------------------------------|                            
                            |0               |0               |0                                       |                            
                            |1               |1               |17                                      |                            
                            |2               |2               |55                                      |                            
                            |3               |3               |999                                     |                            
                            |**OTHER**       |**OTHER**       |-1                                      |                            
                            ----------------------------------------------------------------------------                            
                                                                                                                                    
                                                                                                                                    
                            ----------------------------------------------------------------------------                            
                            |                    FORMAT NAME: $AGE_EDITS LENGTH: 23                    |                            
                            |   MIN LENGTH:   1  MAX LENGTH:  40  DEFAULT LENGTH:  23  FUZZ:        0  |                            
                            |--------------------------------------------------------------------------|                            
                            |START           |END             |LABEL  (VER. 9.4     04SEP2015:15:45:46)|                            
                            |----------------+----------------+----------------------------------------|                            
                            |0               |0               |0 newborn (age 0)                       |                            
                            |1               |1               |1 pediatric (age 0 -17)                 |                            
                            |2               |2               |2 maternity (age 12-55)                 |                            
                            |3               |3               |3 adult (age 14+)                       |                            
                            |**OTHER**       |**OTHER**       |                                        |                            
                            ---------------------------------------------------------------------------- 

Follow up question, would it be possible to dump this to some form of human readable file (csv perhaps)?  Actually I suppose I could simply copy and paste this plain text from the SAS Studio "Results" page, but would be geat to have it dumped to a file.

Occasional Contributor
Posts: 17

Re: Viewing contents of catalog files in SAS Studio

Actually, I should have looked at the SAS Studio interface for more than a few seconds.  There are buttons to download in html, rtf, and pdf.

PROC Star
Posts: 7,364

Re: Viewing contents of catalog files in SAS Studio

Alternatively, you could download it to a SAS dataset. Then you could change it, run it, and/or export it to a csv or whatever kind of file you want. e.g.:

 

proc format lib=work.formats cntlout=want;;
  select a-zzzzzzzz  $a-$zzzzzzzz;
run;

Art, CEO, AnalystFinder.com

 

 

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 154 views
  • 1 like
  • 3 in conversation