- %macro test;
- %let UP_DOWN= UP DN;
- %let Stage= 1st 2nd;
- %let Parameter= Ship G0;
- %do i=1 %to 2;
- %do j=1 %to 2;
- %do k=1 %to 2;
- %global %scan(&UP_DOWN,&i)%scan(&Stage,&j)%scan(&Parameter,&k);
- %let %scan(&UP_DOWN,&i)%scan(&Stage,&j)%scan(&Parameter,&k)=1;
- %end;
- %end;
- %end;
- %mend test;
- %test;
- %macro test2;
- %let UP_DOWN= UP DN;
- %let Stage= Total;
- %let Stage2= 1st 2nd;
- %let Parameter= Ship G0;
- %do i=1 %to 2;
- %do j=1 %to 2;
- %do k=1 %to 2;
- %global %scan(&UP_DOWN,&i)&Stage%scan(&Parameter,&k);
- %let %scan(&UP_DOWN,&i)&Stage%scan(&Parameter,&k)=
- &%scan(&UP_DOWN,&i)%scan(&Stage2,&j)%scan(&Parameter,&k);
- %end;
- %end;
- %end;
- %mend test2;
- %test2;
GLOBAL UPTOTALSHIP &UP2ndShip
GLOBAL UP1STG0 1
GLOBAL SYS_SQL_IP_ALL 0
GLOBAL DN1STSHIP 1
GLOBAL DN1STG0 1
GLOBAL DN2NDSHIP 1
GLOBAL DNTOTALG0 &DN2ndG0
GLOBAL UP2NDSHIP 1
GLOBAL UP1STSHIP 1
GLOBAL DNTOTALSHIP &DN2ndShip
GLOBAL UP2NDG0 1
GLOBAL UPTOTALG0 &UP2ndG0
上面是日志里面的宏变量及其值,以第二行为例,我想得到的是 UPTOTALSHIP 1,而不是 UPTOTALSHIP &UP2ndShip。
请问应该如何修改,请高手指导,非常感谢!