02-10-2016 10:05 AM
I am creating a stored process that will have 5 different prompts defined. All are character except for one, ‘DISTRICT’. The user wants to be able to leave the ‘DISTRICT’ column blank and return all the observations, no matter what the numeric value of DISTRICT is.
I defined the prompt as a numeric type in SMC but cannot figure out how to handle it in the code/select statement. Basically, it is like a wildcard on a character type column but on a numeric column.
This is one of my character type prompts. No matter what value is entered, a '%' for wildcard is added.
Can't figure out how to do this same thing for prompt that is numeric.
Any assistance would be appreciated!!!
02-10-2016 10:30 AM
There isn't a wild card for numbers though.
You'd have to provide an example of how this would be used in the queries for us to offer suggestions.
02-10-2016 10:47 AM
Sorry, here is a short example of my code. The first statement on the 'where; clause is the numeric 'DISTRICT' column. All others are character and work.
PROC SQL; CREATE TABLE WORK.DATA_SELECTED AS (SELECT t1.DISTRICT, t1.OFFICE_NAME, t1.OFFICE_LOCATION t1.OFFICE_MANAGER t1.NBR_EMPLOYEES, t1.COUNTY_NAME, t1.ADDR_LINE_1, t1.ADDR_LINE_1, t1.CITY, t1.STATE, t1.ZIP FROM mylib.t1 DISTRIC_INFO WHERE t1.District = &NEW_district and t1.Office_Name LIKE &NEW_OFFICE_NAME and t1.State = &NEW_STATE and t1.County_Name = &NEW_COUNTY and t1.City = &NEW_CITY and t1.Zip = &NEW_ZIP ); QUIT;