You are mixing DATA step processing with SAS macro processing. A macro is normally resolved at compilation time. Your macro construct should be using all DATA step code (SAS variables, not SAS macro variables). Also, you will need to address the consideration of SAS variable length as you parse your input SAS variable -- defining a SAS LENGTH statement for your temporary variable - shown as "j". Lastly, your code generates one or more observations, depending on the input variable contents -- so you are actually generating an observation for each parsed sub-variable field/value.
Better to define what you want to actually accomplish showing both INPUT data and the desired OUTPUT data -- then others on the forum can provide feedback.
You can still use macro language logic but with SAS DATA step functions to parse your input variable, creating one or more "parsed data" variables, very similar to what you have shown in your code. Suggest you give it a try (coding a SAS macro to work within a DATA step), test it, and then come back to the forum, if you have unexpected results. Again, you will need to consider the SAS LENGTH attribute for each new variable - also you will have some challenges determining how many new SAS variables to declare, if you do not know the number of sub-string components that are present in your INPUT variable. Possibly you can look to use a SAS CALL SYMPUT when you have completed the parsing logic, setting a macro variable identifying number of words in your input variable. Investigate using the COUNTW function to determine your DO/END loop for the parsing process.
Msg, think of the macro language as a code generator.
The OP posted a question about parsing a macro variable into SAS dataset variables as I understand it.
%macro split (name=);
%do i=1 %to %sysfunc(countw(&name));
word&i = "%scan(&name,&i)";
%split (name=sas is an analytical language)
or even all the logic in the data step:
%macro split (name=);
array word(&countw) $16;
do i=1 to &countw;
word[ i] = scan("&name",i);
I believe that we are working with output SAS variables; I noticed an OUTPUT statement in the original post which persuaded my feedback. Maybe the OP needs to reconsider the basis of the post to contribute some different code -- better yet, start a new thread, when there is a problem / question on the topic point?