SELECT A.FIELDNAME , C.LANGUAGE_CD , C.XLATSHORTNAME , C.XLATLONGNAME , CASE WHEN A.FIELDTYPE = 0 THEN %TrimSubstr(B.XLATSHORTNAME, 1, 10) %Concat '(' %Concat %TrimSubstr(TO_CHAR(A.LENGTH), 1, 5) %Concat ')' WHEN A.FIELDTYPE = 1 THEN %TrimSubstr(B.XLATSHORTNAME, 1, 10) %Concat '(' %Concat %TrimSubstr(TO_CHAR(A.LENGTH), 1, 3) %Concat ')' WHEN A.FIELDTYPE = 2 THEN %TrimSubstr(B.XLATSHORTNAME, 1, 10) %Concat '(' %Concat %TrimSubstr(TO_CHAR(A.LENGTH), 1, 2) %Concat '.' %Concat %TrimSubstr(TO_CHAR(A.DECIMALPOS), 1, 2) %Concat ')' WHEN A.FIELDTYPE = 3 THEN %TrimSubstr(B.XLATSHORTNAME, 1, 10) %Concat '(' %Concat %TrimSubstr(TO_CHAR(A.LENGTH), 1, 2) %Concat '.' %Concat %TrimSubstr(TO_CHAR(A.DECIMALPOS), 1, 2) %Concat ')' WHEN A.FIELDTYPE = 4 THEN B.XLATSHORTNAME WHEN A.FIELDTYPE = 5 THEN B.XLATSHORTNAME WHEN A.FIELDTYPE = 6 THEN B.XLATSHORTNAME END FROM PSDBFIELD A , PSXLATITEM B , PSXLATITEMLANG C WHERE B.FIELDNAME = 'PROMPT_FIELDTYPE' AND B.FIELDVALUE = %TrimSubstr(TO_CHAR(A.FIELDTYPE), 1, 1) AND B.EFFDT = ( SELECT MAX(B_EF.EFFDT) FROM PSXLATITEM B_EF WHERE B_EF.FIELDNAME = B.FIELDNAME AND B_EF.FIELDVALUE = B.FIELDVALUE AND B_EF.EFFDT <= %CurrentDateIn AND B_EF.EFF_STATUS = 'A') AND C.FIELDNAME = B.FIELDNAME AND C.FIELDVALUE = B.FIELDVALUE AND C.EFFDT = B.EFFDT
|