BookmarkSubscribeRSS Feed
pacman94
Calcite | Level 5

Hello. I have a bunch of datasets in a library called: 'TrialData'. I have the format library stored in the 'TrialData' as well. 

However, when I try to apply the format in the same 'TrialData' library, it doesn't work. I have to save them under 'Work' library. Is there any way it can be fixed? Thanks!

 

PROC FORMAT LIBRARY=TrialData;

VALUE Assessment 1='Yes' 0='No' 99 ='Missing or not reported';

VALUE CommitmentStatus 1='Yes' 0='No' 99 = 'Missing or not reported;

RUN;

 

Applying format to one of the datasets = Dataset1

DATA TrialData.Dataset1; SET TrialData.Dataset1;

FORMAT Assessment Assessment.

CommitmentStatus CommitmentStatus .;

RUN;

 

It doesn't work. It only works if I load the format in the Work library

 

Thanks so much!

1 REPLY 1
Tom
Super User Tom
Super User

You have to tell SAS where to LOOK for formats.

Change the FMTSEARCH system option to include your new format catalog.  Since you didn't tell PROC FORMAT what name to use for the catalog it used FORMATS.  So you want to add either the libref TrialData to the search path or the catalog TrialData.formats.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 891 views
  • 0 likes
  • 2 in conversation