BookmarkSubscribeRSS Feed
Aexor
Lapis Lazuli | Level 10

Please explain working of proc format.

My question is does this user defined format permanently assigned to variables ? 

Suppose if I used format, created by proc format , we if load/transfer the same variable/data to a different location. 

will the format applies using Proc format is applicable or something else?

1 REPLY 1
Tom
Super User Tom
Super User

You use PROC FORMAT to define the formats (or informats).  The format lives in a format catalog independent from any datasets.

 

You can permanently attach a format to a variable in a dataset by using the FORMAT statement in the step that creates the dataset.  But that is just the NAME of the format you want to use with that variable.  The actual format itself lives in a format catalog.  For SAS to find and use the format you need to use the FMTSEARCH option to tell it which format catalogues to search for user defined formats.

 

Format catalogs are not as easy to port from one SAS instance to another as datasets (look at PROC CPORT and PROC CIMPORT). If you want to share the definition of the formats used by your data with someone it is best to send them the SAS code that creates the formats so they can run it on their SAS instance to create a format catalog that is compatible.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 589 views
  • 1 like
  • 2 in conversation