Re: Selective record extraction/copy?



FrankS wrote:
On Oct 22, 10:20 pm, David J Dachtera <djesys...@xxxxxxxxxxxxxxxx>
wrote:
AFAIK, DCL does not support any structured programming constructs, only
labels and GOTOs.

Boy, this'll take us off topic.

Structured programming doesn't require WHILE, and doesn't forbid the
use of GOTO. At its roots, it just says that any programming solution
can be expressed using three constructs: sequential blocks of code,
conditional execution, and looping.

All three of those constructs can be implemented in DCL. Granted, it
doesn't have many of the higher level statements that make it easier
to see the structure, but it can all be done.

For example, the construct

WHILE (condition)
.
. <one or more other statements go here>
.
NEXT

can be expressed in DCL as

looptop:
IF (.not. condition) THEN GOTO loopend
.
. <one or more other statements go here>
.
GOTO looptop

loopend:
. <etcetera>

The SELECT (or CASE) statement is a shortcut for multiple IFs or IF/
ELSEIFs. And so on. You can express all of these so-called
structured constructs using just labels and GOTOs, and IFs.

So, go out there and start writing structured DCL. It can be done.

Well said!!
.