Hi, Thanks! That works fine, I just changed cats(repeat("0",5-lengthn(T1.DED_CODE)) to cats(repeat("0",4-lengthn(T1.DED_CODE)) the first one was throwing in two leading '0's Regards Finbar
... View more
Hi all, I am looking to add a leading '0' to variables within a field that are less that 5 characters in length. Does anyone know of a bit of code that can achieve this? Below is my attempt. I know everything after 'THEN' works fine, its the selecting variables with less than 5 characters that is hindering me. CASE WHEN substr(t1.ded_code,max(1,length(t1.ded_code)-3)) THEN PUT(INPUT(t1.ded_code, best.), z2.) ELSE t1.ded_code END AS ded_code_v2 Regards Finbar
... View more
I have created a work around where I have created a unique ID field in the left hand column. Done my left join where it has created extra rows. After this I just done a Group By based on the unique id and selected the max address_reference field from the right hand table. Complete!
... View more
Building_ID is restricts to an individual building, so as I say for this analysis it will be perfectly fine. Could you send an example piece of code of how you would use it? I have populated fields within PL/SLQ using SELECT DISTINCT() but not in SAS.
... View more
Hi all, I looking to pull geo data to a table via a left join. I have got to a point where I just want to join first matching result in my geo table to my original table. In oracle I would have used something like rownum < 2, is there an equivalent within SAS? Below is an example of the join and conditions LEFT JOIN TMP_PRPN.COMPANIES_NACE_CODE_GEODIR2 t2 ON t1.join_status = 0 AND t1.geo_directory_grp = 'BUILDING' AND t2.building_id = t1.geo_directory_id AND t1.thorfare_id IS NOT MISSING AND t2.thorfare_id = t1.thorfare_id AND t2.nace_code LIKE ('Q.86.%') AND prxchange('s/\b(DOCTOR)\b/ /o',-1,t2.organisation_name) =* cats(t1.firstname, t1.surname) Any ideas? Regards Finbar
... View more
Hi, I am doing an address matching exercise where I want to match on part of an address being within another address. Is below correct? I want to find t2.address_line_3_clean within the concatenation. cats(t1.address1, t1.address2, t1.address3) LIKE "%" || t2.address_line_3_clean || "%" Regards Finbar
... View more