Data update
This commit is contained in:
parent
61b93a2cd1
commit
5af6d93694
858 changed files with 20572 additions and 2082 deletions
|
|
@ -2,9 +2,9 @@
|
|||
PROGRAM-ID. myTest.
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
01 x PIC 9(3) VALUE 3.
|
||||
01 y PIC 9(3) VALUE 2.
|
||||
01 z PIC 9(9).
|
||||
01 x PICTURE IS 9(3) VALUE IS 3.
|
||||
01 y PICTURE IS 9(3) VALUE IS 2.
|
||||
01 z PICTURE IS 9(9).
|
||||
PROCEDURE DIVISION.
|
||||
CALL "myMultiply" USING
|
||||
BY CONTENT x, BY CONTENT y,
|
||||
|
|
@ -17,10 +17,10 @@
|
|||
PROGRAM-ID. myMultiply.
|
||||
DATA DIVISION.
|
||||
LINKAGE SECTION.
|
||||
01 x PIC 9(3).
|
||||
01 y PIC 9(3).
|
||||
01 z PIC 9(9).
|
||||
PROCEDURE DIVISION USING x, y, z.
|
||||
01 x PICTURE IS 9(3).
|
||||
01 y PICTURE IS 9(3).
|
||||
01 z PICTURE IS 9(9).
|
||||
PROCEDURE DIVISION USING BY REFERENCE x, y, z.
|
||||
MULTIPLY x BY y GIVING z.
|
||||
EXIT PROGRAM.
|
||||
END PROGRAM myMultiply.
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
FUNCTION myMultiply.
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
01 x PIC 9(3) VALUE 3.
|
||||
01 y PIC 9(3) VALUE 2.
|
||||
01 x PICTURE IS 9(3) VALUE IS 3.
|
||||
01 y PICTURE IS 9(3) VALUE IS 2.
|
||||
PROCEDURE DIVISION.
|
||||
DISPLAY myMultiply(x, y).
|
||||
STOP RUN.
|
||||
|
|
@ -17,10 +17,10 @@
|
|||
FUNCTION-ID. myMultiply.
|
||||
DATA DIVISION.
|
||||
LINKAGE SECTION.
|
||||
01 x PIC 9(3).
|
||||
01 y PIC 9(3).
|
||||
01 z pic 9(9).
|
||||
01 x PICTURE IS 9(3).
|
||||
01 y PICTURE IS 9(3).
|
||||
01 z PICTURE IS 9(9).
|
||||
PROCEDURE DIVISION USING x, y RETURNING z.
|
||||
MULTIPLY x BY y GIVING z.
|
||||
EXIT FUNCTION.
|
||||
GOBACK.
|
||||
END FUNCTION myMultiply.
|
||||
|
|
|
|||
22
Task/Function-definition/LDPL/function-definition.ldpl
Normal file
22
Task/Function-definition/LDPL/function-definition.ldpl
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
data:
|
||||
n is number
|
||||
|
||||
procedure:
|
||||
sub multiply
|
||||
parameters:
|
||||
x is number
|
||||
y is number
|
||||
result is number
|
||||
procedure:
|
||||
in result solve x * y
|
||||
end sub
|
||||
|
||||
# call the bare sub-procedure
|
||||
call multiply with 3 4 n
|
||||
display n lf
|
||||
|
||||
# create a statement for it
|
||||
create statement "multiply $ by $ in $" executing multiply
|
||||
|
||||
multiply 3 by 4 in n
|
||||
display n lf
|
||||
Loading…
Add table
Add a link
Reference in a new issue