home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!gatech!paladin.american.edu!auvm!SWIRL.MONSANTO.COM!GIBES
- Message-ID: <9209111538.AA01822@tin.monsanto.com>
- Newsgroups: bit.listserv.sas-l
- Date: Fri, 11 Sep 1992 10:38:51 -0500
- Reply-To: Kernon Gibes <gibes@SWIRL.MONSANTO.COM>
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: Kernon Gibes <gibes@SWIRL.MONSANTO.COM>
- Subject: RE: Response - Creating a long macro variable.
- Comments: To: SAS-L@uga.cc.uga.edu@tin.monsanto.com
- Comments: cc: GIBES@tin.monsanto.com
- Lines: 63
-
- Regarding Perry's posting...
-
- >Regarding Kernon Gibes' [sic] comments on Bob Snyder's response to the looong
- >macro variable question, yes Bob's suggestion does work. (See test below
- >run successfully under VM/CMS.) According to the SAS Guide to Macro
- >Processing V5, Appendix 2, the max length of the macro variable is
- >controlled by the MWORK= system option with a default of 2k (2048 bytes)
- >and max value of 28k. I agree with Bob, however, that there must be a
- >more elegant solution than concatenating a huge macro variable.
- >Regardless, his code works fine.
- >
- <stuff deleted>
-
- 1) Yes, I was wrong about the limit on macro variable lengths.
-
- 2) No, Bob's code does not work fine. Try testing it on the ACTUAL
- situation; that is, where POSSANS has length of 200 characters.
- (Or, say, two records of 150 each). Perry's test case does work,
- but it wasn't what Helen was dealing with. For example, see the
- extension of Perry's code below where we finally get truncation.
-
- 3) Bob's code didn't include a COMPRESS, which was my second point.
- However, this doesn't solve all the problems because the character
- string expression in the second argument of SYMPUT is, I believe,
- subject to the 200 byte limit imposed on data set character
- variables [ hopefully, I have this limit correct? ;-) ]
-
- Kernon Gibes
-
-
- Modified test code:
-
- Data temp;
- Input varnum $ possans $;
- cards;
- 01 Jack
- 02 and
- 03 Jill
- 04 ran
- 05 up
- 06 the
- 07 hill
- ;
- Run;
-
- data longer;
- set temp temp temp temp temp temp temp temp temp temp temp;
- run;
-
- %let mvar = ;
- Data test;
- set longer;
- Call Symput('mvar',Symget('mvar')||' '||compress(possans));
- Run;
-
- %put mvar = &mvar; run;
- /*** end of test code ***/
-
- Produces:
-
- mvar = Jack and Jill ran up the hill Jack and Jill ran up the hill Jack and
- Jill ran up the hill Jack and Jill ran up the hill Jack and Jill ran up the
- hill Jack and Jill ran up the hill Jack and Jill ran u
-