SAS Macro Skills - Recursive Use Macro

xiaoxiao2021-03-06  92

% Let n = 1;

% Macro Finddefine (BG_CODE, S_BRC_VAR, S_BRC_CODE, E_BRC_VAR, E_BRC_CODE);

% PUT & N;

% Let n =% EVAL (& n 1);

% let sqlobs = 0;

% IF & n = 10% THEN% let sqlobs = 1;

% IF ^ & SQLOBS% THEN% FINDDEFINE (& BG_CODE, & S_BRC_VAR, & S_BRC_CODE, & E_BRC_VAR, & E_BRC_CODE);

% mend finddefine;

% Finddefine (BG_CODE, S_BRC_VAR, S_BRC_CODE, E_BRC_VAR, E_BRC_CODE);

Output results:

1

2

3

4

5

6

Seduce

8

9

转载请注明原文地址:https://www.9cbs.com/read-104831.html

New Post(0)