From looking at your code and reading your description of the problem, I don't think your code is doing what you are trying to do. "So the error would be if the listname value is not = to the values in &sunlist or not equal to the value in &listall" I think you are trying to do this, If ((listname NOT IN (&SUNLIST.)) AND (listtype NOT IN (&LISTALL.))) One way to check your logic is to negate it and flip the then else. From your description it sounds like you want to do this: IF WEEKDAY(&WOD.) = 1 THEN DO; IF listname IN (&SUNLIST.) OR listtype IN (&LISTALL.) THEN DO; ERROR_DESC = 'NON_ERROR'; err1 = 0; END; ELSE do; ERROR_DESC = 'ERR_WORKLIST'; err1 = 1; END; To create what I think you want from the code above, 1) negate the conditions, 2) change ORs to ANDs and ANDs to ORs and 3) flip the then else. So, the code as you present the problem should be IF WEEKDAY(&WOD.) = 1 THEN DO; IF listname NOT IN (&SUNLIST.) AND listtype NOT IN (&LISTALL.) THEN DO; ERROR_DESC = 'ERR_WORKLIST'; err1 = 1; END; ELSE do; ERROR_DESC = 'NON_ERROR'; err1 = 0; END; Gary
... View more