BookmarkSubscribeRSS Feed
rking
Calcite | Level 5
I changed the format on an column in Management Console from none to 14. in an Oracle table in the metadata respository. When I look at the data in EG the format used is 12.. After importing the data into metadata respository I thought I could assign formats so that all users can see the data in the best format. Is there an additional step that I have to do?

rking
8 REPLIES 8
deleted_user
Not applicable
When printed, is the numeric value a 12 part number? Or are you seeing the number converted to scientific notation or truncated?

If I use a 14. format on 123,456,789. then it will appear as I typed it, which is a 12 position format. This is correct behaviour, not a problem.

Kind regards

David
rking
Calcite | Level 5
The number is a 14 digit number that is being displayed in scientific notation.

rking
deleted_user
Not applicable
Displayed in what? If it is a reporting procedure, then try to assign the format manually to the step code to verify there is enough screen real estate to display the number as requested.

If it is a table viewer, then I seem to recall the ViewTable object is still limited to around 8 places in its numeric format display.

Kind regards

David
deleted_user
Not applicable
This is confusing.

At first you said the number was being displayed as 12. but now you are saying it is 14 characters of scientific notation. Which is it?

If you define the format to be 14. and the is only 10000, then that is what you will see, and depending on the output media (html, line printer, etc.) you may not see the leading spacing to make it 14 characters wide.

if you define the format to be 6. and the number is 123456789 SAS will print/display it as 1.23E8

[pre]
data dummy;
format dummy 6.;
dummy = 1; output;
dummy = 12; output;
dummy = 123; output;
dummy = 1234; output;
dummy = 12345; output;
dummy = 123456; output;
dummy = 1234567; output;
dummy = 12345678; output;
dummy = 123456789; output;
run;
quit;

proc print;
run;
quit;

1 1
2 12
3 123
4 1234
5 12345
6 123456
7 1.23E6
8 1.23E7
9 1.23E8

[/pre]
rking
Calcite | Level 5
Let me clarify. I have a numeric column named batch_load_timestamp in a oracle table that is always 14 digits long. In Management Console in the metadata respository the format was blank by default so I changed it to "14.". When I open the dataset from the server list in EG the column is displayed in scientific notation. The properites window show the format as "BEST12.0". EG appears to ignore the change I made in Management Console. I can user the query builder in EG and change the format to 14. and it displays correctly in the resulting dataset.

rking
deleted_user
Not applicable
Ah, the mysteries of the MetaData server. It is constantly challenging my perception of reality as well. I think SAS over complicated itself into a royal mess with that thing. In my ignorant opinion, I believe some developers (technician minds) went wild without proper engineering design control.
ChrisHemedinger
Community Manager
Changing the format in metadata may not be enough. If EG is opening the data using the META engine (which sees things through the filter of metadata), then your format would be applied. However, if this is a preassigned library that EG is reading with the native library engine (ORACLE), then the database attributes of the "live" data are used -- the metadata attributes don't affect it.

Chris
SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
rking
Calcite | Level 5
When I removed preassigning the library, the format was applied correctly. Thanks for the help!

rking

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 1505 views
  • 0 likes
  • 3 in conversation