SELECT DISTINCT P.LABEL_ID,P.LBLTEXT,P.FIELDNAME,P.RECNAME,F.LENGTH
,(CASE WHEN F.FIELDTYPE = '0' THEN 'Character'
WHEN F.FIELDTYPE='1' THEN 'Long Character'
WHEN F.FIELDTYPE='2' THEN 'Number'
WHEN F.FIELDTYPE='3' THEN 'Signed number'
WHEN F.FIELDTYPE='4' THEN 'Date'
WHEN F.FIELDTYPE='5' THEN 'Time'
WHEN F.FIELDTYPE='6' THEN 'DateTime'
WHEN F.FIELDTYPE='8' THEN 'Attachment'
ELSE 'TBD'
END) as Field_Type
FROM SYSADM.PSPNLFIELD P,SYSADM.PSDBFIELD F
WHERE P.PNLNAME='JOB_DATA1'
AND P.FIELDNAME=F.FIELDNAME
ORDER BY P.LBLTEXT;