10-07-2017 10:11 AM - edited 10-07-2017 10:28 AM
Hello I wish to to return the maximum of , CIWA_Score1, CIWA_Score2, CIWA_Score3, CIWA_Score4 as "Max_CIWA".
My data has _1_CIWA_Score, _2_CIWA_Score, _3_CIWA_Score, _4_CIWA_Score. Can any one help?
10-07-2017 10:24 AM
665 data BH_New;
1666 set BH_New;
1667 CIWA_Score=max(of _1_CIWA_Score -_4_CIWA_Score);
ERROR: Missing numeric suffix on a numbered variable list (_1_CIWA_Score-_4_CIWA_Score).
ERROR 71-185: The MAX function call does not have enough arguments.
10-07-2017 10:44 AM
I believe your challenge here is related to the variable naming convention. The '-' is used when a numeric indicator is at the end of a variable name (for example x1,x2,x3,x4), but not when it is internale to the name (x1_dat, x2_dat, x3_dat). What you can do, assuming that the variables are in this order on the program data vector (PDV) is use a double dash '--'.
In your case, _1_CIWA_Score --_4_CIWA_Score. This will include any variable in the DATA step created between the first introduction of _1_CIWA_Score and the first introduction of _4_CIWA_Score. If you view the DATA set and these variable appear together as a group with _1_CIWA_Score appearing first and _4_CIWA_Score appearing as the last, you will be fine.
Hope it helps.
10-07-2017 12:21 PM
@desireatem I think it is unethical to mark your own answers as correct after seeking help on the forum and having got couple of suggestions. That's poor sport and so unprofessional.
10-07-2017 02:17 PM - edited 10-07-2017 02:19 PM
so if I found the solution I shouldn't paste it. That is not what I was taught. sorry after a second thought I disagree with you Andyx.
Need further help from the community? Please ask a new question.