call assign(1, VAR1, VAR2, VAR3);
Allowing variable lists such as VAR: or an array call assign (1, of AVAR(*)) as well.
Yes, all the usual function syntaxes will be supported, like VAR-VAR3 and VAR1--VAR3 too.
Also, we probably need 2 functions, one for strings:
call assignc('1', of AVAR, VARX12, VARY1-VARY3);
The first argument could even be a variable name, so we copy its value, rather than a literal value.
Why just one value? It could support syntax similar to that used to initialize array elements.
call assign(1:5,of var1-var5)
You can do it now with CALL SDTIZE but it will probably need a CALL MISSING first and in my limited testing was slower than I had hoped. And doesn't support a range of values.
24 data _null_;
25 array scalar;
26 put (scalar[*]) (=);
27 call stdize('missing=',1,'none',of scalar[*]);
28 put (scalar[*]) (=);
scalar1=. scalar2=. scalar3=. scalar4=.
scalar1=1 scalar2=1 scalar3=1 scalar4=1
See WHICHC/WHICHN functions. (thatks to Reeza)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.