BookmarkSubscribeRSS Feed
Pyrite | Level 9



I have written a huge proc-format-code and used it for value-labeling a specific dataset. Afterwards I wanted to save the labled dataset in my companys network, so each colleague can use the final result. But within the dataset it didnt save the proc-format-definitions (value labels). How can I save them into the dataset?

I red, that one can reuse proc-format-definitions, if they are saved in a sas-catalog; is that right? Does that mean, that the definitions are saved locally on my pc and not within the dataset? So I always have to share my dataset AND the proc-format-syntax?

Diamond | Level 26

The best solutions for allowing colleagues to use the data set:


  • provide them with the PROC FORMAT code
  • provide them with a format library (along with the data set) and instructions on how to use it
  • have colleagues use the option NOFMTERR, but then they will only see the unformatted values
Paige Miller
Super User Tom
Super User

You are right. The definition of the formats is NOT stored in the dataset.  All that is stored in the dataset is the format specification itself.  That is the NAME of the format.  The Width to use (if specified).  The number of Decimal places to use (if specified).


To share the format definitions you can either store them into a format catalog.  That will work as long as the users of the formats are using the same version of SAS (same operating system, same SAS version number, same bitness of the SAS 32 vs 64 bit).  The users will need to have that format catalog listed in the search path specified by the FMTSEARCH option to be able to use the format catalog.


To share the format definition in a way that is more portable you could either share the SAS code that creates the format(s).  Or share the SAS dataset generated by the CNTLOUT= option of PROC FORMAT.  That way the user can recreate the format catalog on any version of SAS.


FORMATS are more general (and powerful) then "value-labels".  They are instructions for how to convert values into text.  In systems, like SPSS, that store value labels in the data you have to specify the code/decode pairs for similarly coded variables over and over again.  With a FORMAT you can use the same format with many different variables across many different datasets.

Pyrite | Level 9

Okay, thank you for your help. To be honest: It sounds a bit cumbersome to me if you always have to think about the dataset and the syntax or catalog at the same time. But well, maybe I'll discover advantages from this (compared to SPSS or Stata for example).



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 3 in conversation