BookmarkSubscribeRSS Feed
SuryaKiran
Meteorite | Level 14

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
10 REPLIES 10
SuryaKiran
Meteorite | Level 14

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

Thanks,
Suryakiran
SuryaKiran
Meteorite | Level 14
Yes I'm sure that it is work.one dataset
Thanks,
Suryakiran
ballardw
Super User

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.

SuryaKiran
Meteorite | Level 14

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
SuryaKiran
Meteorite | Level 14

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

 

Capture.PNG

 

Thanks,
Suryakiran
ChrisHemedinger
Community Manager

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.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
SuryaKiran
Meteorite | Level 14

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
SuryaKiran
Meteorite | Level 14

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

Thanks,
Suryakiran
SuryaKiran
Meteorite | Level 14

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

Thanks,
Suryakiran

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

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
  • 10 replies
  • 2142 views
  • 0 likes
  • 4 in conversation