home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / bit / listserv / sasl / 4159 < prev    next >
Encoding:
Text File  |  1992-09-11  |  2.4 KB  |  77 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!gatech!paladin.american.edu!auvm!SWIRL.MONSANTO.COM!GIBES
  3. Message-ID: <9209111538.AA01822@tin.monsanto.com>
  4. Newsgroups: bit.listserv.sas-l
  5. Date:         Fri, 11 Sep 1992 10:38:51 -0500
  6. Reply-To:     Kernon Gibes <gibes@SWIRL.MONSANTO.COM>
  7. Sender:       "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  8. From:         Kernon Gibes <gibes@SWIRL.MONSANTO.COM>
  9. Subject:      RE: Response - Creating a long macro variable.
  10. Comments: To: SAS-L@uga.cc.uga.edu@tin.monsanto.com
  11. Comments: cc: GIBES@tin.monsanto.com
  12. Lines: 63
  13.  
  14. Regarding Perry's posting...
  15.  
  16. >Regarding Kernon Gibes' [sic] comments on Bob Snyder's response to the looong
  17. >macro variable question, yes Bob's suggestion does work.  (See test below
  18. >run successfully under VM/CMS.)  According to the SAS Guide to Macro
  19. >Processing V5, Appendix 2, the max length of the macro variable is
  20. >controlled by the MWORK= system option with a default of 2k (2048 bytes)
  21. >and max value of 28k.  I agree with Bob, however, that there must be a
  22. >more elegant solution than concatenating a huge macro variable.
  23. >Regardless, his code works fine.
  24. >
  25. <stuff deleted>
  26.  
  27. 1) Yes, I was wrong about the limit on macro variable lengths.
  28.  
  29. 2) No, Bob's code does not work fine.  Try testing it on the ACTUAL
  30.    situation; that is, where POSSANS has length of 200 characters.
  31.    (Or, say, two records of 150 each).  Perry's test case does work,
  32.    but it wasn't what Helen was dealing with.  For example, see the
  33.    extension of Perry's code below where we finally get truncation.
  34.  
  35. 3) Bob's code didn't include a COMPRESS, which was my second point.
  36.    However, this doesn't solve all the problems because the character
  37.    string expression in the second argument of SYMPUT is, I believe,
  38.    subject to the 200 byte limit imposed on data set character
  39.    variables [ hopefully, I have this limit correct?  ;-) ]
  40.  
  41. Kernon Gibes
  42.  
  43.  
  44. Modified test code:
  45.  
  46. Data temp;
  47.   Input varnum $ possans $;
  48. cards;
  49. 01 Jack
  50. 02 and
  51. 03 Jill
  52. 04 ran
  53. 05 up
  54. 06 the
  55. 07 hill
  56. ;
  57. Run;
  58.  
  59. data longer;
  60.   set temp temp temp temp temp temp temp temp temp temp temp;
  61. run;
  62.  
  63. %let mvar = ;
  64. Data test;
  65.   set longer;
  66.     Call Symput('mvar',Symget('mvar')||' '||compress(possans));
  67. Run;
  68.  
  69. %put mvar = &mvar; run;
  70. /*** end of test code ***/
  71.  
  72. Produces:
  73.  
  74. mvar =  Jack and Jill ran up the hill Jack and Jill ran up the hill Jack and
  75. Jill ran up the hill Jack and Jill ran up the hill Jack and Jill ran up the
  76. hill Jack and Jill ran up the hill Jack and Jill ran u
  77.