楼主: lovedieer
2703 14

[问答] 请帮忙改写一个SAS程序 [推广有奖]

11
yongyitian 发表于 2013-3-13 01:18:29
lovedieer 发表于 2013-3-13 00:57
I did several modification with your code to fit my program. and it works great. Thank you very much ...
It is good you made it works. I am still not sure why tiele&num got a warning.  It is seems that the title does not need a numer in your case.

12
lovedieer 发表于 2013-3-13 03:20:46
I do not have any warning error. somebody else try the program.  I think his problem is there's space between title and &num.  From his log, title1 was transfer to " title    1".

13
Eternal0601 发表于 2013-3-13 10:18:54
yongyitian 发表于 2013-3-13 01:18
It is good you made it works. I am still not sure why tiele&num got a warning.  It is seems that t ...
Sorry. The previous explanation was not the key.

The real problem is caused by   call symput('num', num); The numeric values have been converted to character values. In the case, SAS will automatically add several spaces before the num value.

When you replace it with call symput('num', put(num,1.)), there is no warning in the log window.

14
yongyitian 发表于 2013-3-13 12:40:28
Eternal0601 发表于 2013-3-13 10:18
Sorry. The previous explanation was not the key.

The real problem is caused by   call symput(' ...
You are right. Thanks for let me know that.
Acturally, I found the number in the title strange, so I removed &num in the saved code. That is why I did not found the message at second run.

15
lovedieer 发表于 2013-3-13 22:38:43
I am learning Macro now, and just learned that call symputx which added for SAS9.1 and later can used to remove all the spaces. I tried and it works.

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-31 13:41