can anyone help me on understanding what this is doing. it is in datastep
assign=(not(index(_alo_,";")) and not(missing(_alo_)) and (column not in ("VAL"));
if assignment then do;
call execute(catx(" ",
"length "||strip(column)||" $32;
_whr_="""||strip(_whr_)||""";origin="||quote(strip(origin))||";"||strip(_alo_)||";
VALUE=strip("||strip(column)||");COLUMN="""||strip(column)||""";output;"));
end;
Very likely it does nothing.
The first line creates a variable called ASSIGN (or possibly gives a value to an existing variable named ASSIGN). The value will be 0 or 1, depending on whether the comparisons to the right of the equal sign are true or false.
The next line (probably) refers to the wrong variable name. It begins:
if assignment then ...
It seems like it should begin:
if assign then ...
I could be wrong, but since there is likely no variable named ASSIGNMENT, the rest of the program doesn't do anything. Even if the code worked, it is written somewhat carelessly. Notice that within CATX there is just one comma separating the delimiter from the character strings to be concatenated. That means there is only a single character string, and CATX is just overly complicating the code.
If you want to know what CALL EXECUTE does, you have some studying ahead of you. It is not a simple topic.
Without the rest of the data step (how is variable assignment created?) and some example data (post in a data step), it is impossible to tell.
I can only see that some datastep statements are created with call execute.
Very likely it does nothing.
The first line creates a variable called ASSIGN (or possibly gives a value to an existing variable named ASSIGN). The value will be 0 or 1, depending on whether the comparisons to the right of the equal sign are true or false.
The next line (probably) refers to the wrong variable name. It begins:
if assignment then ...
It seems like it should begin:
if assign then ...
I could be wrong, but since there is likely no variable named ASSIGNMENT, the rest of the program doesn't do anything. Even if the code worked, it is written somewhat carelessly. Notice that within CATX there is just one comma separating the delimiter from the character strings to be concatenated. That means there is only a single character string, and CATX is just overly complicating the code.
If you want to know what CALL EXECUTE does, you have some studying ahead of you. It is not a simple topic.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.