DATA Step, Macro, Functions and more

cntlout numeric informat label loses precision

Reply
Valued Guide
Posts: 2,177

cntlout numeric informat label loses precision

I've also opened a track on this question

How can I persuade proc format to report (through FMTLIB and CNTLOUT) the full precision of the label returned for a numeric informat range?

With this code you can demonstrate the problem:

proc format cntlout= cntlo ;    

   invalue testrat XXX = 1.23456789 ;

   select @testrat ;

run ;

option nocenter ;

title 'testing cntlout label precision for numeric informat';

title4 "LABEL should be 1.23456789 found %sysfunc( inputn( XXX, testrat ))" ;

proc print width= full ;

     id   fmtname start label ;

run ;

proc print width=full ;

     var fmtname start label ;

     format label $hex30. ;

run ;

I am running SAS9.2 on unix so it would be nice to hear if your platform performs better

The major concern I have is the confidence we assume  migrating a format catalog between SAS releases and platforms using CNTLOUT on the old platform and CNTLIN on the new.

hth

peterC

Respected Advisor
Posts: 3,799

Re: cntlout numeric informat label loses precision

I ran your program on windows

AUTOMATIC SYSSCP WIN

AUTOMATIC SYSSCPL W32_VSPRO

AUTOMATIC SYSVER 9.2

AUTOMATIC SYSVLONG 9.02.02M0P011509

AUTOMATIC SYSVLONG4 9.02.02M0P01152009

On windows the LABEL variable is $40 and the value is right justified.  $hex30 is not wide enough to display the value.

The title with INPUT function returns this....

LABEL should be 1.23456789 found 1.23456789

What do you get?

Valued Guide
Posts: 2,177

cntlout numeric informat label loses precision

Posted in reply to data_null__


data_null_;

thank you for looking at my problem.

my result _was_ a label value, left-aligned, formatted with (I think) best3. (or perhaps best2. ) showing never more than one decimal place.

Starting afresh - in a new sas enterprise guide session, the proper behaviour was restored.  (I'll have to get used to making that kind of re-start more often)

Peter

Ask a Question
Discussion stats
  • 2 replies
  • 151 views
  • 3 likes
  • 2 in conversation