-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGENFLTROBJ.sqlrpgle
77 lines (61 loc) · 2.35 KB
/
GENFLTROBJ.sqlrpgle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
**FREE
// **************************************************************************
// * Member: GENFLTROBJ *
// * Description: Gen SQL DDL from DDS Object Filtering *
// * *
// * Author : Reynaldo Dandreb M. Medilla *
// **************************************************************************
Ctl-opt Option(*SRCSTMT : *NODEBUGIO) DFTACTGRP(*NO);
// *****************************************************************************
// entry parms
// *****************************************************************************
Dcl-pi *N;
pFltrCode char(1) const;
pObjLib char(10) const;
pObjNam char(10) const;
pObjAtr char(2) const;
pFoundIt char(1);
End-pi;
// **************************************************************************
// * Program variables
// **************************************************************************
Dcl-s wCurrUser Char(10) Inz(*User);
Dcl-s wCurrTimeS Timestamp Inz(*Sys);
Dcl-s wSqlStmt Char(400);
Dcl-s wI int(10);
Dcl-c cSQLOK '00000';
Dcl-c cSQLEOF '02000';
Dcl-c cQ '''';
// **************************************************************************
// Main Program Logic
// **************************************************************************
Exsr srMain;
Exsr srEndPgm;
// **********************************************************************
// main routine
// **********************************************************************
Begsr srMain;
Exec SQL Set Option Commit = *NONE, DatFmt = *ISO;
Exec SQL Select count(*) Into :wI
From GENFILTER
Where FFILTER = :pFltrCode And FOBJLIB = :pObjLib And FOBJNAM = :pObjNam;
// record found then set return-parm
If wI > 0;
pFoundIt = 'Y';
Else;
pFoundIt = 'N';
Endif;
Endsr;
// **********************************************************************
// terminal logic
// **********************************************************************
Begsr srEndPgm;
*INLR = *On;
Return;
Endsr;
// ----------------------------------------------------------------------
// User Defined Functions
// ----------------------------------------------------------------------
// Dcl-proc xxx;
// Return yyy;
// End-proc;