BookmarkSubscribeRSS Feed
KevinViel
Pyrite | Level 9

I found this little curiousity today:

 

1589 %macro m_r_options_pagelayout

1590    ( topmargin    = 0.375in

1591    , leftmargin   = 0.750in

1592    , rightmargin  = 0.375in

1593    , bottommargin = 0.375in

1594    ) ;

1595

1596   options orientation  = portrait

1597           topmargin    = &topmargin.

1598           leftmargin   = &leftmargin.

1599           rightmargin  = &rightmargin.

1600           bottommargin = &bottommargin.

1601           ;

1602

1603 %mend m_r_options_pagelayout ;

1604

1605 options mprint ;

1606 %m_r_options_pagelayout( )

MPRINT(M_R_OPTIONS_PAGELAYOUT): options orientation = portrait topmargin = 0.375

leftmargin = 0.750 rightmargin = 0.375 bottommargin = 0.375 ;

1607

1608 options nomprint ;

1609 %put %m_r_options_pagelayout( ) ;

options orientation = portrait topmargin = 0.375in

leftmargin = 0.750in rightmargin = 0.375in bottommargin

= 0.375in

 

Notice that the MPRINT of the macro call OMITS the in (inches).  Does anyone explanation?  Note that this is not SAS stripping off IN because that is the default units for this options:

 

1621 %m_r_options_pagelayout

1622    ( topmargin = 0.375cm

1623    )

MPRINT(M_R_OPTIONS_PAGELAYOUT): options orientation = portrait topmargin = 0.375

leftmargin = 0.750 rightmargin = 0.375 bottommargin = 0.375 ;

 

 

v9.4

Operating System: WX64_SV .

 

Thank you,

 

Kevin

5 REPLIES 5
Tom
Super User Tom
Super User

It is storing the units.  It is just MPRINT output that is miss leading.

It does it with SAS 9.2 also.  

ballardw
Super User

However note that if you run Proc Options the units do appear. An interesting artifact though.

Reeza
Super User

In SAS 9.4 TS1M3 similar behaviour. 

MPRINT strips the units but they are being resolved properly via Symbolgen.

 

2
3    %macro m_r_options_pagelayout
4       ( topmargin    = 0.375in
5       , leftmargin   = 0.750in
6       , rightmargin  = 0.375in
7       , bottommargin = 0.375in
8       ) ;
9
10     options orientation  = portrait
11             topmargin    = &topmargin.
12             leftmargin   = &leftmargin.
13             rightmargin  = &rightmargin.
14             bottommargin = &bottommargin.
15             ;
16
17   %mend m_r_options_pagelayout ;
18
19   %m_r_options_pagelayout;
SYMBOLGEN:  Macro variable TOPMARGIN resolves to 0.375in
SYMBOLGEN:  Macro variable LEFTMARGIN resolves to 0.750in
SYMBOLGEN:  Macro variable RIGHTMARGIN resolves to 0.375in
SYMBOLGEN:  Macro variable BOTTOMMARGIN resolves to 0.375in
MPRINT(M_R_OPTIONS_PAGELAYOUT):   options orientation = portrait topmargin = 0.375
leftmargin = 0.750 rightmargin = 0.375 bottommargin = 0.375 ;
KevinViel
Pyrite | Level 9

See: http://www.pharmasug.org/proceedings/2016/TT/PharmaSUG-2016-TT17.pdf

 

MFILE captures the WRONG value, too:

 

%m_debug_mfile

( mcall = m_r_options_pagelayout( topmargin = 0.5cm ))

 

options orientation = portrait topmargin = 0.5 leftmargin = 0.750 rightmargin = 0.375 bottommargin = 0.375 ;

 

This would be 0.5in NOT 0.5cm, since in is the default.

Reeza
Super User

No, it gets set properly, how MPRINT displays is the issue. You can check the value of the option set:

 

%put topmargin= %sysfunc(
     getoption(topmargin));

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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