Information Technology Reference
In-Depth Information
A sample network database program to be decompiled is as follows:
MOVE 'ACCOUNTANT' TO TITLE IN JOB.
FIND FIRST JOB USING TITLE.
L. IF NOT-FOUND GO TO EXIT.
FIND FIRST EMP WITHIN ASSIGN.
M. IF EMP-OF-SET GO TO O.
GET EMP.
IF EMP.BIRTHYR 1950 GO TO N.
(other code that accesses emp in User Work Area)
FIND OWNER WITHIN WORKS-IN.
GET DEPT.
:
N. FIND NEXT EMP WITHIN ASSIGN.
GO TO M.
O. FIND NEXT JOB USING TITLE.
GO TO L.
EXIT.
After the first phase, for each control block, we get a partition block as shown
below:
MOVE 'ACCOUNTANT' TO TITLE IN JOB
(1)FINDFIRST JOBUSING TITLE.
L. IF NOT-FOUNDGOTO EXIT.
(2) FINDFIRST EMP WITHINASSIGN.
M. IF END-OF-SETGOTOO.
GETEMP.
IF EMP.BIRTHYR
(other code that accessesemp in User Work Area)
(3)FIND OWNER WITHIN WORKS-IN.
1950 GO TO N.
G
E
T
D
E
P
T
.
N.FIND NEXT EMPWITHINASSIGN.
GO TO M.
O. FIND NEXT JOB USING TITLE.
GO TO L.
EXIT.
After the second phase, blocks 1 and 2 are translated into the first SQL select state-
ment and block 3 is translated into secondary SQL select statements as shown
below:
Search WWH ::




Custom Search