Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,5 @@
MOVE 5 TO x
MOVE FUNCTION SOME-FUNC(x) TO y
MOVE "foo" TO z
MOVE "values 1234" TO group-item
SET some-index TO 5

View file

@ -0,0 +1,18 @@
01 normal-date.
03 year PIC 9(4).
03 FILLER PIC X VALUE "-".
03 month PIC 99.
03 FILLER PIC X VALUE "-".
03 dday PIC 99. *> Misspelling is intentional; day is a reserved word.
01 reversed-date.
03 dday PIC 99.
03 FILLER PIC X VALUE "-".
03 month PIC 99.
03 FILLER PIC X VALUE "-".
03 year PIC 9(4).
...
PROCEDURE DIVISION.
MOVE "2012-11-10" TO normal-date
MOVE CORR normal-date TO reversed-date
DISPLAY reversed-date *> Shows '10-11-2012'

View file

@ -0,0 +1,4 @@
01 a PIC X(20). *> a is a string of 20 characters.
01 b PIC 9(10). *> b is a 10-digit integer.
01 c PIC 9(10)V9(5). *> c is a decimal number with a 10-digit integral part and a 5-digit fractional part.
01 d PIC 99/99/99. *> d is an edited number, with a slash between each pair of digits in a 6-digit integer.

View file

@ -0,0 +1,4 @@
*> Group data items do not have a picture clause.
01 group-item.
03 sub-data PIC X(10).
03 more-sub-data PIC X(10).

View file

@ -0,0 +1,8 @@
DATA DIVISION.
WORKING-STORAGE SECTION.
01 initialized-data PIC X(15) VALUE "Hello, World!".
01 other-data PIC X(15).
...
PROCEDURE DIVISION.
DISPLAY initialized-data *> Shows 'Hello, World!'
DISPLAY other-data *> Will probably show 15 spaces.

View file

@ -0,0 +1,3 @@
01 group-item VALUE "Hello!12345".
03 a-string PIC X(6). *> Contains "Hello!"
03 a-number PIC 9(5). *> Contains '12345'.

View file

@ -0,0 +1,6 @@
some-str (1:1) *> Gets the first character from the string
some-num (1:3) *> Get the first three digits from the number
another-string (5:) *> Get everything from the 5th character/digit onwards.
*> To reference modify an array element
some-table (1) (5:1) *> Get the 5th character from the 1st element in the table