CALL SYMPUT VS. CALL SYMPUTX

使用SAS macro的朋友都知道 call symput,这是个非常有用的东东,在data step和macro之间建立了一个接口。
大家用的最多,接触最早的是call symput,其实SAS还提供了它的一个兄弟,更强大的call symputx。

The four benefits of CALL SYMPUTX are:
1.) CALL SYMPUTX does not write a note to the SAS log when the second argument is numeric. CALL SYMPUT, however, writes a note to the log stating that numeric values were converted to character values.
2.) CALL SYMPUTX uses a field width of up to 32 characters when it converts a numeric second argument to a character value. CALL SYMPUT uses a field width of up to 12 characters.
3.) CALL SYMPUTX left-justifies both arguments and trims trailing blanks.CALL SYMPUT does not left-justify the arguments, and trims trailing blanks from the first argument only. Leading blanks in the value of name cause an error.
4.) CALL SYMPUTX enables you to specify the symbol table in which to store the macro variable, whereas CALL SYMPUT does not. This is accomplished by an optional third argument to the SYMPUTX function.

35 comments »

  1. chenxi said,
    九月 6, 2010 @ 上午 1:38

    华哥,来坐坐。希望多多发表技术类的文章,学习下!、
    似乎这种博客不支持表情图片。

  2. WanHj said,
    九月 7, 2010 @ 上午 2:23

    用call symputx的确实要比call symput多 尤其是第三条优势,很强大。PS 第一次来老大blog转转,以后常来哈。

    • tangyaohua said,
      九月 7, 2010 @ 上午 9:54

      呵呵,欢迎欢迎。你的blog哪?

  3. gaotao said,
    九月 7, 2010 @ 下午 12:46

    华哥一开博就甚是活跃呀!
    呵呵,话说我的博客很久没有更新了,要不是万恶的校园网,我最近也准备操起博客“大业”了

    • tangyaohua said,
      九月 7, 2010 @ 下午 1:26

      呵呵,现在想想中南的网络,真是好啊!!

  4. Yihui said,
    九月 7, 2010 @ 下午 9:15

    由于我不敢再打开下一篇日志(Processing Introduction),所以在这里评论了。我建议(似乎我总是在建议)你不要把那么复杂的Java Applet直接嵌入日志页面,打开那个页面直接让我的电脑死机了(我尚且还没点击任何画面),后悔莫及。希望不要有下一个“受害者”。

    • tangyaohua said,
      九月 8, 2010 @ 上午 2:20

      额~~我这么破的电脑测试很流畅啊。

      我开blog最初的想法就是要分享自己的Apllet~~

      如果其他同学打开也死机,麻烦报告下,谢谢。

    • tangyaohua said,
      九月 8, 2010 @ 上午 2:21

      只是目前先把别人的好Applet拿过来show一下,而且没有copy哦!

      • Yihui said,
        九月 10, 2010 @ 上午 7:16

        我不在乎是否copy,很多协议都是允许copy的。尽管如此,我还是倾向于阅读作者自己在想什么,只是个人习惯。

        对了,你看过Protovis么?

        http://vis.stanford.edu/protovis/

        Processing虽然好玩,但到目前为止,我似乎还没闻到统计的味道。很久以前我就在期待有人能考虑一下基于Processing做点儿统计图形的东西。

        而Protovis虽然也很绚丽,但它基于JS就意味着它只能适用于小型数据了。

        • tangyaohua said,
          九月 12, 2010 @ 下午 2:41

          看了一点,基于java script的,不过我不会这个,呵呵。看上去作出来的图片也比较简单,没有processing那么艺术,炫。不过应该比processsing易于发布。

        • tangyaohua said,
          九月 12, 2010 @ 下午 2:43

          这些天上课,感觉好难啊,非常理论,不知道学长那边讲统计课偏理论还是应用?

  5. SYF said,
    九月 9, 2010 @ 下午 2:21

    宝宝文采不错,我喜欢,宝宝加油啊

  6. Nan.Xiao said,
    九月 15, 2010 @ 上午 7:37

    ProtoVis里的平行坐标图有点意思

Leave a Comment