/* DS.FS 04.03.2014 J.Fes */
Select 
 pd.puid As DataSetPuid,
 imv.pmachine_type     As imv_pmachine_type,
 imv.pvolume_name      As imv_pvolume_name,
 imv.punix_path_name   As imv_punix_path_name,
 imv.pwnt_path_name    As imv_pwnt_path_name,
 imf.psd_path_name     As imf_psd_path_name,
 imf.pfile_name        As imf_pfile_name,
 pao.plast_mod_date    As imf_lastmoddat,
-- rn.pseq AS [rn.pseq Higest], --> has higest version
 ra.phighest_rev,
 ra.pkeep_limit,
 rn.pval_0
From
 infodba.PDATASET pd
 Left Join infodba.PREF_LIST_0 rl   On (rl.puid = pd.puid)
 Left Join infodba.PREF_NAMES_0 rn  On (rl.puid = rn.puid And rl.pseq = rn.pseq)
 Left Join infodba.PIMANFILE imf    On (imf.puid = rl.pvalu_0)
 Left Join infodba.PIMANVOLUME imv  On (imf.rvolume_tagu = imv.puid)
 Left Join infodba.PPOM_APPLICATION_OBJECT pao On (pao.puid = imf.puid)
 Left Join infodba.PREVISIONANCHOR ra On (ra.puid =  pd.rrev_chain_anchoru) 
where
 pd.puid = :para_puid
 -- pd.puid in ('A4eNR19_TzDfjB','hcTNBtqRTzDfjB') -- tc83 
 and rn.pval_0 In ('UGPART', 
 'IdeasPart', 'IdeasAssembly','IdeasDrawing',
 'AsmFile', 'PrtFile', 'DrwFile','catpart','catproduct','catdrawing')
