Below is the code im working on and getting a syntax error (the part im getting the error for is in red below). I have attached a picture of the error for reference. Any help would be appreciated!! PROC SQL; CREATE TABLE WORK.ADDL_FIELDS_JOINS AS SELECT t1.'Evnt Id'n LABEL='', t1.'Exposure Number'n, t1.'System Code'n, t1.'Typ Cde'n, t1.'Typ Nme Lvl 2'n, t1.Operation, t1.'Typ Nme'n, t1.Market, t1.'Central Region Overwrite'n AS Region, t1.'Legacy Group'n, t1.'Stt Cde'n, t1.'HR Region'n, (case when t1.'Loss Incr Amt'n IS MISSING then 0 else t1.'Loss Incr Amt'n end) LABEL="Loss Incr Amt" AS 'Loss Incr Amt'n, t1.'Loss Incurred?'n, t1.'Valtn Dte'n, t1.'Valtn Yr'n, t1.'Valtn Month'n, (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT) ) AS 'Insured % of Fault'n, (coalesce((case when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) is not missing then 100 - (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) end),t4.OFFSET_PCT)) AS 'Claimant % of Fault'n, (case when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 0 then 'Not at fault' when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) > 0 and (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) < 100 then 'Partially at Fault' when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 100 then 'At Fault' end) AS 'Insured Fault Rating Name'n, (case when (case when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 0 then 'Not at fault' when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) > 0 and (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) < 100 then 'Partially at Fault' when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 100 then 'At Fault' end) = 'At Fault' then 'No Offset' when (case when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 0 then 'Not at fault' when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) > 0 and (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) < 100 then 'Partially at Fault' when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 100 then 'At Fault' end) in ('Not at fault') then 'Full Offset' when (case when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 0 then 'Not at fault' when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) > 0 and (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) < 100 then 'Partially at Fault' when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 100 then 'At Fault' end) in ('Partially at Fault') then 'Partial Offset' else 'Blank' end) AS 'Offset Eligibility'n, (Case when (case when (case when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 0 then 'Not at fault' when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) > 0 and (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) < 100 then 'Partially at Fault' when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 100 then 'At Fault' end) = 'At Fault' then 'No Offset' when (case when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 0 then 'Not at fault' when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) > 0 and (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) < 100 then 'Partially at Fault' when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 100 then 'At Fault' end) in ('Not at fault') then 'Full Offset' when (case when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 0 then 'Not at fault' when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) > 0 and (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) < 100 then 'Partially at Fault' when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 100 then 'At Fault' end) in ('Partially at Fault') then 'Partial Offset' else 'Blank' end) = 'Blank' then 'Blank' else 'Field Complete' end) AS 'Offset Eligibility Group'n, (case when t1.Customer in ('United Parcel','United Parcel Service','United Parcel Service Inc','United Parcel Service, Inc.', 'United Parcel Servive', 'UNITED PARCEL SERVICE','UNITED PARCEL SERVICE INC') then 'Y' else 'N' end) AS 'UPS?'n, (case when t1.'System Code'n = 'CC' then t2.'Loss Cause'n when t1.'System Code'n = 'Safeco' then Strip(t4.'CVO_CAPTION2'n) || Strip(t4.'CVO_CAPTION3'n) else t1.'Case Desc'n end) AS 'Loss Cause'n, (PROPCASE(t1.Manager)) AS Manager, (PROPCASE(t1.Owner)) AS Owner, t1.'Hndlg Off Cde'n, t4.'CVO_CASE_DESC'n, t4.'CVO_AUT_LS_TYP'n, t4.'CVO_AUT_COLL_CD'n, t4.'CVO_CAPTION1'n, t4.'CVO_CAPTION2'n, t4.'CVO_CAPTION3'n, t4.'CVO_CAPTION4'n, t1.Closed_Date FROM WORK.QUERY_FOR_ALL_CLOSED_SAS7BDAT1 t1 LEFT JOIN WORK.CC t2 ON put(t1.'Exposure Number'n, $50.) = put(t2.'Exposure Number'n, $50.). LEFT JOIN WORK.CVO t4 ON put(t1.'Exposure Number'n, $50.) = put(t4.'Exposure Number'n, $50.). LEFT JOIN newlib.VIA_OFFSETS t3 ON put(t1.'Exposure Number'n, $50.) = put(t3.'Exposure Number'n, $50.); QUIT;
... View more