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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 847 views
  • 0 likes
  • 2 in conversation