The macro does not directly process external data or SASHELP data. It operates on system options and uses automatic macro variables (`&sysscp`, `&sysver`) for its internal logic. The values applied to the FORMCHAR option are constants defined within the macro.
1 Code Block
MACRO
Explanation : This block defines the FORMCHAR macro. It starts with conditional checks to ensure the code is executed under Windows (`%if &sysscp ^= WIN`) and with a compatible SAS version (6.11 or higher, `%if &sysver < 6.11`). If these conditions are not met, error messages are displayed. Then, the `chartype` parameter is converted to uppercase (`%upcase`). Conditional `%if/%else %if` statements are used to determine the value to assign to the `FORMCHAR` system option. If `chartype` matches 'STANDARD' (or 'STD', 'ASCII'), ASCII characters are used. If `chartype` matches 'LINEDRAW' (or 'LINE', 'DRAW'), a specific hexadecimal string is assigned. Any other argument results in an error message.
Copied!
/* Select either "standard" or "linedraw" characters for FORMCHAR */
%macro formchar ( chartype /* STANDARD or LINEDRAW */
) ;
/* ------------------------------------------------------------
MODULE: FORMCHAR
PURPOSE: Resets the value of the FORMCHAR system option
to use either "linedraw" characters from the SAS
Monospace font or "standard" characters (+- etc.)
for box characters in TABULATE and other PROCs.
Generates an OPTIONS statement and may be used
wherever that is accepted.
CLASS: General SAS statement.
USAGE: %FORMCHAR(LINEDRAW)
PARAMETERS: R chartype Must be either
LINEDRAW, LINE, DRAW or
STANDARD, STD, ASCII
SIDE EFFECTS: None.
SYSTEMS: Windows, 6.11 and higher.
HISTORY: 25feb96 MDR
DOCUMENT: Here.
SUPPORT: Mike Rhoads <rhoadsm1 @westat.com>
------------------------------------------------------------
*/
%if &sysscp ^= WIN %then
%put ERROR: The FORMCHAR macro is only available under Windows.;
%else %if &sysver < 6.11 %then
%put ERROR: The FORMCHAR macro is not available for versions prior to 6.11.;
%else %do;
%let chartype = %upcase(&chartype);
%if %index(STD STANDARD ASCII,&chartype)>0 %then %do;
OPTIONS FORMCHAR = '|----|+|---+=|-/\<>*';
%end;
%else %if %index(LINEDRAW,&chartype)>0 %then %do;
OPTIONS FORMCHAR = '82838485868788898A8B8C2B3D7C2D2F5C3C3E2A'X;
%end;
%else
%put ERROR: Argument to FORMCHAR must be LINEDRAW or STANDARD.;
%end;
%mend FORMCHAR ;
1
/* Select either "standard" or "linedraw" characters for FORMCHAR */
2
%macro formchar ( chartype /* STANDARD or LINEDRAW */
%put ERROR: Argument to FORMCHAR must be LINEDRAW or STANDARD.;
44
%END;
45
46
%mend FORMCHAR ;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Copyright Info : Creator: MDR, February 25, 1996. Support: Mike Rhoads <rhoadsm1 @westat.com>
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.