LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (January 2002, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 22 Jan 2002 16:29:36 +0100
Reply-To:   Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Subject:   strange behaviour with %NRBQUOTE
Content-Type:   text/plain

Hallo all,

I'm back on the list after a rather long time. Let me jump back in with a rather complicated problem. It concerns the use of the macro function %NRBQUOTE.

I developed a (complicated) program using several (complicated) macros, one of which a.o. processes (i.e. changes) the contents of arbitrary variable labels. By itself this is not the problem, but as variable labels may have quite a lot of characters, which have (or may have) specific meanings within a macro (like &, %, etc.), a macro variable (e.g. &VarLabel), containing the contents of a

variable label must be referenced using the %NRBQUOTE macro function in order to avoid the unwanted interpretation of any character within the label, e.g. %NRBQUOTE(&VarLabel). Doing so works fine and without problems.

Now, instead of applying the function NRBQUOTE each time where the &VarLabel is being referenced, I looked for a shorter, more elegant solution by defining the macro variable &VarLabel once as its uninterpreted NRBQUOTEd result: %LET VarLabel = %NRBQUOTE (&VarLabel); and referencing it further without specifying the macro function each time, thus just by specifying &VarLabel. A test program (see below) has shown this to work all right. However, it appeares that applying my program, processing datasets, with the adapted macro it eats disk space indefinitely, until disk space has been used completely and the program halts, without having produced the desired output. Viewing the work directory (in another window) does not show some internal scratch file to grow indefinitely, neither some file of size 0 which may be open and filled, it only shows decreasing free disk space. The log file reports repeately: ERROR: Maximum level of nesting of macro functions exceeded.

This is quite a surprise to me and I cannot give a simplified and straightforward example showing the phenomenon. I can only ask for some general hints as to what I may be doing wrong or what SAS is doing using such a construct. I have added the test program, which runs fine, below and the output of DOS' FC (file compare) as well, that shows the only differences between the original macro and the adapted one. Of course I can live with the original, correctly working construct, but I would like to know why the adapted construct behaves as it does. I am still using SAS 6.12.

TIA.

Regards - Jim. -- Y. (Jim) Groeneveld, MSc IMRO TRAMARKO tel. +31 412 407 070 senior statistician, P.O. Box 1 fax. +31 412 407 080 senior data manager 5350 AA BERGHEM IMRO TRAMARKO: a CRO J.Groeneveld@ITGroups.com the Netherlands in clinical research

My computer has no idea what I am doing; sometimes the reverse also applies.

Notice of confidentiality: this e-mail may contain confidential information intended for the addressed recipient only. If you have received this e-mail in error please delete this e-mail and please notify the sender so that proper delivery can be arranged.


Back to: Top of message | Previous page | Main SAS-L page