select
distinct FSUSER,FSOBNM,RLTOROLE,AUSEQNO ,FSSETY,FSINSL,FSRUN into #temp_03from
SY900.F00950left
outer join SY900.F95921 on fsuser=RLFRROLEleft
outer join SY900.F00926 on auuser=fsuserwhere
RLFRROLE is not null and FSUSER not in('ESS','MSS','SYSBLOCK','ERREQ') AND AUSEQNO is not nullAND
FSOBNM<>'' AND FSSETY='3'order
by 1select
distinct FSUSER,FSOBNM,RLTOROLE,AUSEQNO ,FSSETY,FSA,FSCHNG,FSDLT,FSTHDV,FSOBID,FSADDC,FSIOK,FSICPYinto
#temp_01from
SY900.F00950left
outer join SY900.F95921 on fsuser=RLFRROLEleft
outer join SY900.F00926 on auuser=fsuserwhere
RLFRROLE is not null and FSUSER not in('ESS','MSS','SYSBLOCK','ERREQ') AND AUSEQNO is not nullAND
FSOBNM<>'' AND FSSETY='1'order
by 1--select * from #temp_01 a
--select * from #temp_03 a
select
a.* ,FSA,FSCHNG,FSDLT,FSTHDV,FSADDC,FSIOK,FSICPY into #temp4from
#temp_03 aleft
outer join #temp_01 b on a.FSUSER=b.FSUSER and a.FSOBNM=b.FSOBNM and a.RLTOROLE=b.RLTOROLEwhere
b.FSUSER is not null insert into #temp4select
a.* ,'Y' FSA,'Y'FSCHNG,'Y'FSDLT,'Y'FSTHDV,'Y'FSADDC,'Y'FSIOK,'Y'FSICPYfrom
#temp_03 aleft
outer join #temp_01 b on a.FSUSER=b.FSUSER and a.FSOBNM=b.FSOBNM and a.RLTOROLE=b.RLTOROLEwhere
b.FSUSER is nullselect
FSUSER Roles
, FSOBNM Program, RLTOROLE Users, AUSEQNO SeqNo,FSINSL Install,FSRUN Run,FSA [Add],FSCHNG Change,FSDLT Del
,FSIOK Ok,FSICPY Copy --into #temp5from
#temp4 order by 3,2,1,4 desc
No comments:
Post a Comment