BookmarkSubscribeRSS Feed
thanikondharish
Fluorite | Level 6

proc printto print='D:\pha\ex1.log';
run;

OPTIONS FORMCHAR='I----l+l---+=I-/\<>*' ;
proc freq data=sashelp.class ;
run;
proc printto;
run;

 

 

when i run this program it gives worng line boraders how to fix that boarders

 

3 REPLIES 3
Kurt_Bremser
Super User

Looks OK to me:

                                                         The FREQ Procedure

                                                                        Cumulative    Cumulative
                                    Name       Frequency     Percent     Frequency      Percent
                                    ------------------------------------------------------------
                                    Alfred            1        5.26             1         5.26  
                                    Alice             1        5.26             2        10.53  
                                    Barbara           1        5.26             3        15.79  
                                    Carol             1        5.26             4        21.05  
                                    Henry             1        5.26             5        26.32  
                                    James             1        5.26             6        31.58  
                                    Jane              1        5.26             7        36.84  
                                    Janet             1        5.26             8        42.11  
                                    Jeffrey           1        5.26             9        47.37  
                                    John              1        5.26            10        52.63  
                                    Joyce             1        5.26            11        57.89  
                                    Judy              1        5.26            12        63.16  
                                    Louise            1        5.26            13        68.42  
                                    Mary              1        5.26            14        73.68  
                                    Philip            1        5.26            15        78.95  
                                    Robert            1        5.26            16        84.21  
                                    Ronald            1        5.26            17        89.47  
                                    Thomas            1        5.26            18        94.74  
                                    William           1        5.26            19       100.00  


                                                                      Cumulative    Cumulative
                                      Sex    Frequency     Percent     Frequency      Percent
                                      --------------------------------------------------------
                                      F             9       47.37             9        47.37  
                                      M            10       52.63            19       100.00  


                                                                      Cumulative    Cumulative
                                      Age    Frequency     Percent     Frequency      Percent
                                      --------------------------------------------------------
                                       11           2       10.53             2        10.53  
                                       12           5       26.32             7        36.84  
                                       13           3       15.79            10        52.63  
                                       14           4       21.05            14        73.68  
                                       15           4       21.05            18        94.74  
                                       16           1        5.26            19       100.00   

                                                         The FREQ Procedure

                                                                       Cumulative    Cumulative
                                    Height    Frequency     Percent     Frequency      Percent
                                    -----------------------------------------------------------
                                      51.3           1        5.26             1         5.26  
                                      56.3           1        5.26             2        10.53  
                                      56.5           1        5.26             3        15.79  
                                      57.3           1        5.26             4        21.05  
                                      57.5           1        5.26             5        26.32  
                                        59           1        5.26             6        31.58  
                                      59.8           1        5.26             7        36.84  
                                      62.5           2       10.53             9        47.37  
                                      62.8           1        5.26            10        52.63  
                                      63.5           1        5.26            11        57.89  
                                      64.3           1        5.26            12        63.16  
                                      64.8           1        5.26            13        68.42  
                                      65.3           1        5.26            14        73.68  
                                      66.5           2       10.53            16        84.21  
                                        67           1        5.26            17        89.47  
                                        69           1        5.26            18        94.74  
                                        72           1        5.26            19       100.00  


                                                                       Cumulative    Cumulative
                                    Weight    Frequency     Percent     Frequency      Percent
                                    -----------------------------------------------------------
                                      50.5           1        5.26             1         5.26  
                                        77           1        5.26             2        10.53  
                                        83           1        5.26             3        15.79  
                                        84           2       10.53             5        26.32  
                                      84.5           1        5.26             6        31.58  
                                        85           1        5.26             7        36.84  
                                        90           1        5.26             8        42.11  
                                        98           1        5.26             9        47.37  
                                      99.5           1        5.26            10        52.63  
                                     102.5           2       10.53            12        63.16  
                                       112           2       10.53            14        73.68  
                                     112.5           2       10.53            16        84.21  
                                       128           1        5.26            17        89.47  
                                       133           1        5.26            18        94.74  
                                       150           1        5.26            19       100.00  
ballardw
Super User

@thanikondharish wrote:

proc printto print='D:\pha\ex1.log';
run;

OPTIONS FORMCHAR='I----l+l---+=I-/\<>*' ;
proc freq data=sashelp.class ;
run;
proc printto;
run;

 

 

when i run this program it gives worng line boraders how to fix that boarders

 


You don't describe what "wrong" looks like but I going to guess that you get something with very odd characters.

The "problem" is the font used to look at the result. Those characters in FORMCHAR are high order ASCII, with values above 127 and there is no standard for what those represent. So if you look at the result in a program that uses a different font you can get different appearance. Change fonts or change formchar.

That is one of the reasons SAS spent a lot of time developing ODS output so that such appearance issues are not critical.

From my SASV9.cfg

/* This is the ANSI character set (for SAS Monospace font and ANSI Sasfont) */
-FORMCHAR '82838485868788898A8B8C2B3D7C2D2F5C3C3E2A'x

note that this explicitly states which fonts the characters will work with (and draws much nicer boxes that the characters you are using when I use SASFONT of SAS Monospace)

 

 

I would suggest learning to use ODS destinations OR specifying a FORMCHAR option that works with the FONT you are going to use.

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

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1098 views
  • 0 likes
  • 4 in conversation