Desktop productivity for business analysts and programmers

Output SAS Dataset not displaying used defined format

Reply
PROC Star
Posts: 626

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: 10,552

Re: Output SAS Dataset not displaying used defined format

Posted in reply to SuryaKiran

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
How to convert datasets to data steps
How to post code
PROC Star
Posts: 626

Re: Output SAS Dataset not displaying used defined format

Posted in reply to KurtBremser

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

Thanks,
Suryakiran
PROC Star
Posts: 626

Re: Output SAS Dataset not displaying used defined format

Posted in reply to KurtBremser
Yes I'm sure that it is work.one dataset
Thanks,
Suryakiran
Super User
Posts: 13,913

Re: Output SAS Dataset not displaying used defined format

Posted in reply to SuryaKiran

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 Star
Posts: 626

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
PROC Star
Posts: 626

Re: Output SAS Dataset not displaying used defined format

Posted in reply to SuryaKiran

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

 

Capture.PNG

 

Thanks,
Suryakiran
Community Manager
Posts: 3,454

Re: Output SAS Dataset not displaying used defined format

Posted in reply to SuryaKiran

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.

PROC Star
Posts: 626

Re: Output SAS Dataset not displaying used defined format

Posted in reply to ChrisHemedinger

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
PROC Star
Posts: 626

Re: Output SAS Dataset not displaying used defined format

Posted in reply to SuryaKiran

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

Thanks,
Suryakiran
PROC Star
Posts: 626

Re: Output SAS Dataset not displaying used defined format

Posted in reply to ChrisHemedinger

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

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