Information Technology Reference
In-Depth Information
from the bottom up and map each record type into a sequential file. The Unload
algorithm is as follows:
Program Unload network database to sequentialfiles
begin
/*
n=number of record types
m=number of levels in each path expression
*/
Getall record type N
1
, N
2
….N
n
within inputnetwork schema;
Fori=1tondo/*for each target record type N
i
*/
whileN
i
record occurrencefounddo
begin
If it is firstoccurrence
then obtain firstrecord N
i
within area
else obtain next record N
i
within area;
Forj=m-1 to 1do
/* read target record ownerrecords by databasenavigation
from levelm-1 to level1,asystem-owned records*/
Obtain ownerrecords keys K
i
(1), K
i
(2),...K
i
(j)
/* obtainthe record keys of allownersofrecordN
i
along
databaseaccess pathfrombottomuptothe system owned
record*/
end-for;
Case record identifier_typeof
'F': begin
Ifm=1
then output N
i
record with K
i
(m)as recordidentifierto
sequential file i
else output N
i
record with K
i
(1), K
i
(2)….K
i
(m-1), K
i
(m)
as foreign keytosequentialfilei/*
K
i
(m)=keyof
ownerrecordkey in levelm*/
end;
'P': output N
i
record with K
i
(1), K
i
(2),..,K
i
(m-1), K
i
(m)as
record identifier to sequential file i;
'I': output N
i
record with K
i
(1), K
i
(2),..,K
i
(m-1),
Sequence# as record identifier to sequentialfilei;
end-case;
end-while;
end-for;
end;
Search WWH ::
Custom Search