Hi,
I created user defined format and used it in data step. When I used Proc Print it shows the formated values. Where as when I open the created dataset it doesn't show the formated values.
/* I ran Proc Format first */
Proc format;
value $se 'M'='Male'
'F'='Female';
Run;
/* After running proc format used it in data step */
data work.one;
format sex $se.;
set sashelp.class;
run;
It was under one session. I attached the dataset and Proc print output. By the way I'm using SAS Enterprise guide 5.1 (5.100.0.12019) (32-bit) running on unix grid with sas 9.3.
Are you sure you displayed work.one and not sashelp.class?
Because here your code worked and the viewtable in EG displayed the formatted value.
Yes! I'm Sure it is work.one dataset.
Assuming that your proc format code ran and placed the format catalog in the WORK directory, have you run the proc format code today? The Work library gets emptied including formats when SAS is shutdown.
Also you can run
Proc options group=envfiles;
run;
And see if WORK is the FMTSEARCH parameter. Look in the log for the results.
proc format library=WORK;
value $se 'M'='Male'
'F'='Female';
Run;
options fmtsearch=(Work RMTWORK);
Data one;
format sex $se. ;
set sashelp.class;
run;
proc options group=envfiles;
run;
I ran the above code in same session but my problem is still same.
For proc options group=envfiles;
/*mylog shows */
FMTSEARCH=(WORK RMTWORK)
List of catalogs to search for formats and informats.
It's taking format values when I use proc print. Is this a bug in SAS EG 5.1 ?
When I run proc contents variable sex has $se. format.
If you're running on a SAS Grid environment, the WORK location can be different for different grid nodes. You should have the concept of a "shared work" (gridwork) library where you can store your format and other data that needs to be shared/accessible across grid nodes.
SAS Grid and EG have better integration in later versions, but if using EG 5.1 then this paper might help.
I'm running on grid and GRIDWORK library is present and no local SAS installed. My SAS Eg is running on grid all the time.
proc format library=GRIDWORK;
value $se 'M'='Male'
'F'='Female';
Run;
options fmtsearch=(GRIDWORK work RMTWORK);
Data one;
format sex $se. ;
set sashelp.class;
run;
proc options group=envfiles;
run;
proc catalog c=gridwork.formats;
contents;
run;
Still the same issue.
Still I didn't get solution for this.
It didn't work. Still have the same problem.
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!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.