由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 大家说说这是电脑的错还是SAS的错
相关主题
Help: SAS codeNeed advice on SAS macro debugging
SAS macro variable resolution questionSAS help : The scope of macro variables
问个sas adv的问题新手问:如何STEP BY STEP 地运行SAS MACRO
SAS macro Debug我是一菜鸟 质疑sas adv63题(12月)第41题的答案
靠,这个哪错了?大家给指条路吧
与Macro相关的字符函数sas question!!!
SAS Macro 问题请教 。。。为啥我的宏不被解释--SYMBOLGEN
请教个&的问题一个关于macro的问题,多谢。
相关话题的讨论汇总
话题: grp话题: symbolgen话题: resolves话题: macro话题: variable
进入Statistics版参与讨论
1 (共1页)
w****g
发帖数: 81
1
我好像是没错的
SYMBOLGEN: Macro variable SUM_CURRENT_GRP resolves to 5.73
SYMBOLGEN: && resolves to &.
SYMBOLGEN: Macro variable I resolves to 9
SYMBOLGEN: Macro variable GRP9 resolves to 42.489
MLOGIC(GRP): %IF condition &sum_current_grp. < &&grp&i. is FALSE **wrong
SYMBOLGEN: Macro variable SUM_CURRENT_GRP resolves to 1.35
SYMBOLGEN: && resolves to &.
SYMBOLGEN: Macro variable I resolves to 10
SYMBOLGEN: Macro variable GRP10 resolves to 8.073
MLOGIC(GRP): %IF condition &sum_current_grp. < &&grp&i. is TRUE **correct
SYMBOLGEN: Macro variable SUM_CURRENT_GRP resolves to 2.28
SYMBOLGEN: && resolves to &.
SYMBOLGEN: Macro variable I resolves to 17
SYMBOLGEN: Macro variable GRP17 resolves to 137.826
MLOGIC(GRP): %IF condition &sum_current_grp. < &&grp&i. is FALSE **wrong
SYMBOLGEN: Macro variable SUM_CURRENT_GRP resolves to 1.96
SYMBOLGEN: && resolves to &.
SYMBOLGEN: Macro variable I resolves to 18
SYMBOLGEN: Macro variable GRP18 resolves to 158.976
MLOGIC(GRP): %IF condition &sum_current_grp. < &&grp&i. is TRUE **correct
A*******s
发帖数: 3942
2
i don't quite get it.
did u use %sysevalf()?

【在 w****g 的大作中提到】
: 我好像是没错的
: SYMBOLGEN: Macro variable SUM_CURRENT_GRP resolves to 5.73
: SYMBOLGEN: && resolves to &.
: SYMBOLGEN: Macro variable I resolves to 9
: SYMBOLGEN: Macro variable GRP9 resolves to 42.489
: MLOGIC(GRP): %IF condition &sum_current_grp. < &&grp&i. is FALSE **wrong
: SYMBOLGEN: Macro variable SUM_CURRENT_GRP resolves to 1.35
: SYMBOLGEN: && resolves to &.
: SYMBOLGEN: Macro variable I resolves to 10
: SYMBOLGEN: Macro variable GRP10 resolves to 8.073

w****g
发帖数: 81
3
I did, got same results, actually no need to use %sysevalf() for number.

【在 A*******s 的大作中提到】
: i don't quite get it.
: did u use %sysevalf()?

r***k
发帖数: 13586
4
macro variable的值都是字符串,所以macro比较符号比的也是字符串。你一定要比数
值可以考虑两个相减后和负号比。
A*******s
发帖数: 3942
5
i got different results with or without %sysevalf()

【在 w****g 的大作中提到】
: I did, got same results, actually no need to use %sysevalf() for number.
f*****k
发帖数: 110
6
看来我的macro白学了,问题都看不明白。

【在 w****g 的大作中提到】
: 我好像是没错的
: SYMBOLGEN: Macro variable SUM_CURRENT_GRP resolves to 5.73
: SYMBOLGEN: && resolves to &.
: SYMBOLGEN: Macro variable I resolves to 9
: SYMBOLGEN: Macro variable GRP9 resolves to 42.489
: MLOGIC(GRP): %IF condition &sum_current_grp. < &&grp&i. is FALSE **wrong
: SYMBOLGEN: Macro variable SUM_CURRENT_GRP resolves to 1.35
: SYMBOLGEN: && resolves to &.
: SYMBOLGEN: Macro variable I resolves to 10
: SYMBOLGEN: Macro variable GRP10 resolves to 8.073

w****g
发帖数: 81
7
hey, I use this one and it works: %IF %sysevalf( &sum_current_grp. < &&grp&i
.) %then
thanks for all the advices!

【在 A*******s 的大作中提到】
: i got different results with or without %sysevalf()
d******9
发帖数: 404
8
Hehe, everything in macro is text, so macro compares them as characters.
As numeric, 5.73 < 42.489.
However, as character string, 5.73 > 42.489.
Therefore, you need use %sysevalf if you want to compare their numeric
values.

&i

【在 w****g 的大作中提到】
: hey, I use this one and it works: %IF %sysevalf( &sum_current_grp. < &&grp&i
: .) %then
: thanks for all the advices!

s*r
发帖数: 2757
9
i like mprint mlogic option on
s*r
发帖数: 2757
10
i like mprint mlogic option on
1 (共1页)
进入Statistics版参与讨论
相关主题
一个关于macro的问题,多谢。靠,这个哪错了?
急问:SAS batch submission with macro variable与Macro相关的字符函数
Re: SAS help : How to use Macro to select procedursSAS Macro 问题请教 。。。
sas 中如何给一个variable 加密?请教个&的问题
Help: SAS codeNeed advice on SAS macro debugging
SAS macro variable resolution questionSAS help : The scope of macro variables
问个sas adv的问题新手问:如何STEP BY STEP 地运行SAS MACRO
SAS macro Debug我是一菜鸟 质疑sas adv63题(12月)第41题的答案
相关话题的讨论汇总
话题: grp话题: symbolgen话题: resolves话题: macro话题: variable