I have variable I defined as being 50 characters long that contains information I need to access in the format ,#,#, where # is a single digit 1-9. Unfortunately, this 50 characters is a free-write comment and so the data I'm looking for won't be in any given position. I am self-taught with sas so my methods are often unorthodox at best. I have the following piece of code:
DO I=1 TO 9;
DO J=1 TO 9;
X=PUT(I,1.);
Y=PUT(J,1.);
IF UNIT = 'DCRT' AND COMMENT = :'C1' AND
(INDEX(COMMENT,',X,Y,') > 0 )
THEN NUMBER='MULTIPLE';
END;
END;
I am trying to search the 50 character "comment" variable to match data that can be in that ,#,#, format. I know for a fact there are results that match this format, but my "number" variable remains blank. Any suggestions? Again, the ,#,#, can be ,1,5, or ,5,1, with numbers between 1-9 in either position. I am not getting any errors on this code, but no results either.
FWIW: I can't use macros, interactive modes, or many other common things. I use batch mode only because the program is installed on a remote server.
DO I=1 TO 9;
DO J=1 TO 9;
X=PUT(I,1.);
Y=PUT(J,1.);
IF UNIT = 'DCRT' AND COMMENT = :'C1' AND
(INDEX(COMMENT,',X,Y,') > 0 )
THEN NUMBER='MULTIPLE';
END;
END;
I am trying to search the 50 character "comment" variable to match data that can be in that ,#,#, format. I know for a fact there are results that match this format, but my "number" variable remains blank. Any suggestions? Again, the ,#,#, can be ,1,5, or ,5,1, with numbers between 1-9 in either position. I am not getting any errors on this code, but no results either.
FWIW: I can't use macros, interactive modes, or many other common things. I use batch mode only because the program is installed on a remote server.