Desktop productivity for business analysts and programmers

Output SAS Dataset not displaying used defined format

Reply
Frequent Contributor
Posts: 128

Output SAS Dataset not displaying used defined format

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.


Proc print.PNGSAS dataset.PNG
Thanks,
Suryakiran
Super User
Posts: 7,447

Re: Output SAS Dataset not displaying used defined format

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Frequent Contributor
Posts: 128

Re: Output SAS Dataset not displaying used defined format

Yes! I'm Sure it is work.one dataset.

Thanks,
Suryakiran
Frequent Contributor
Posts: 128

Re: Output SAS Dataset not displaying used defined format

Yes I'm sure that it is work.one dataset
Thanks,
Suryakiran
Super User
Posts: 11,134

Re: Output SAS Dataset not displaying used defined format

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.

Frequent Contributor
Posts: 128

Re: Output SAS Dataset not displaying used defined format

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 ?

 

Thanks,
Suryakiran
Frequent Contributor
Posts: 128

Re: Output SAS Dataset not displaying used defined format

When I run proc contents variable sex has $se. format.

 

Capture.PNG

 

Thanks,
Suryakiran
Community Manager
Posts: 2,889

Re: Output SAS Dataset not displaying used defined 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.

Frequent Contributor
Posts: 128

Re: Output SAS Dataset not displaying used defined format

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.

 

Capture1.PNG

 

 

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;

 

Capture2.PNG

 

proc catalog c=gridwork.formats;

contents;

run;

Capture3.PNG

 

Still the same issue.

 

Thanks,
Suryakiran
Frequent Contributor
Posts: 128

Re: Output SAS Dataset not displaying used defined format

Still I didn't get solution for this.Smiley Sad

Thanks,
Suryakiran
Frequent Contributor
Posts: 128

Re: Output SAS Dataset not displaying used defined format

It didn't work. Still have the same problem.

Thanks,
Suryakiran
Ask a Question
Discussion stats
  • 10 replies
  • 441 views
  • 0 likes
  • 4 in conversation