01 umgebung.
10 u pic 9.
88 online value 1.
88 batch value 2.
10 db2server pic x(16) value space.
88 testserver value 'TOOO01'.
88 abnahmeserver value 'TOOO06'.
88 produktionsserver value 'POOO04'.
10 pic 9.
88 testsystem value 1.
88 abnahme value 2.
88 produktion value 3.
procedure division using zeile1
zeile2
zeile3
zeile4
zeile5.
* vorsicht: parameterübergabe soll nur "by content" erfolgen, weil
* der pufferbereich auf blank gesetzt wird!
main.
perform init
move space to ausgabe
move zero to aus-ll
set adressfeld to address of zeile1
move adressfeld-c to adressfeld-zeile1
*
move zeile1 to zeile
perform check
if k > 0 then move space to zeile1(1:k) end-if
*
set adressfeld to address of zeile2
move adressfeld-c to adressfeld-x
if adressfeld-x(1:4) = adressfeld-zeile1(1:4)
and zeile2(1:1) > space and <= '9' then
move zeile2 to zeile
perform check
if k > 0 then move space to zeile2(1:k) end-if
end-if
*
set adressfeld to address of zeile3
move adressfeld-c to adressfeld-x
if adressfeld-x(1:4) = adressfeld-zeile1(1:4)
and zeile3(1:1) > space and <= '9' then
move zeile3 to zeile
perform check
if k > 0 then move space to zeile3(1:k) end-if
end-if
*
set adressfeld to address of zeile4
move adressfeld-c to adressfeld-x
if adressfeld-x(1:4) = adressfeld-zeile1(1:4)
and zeile4(1:1) > space and <= '9' then
move zeile4 to zeile
perform check
if k > 0 then move space to zeile4(1:k) end-if
end-if
*
set adressfeld to address of zeile5
move adressfeld-c to adressfeld-x
if adressfeld-x(1:4) = adressfeld-zeile1(1:4)
and zeile5(1:1) > space and <= '9' then
move zeile5 to zeile
perform check
if k > 0 then move space to zeile5(1:k) end-if
end-if
*
move space to kt1240-h-text
perform wri-que.
goback
.
init.
exec sql
set :db2server = CURRENT SERVER
end-exec
move 'de026' to de026-pgm
call de026-pgm
on exception goback
end-call
if return-code = zero then set batch to true end-if
if return-code = 16 then set online to true end-if
.
check.
set good-found to true
perform varying i from 1 by 1 until i > 131
or nongood-found
if zeile(i:1) < space then
set nongood-found to true
compute j = i -1
if j < 1 then move 1 to j end-if
end-if
end-perform
if good-found then move 132 to j end-if
set blank-found to true
perform varying i from j by -1
until i < 2 or nonblank-found
if zeile(i:1) not = space then
set nonblank-found to true
compute k = i
if k <= 1 then move 1 to k end-if
end-if
end-perform
if blank-found then move j to k end-if
if aus-ll> 0 and< length of ausgabe then
string ausgabe(1:aus-ll) zeile(1:k)
delimited by size into ausgabe
add k to aus-ll
else
if aus-ll = zero then
string zeile(1:k)
delimited by size into ausgabe
move k to aus-ll
end-if
end-if
.
wri-que.
if batch then
display ausgabe
else
move 1 to kt1240-h-count
move ausgabe to kt1240-h-tab(1)
move 'KT1240' to kt1240-pgm
move 'de027' to kt1240-h-aufruf-pgm
call kt1240-pgm using kt1240-dummy-dfheiblk
kt1240-dummy-dfhcommarea
kt1240-in-interface
end-if
.
end-program de027.
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.