MM/DD/YY (month, day, year)
YYMMDD (year, month, day)
77 DATE-IN-PROGRAM PICTURE X(8).
. . .
MOVE CURRENT-DATE TO DATE-IN-PROGRAM.
An example of one way
to change it, keeping the two-digit year format, is as follows:
01 DATE-IN-PROGRAM.
02 MONTH-OF-YEAR PIC X(02).
02 FILLER PIC X(01) VALUE "/".
02 DAY-OF-MONTH PIC X(02).
02 FILLER PIC X(01) VALUE "/".
02 YEAR PIC X(02).
01 ACCEPT-DATE.
02 YEAR PIC X(02).
02 MONTH-OF-YEAR PIC X(02).
02 DAY-OF-MONTH PIC X(02).
. . .
ACCEPT ACCEPT-DATE FROM DATE.
MOVE CORRESPONDING ACCEPT-DATE TO DATE-IN-PROGRAM.
01 DATE-IN-PROGRAM.
02 MONTH-OF-YEAR PIC X(02).
02 FILLER PIC X(01) VALUE "/".
02 DAY-OF-MONTH PIC X(02).
02 FILLER PIC X(01) VALUE "/".
02 YEAR PIC X(04).
01 CURRENT-DATE.
02 YEAR PIC X(04).
02 MONTH-OF-YEAR PIC X(02).
02 DAY-OF-MONTH PIC X(02).
. . .
MOVE FUNCTION CURRENT-DATE(1:8) TO CURRENT-DATE.
MOVE CORRESPONDING CURRENT-DATE TO DATE-IN-PROGRAM.
EXAMINE DATA-LENGTH TALLYING UNTIL FIRST " "Replace it in Enterprise COBOL with:
MOVE 0 TO TALLY INSPECT DATA-LENGTH TALLYING TALLY FOR CHARACTERS BEFORE " "
You can continue to use the TALLY special register wherever you can specify a WORKING-STORAGE elementary data item of integer value.
With Enterprise COBOL, you can use DISPLAY statements to replace EXHIBIT statements. However, the DISPLAY statement does not perform all the functions of the EXHIBIT statement.
OS/VS COBOL Enterprise COBOL
WORKING-STORAGE SECTION. WORKING-STORAGE SECTION.
77 DAT-1 PIC X(8). 77 DAT-1 PIC X(8).
77 DAT-2 PIC X(8). 77 DAT-2 PIC X(8).
. . . . . .
EXHIBIT NAMED DAT-1 DAT-2 DISPLAY "DAT-1 = " DAT-1
"DAT-2 = " DAT-2
OS/VS COBOL Enterprise COBOL
WORKING-STORAGE SECTION. WORKING-STORAGE SECTION.
77 DAT-1 PIC X(8). 77 DAT-1 PIC X(8).
77 DAT-2 PIC X(8). 77 DAT-2 PIC X(8).
77 DAT1-CMP PIC X(8).
77 DAT2-CMP PIC X(8).
. . . . . .
EXHIBIT CHANGED DAT-1 DAT-2 IF DAT-1 NOT EQUAL TO DAT1-CMP
DISPLAY DAT-1
END-IF
IF DAT-2 NOT EQUAL TO DAT2-CMP
DISPLAY DAT-2
END-IF
MOVE DAT-1 TO DAT1-CMP
MOVE DAT-2 TO DAT2-CMP
OS/VS COBOL Enterprise COBOL
WORKING-STORAGE SECTION. WORKING-STORAGE SECTION.
77 DAT-1 PIC X(8). 77 DAT-1 PIC X(8).
77 DAT-2 PIC X(8). 77 DAT-2 PIC X(8).
77 DAT1-CMP PIC X(8).
77 DAT2-CMP PIC X(8).
. . . . . .
EXHIBIT CHANGED NAMED IF DAT-1 NOT EQUAL TO DAT1-CMP
DAT-1 DAT-2 DISPLAY "DAT-1 = " DAT-1
END-IF
IF DAT-2 NOT EQUAL TO DAT2-CMP
DISPLAY "DAT-2 = " DAT-2
END-IF
MOVE DAT-1 TO DAT1-CMP
MOVE DAT-2 TO DAT2-CMP
Use the FILE-CONTROL FILE STATUS clause to replace the GIVING phrase. The FILE STATUS clause gives you information after each I/O request, rather than only after an error occurs.
Enterprise COBOL does not support these phrases. Therefore, you must remove any occurrences of the TOTALING/TOTALED phrases from the LABEL RECORDS clause. Also check the variables associated with these phrases.
In the equivalent fields, save any key or record data (for TOTALED AREA) or update and save any record count (for TOTALING AREA) before each WRITE to the file (this reflects the last record actually written to particular volume). Do not save this counter in the record area of the FD.
DECLARATIVES.
USE AFTER STANDARD ENDING FILE (or REEL)
LABEL PROCEDURE ON filename.
The ON statement allows selective execution of statements it contains. Similar functions are provided in Enterprise COBOL by the EVALUATE statement and the IF statement.
To prevent common file status 39 problems, see Preventing file status 39 for QSAM files.
| File type |
Rules |
|---|---|
ESDS and |
RECORDSIZE(avg,m) is specified where avg is the average size of the COBOL records, and is strictly less than m; m is greater than or equal to the maximum size of a COBOL record. |
| RRDS VSAM | RECORDSIZE(n,n) is specified where n is greater than or equal to the maximum size of a COBOL record. |
To replace the REREAD function, define a copy of your input records in the WORKING-STORAGE SECTION and move each record into WORKING-STORAGE after it is read.
To get function similar to the READY TRACE statement, you can use either Debug Tool, or the COBOL language available in the Enterprise COBOL compiler.
"AT GLOBAL LABEL PERFORM; LIST LINES %LINE; GO; END-PERFORM;"
If you use the COBOL language, the Enterprise COBOL USE FOR DEBUGGING ON ALL PROCEDURES declarative can perform functions similar to READY TRACE and RESET TRACE.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-370 WITH DEBUGGING MODE.
. . .
DATA DIVISION.
. . .
WORKING-STORAGE SECTION.
01 TRACE-SWITCH PIC 9 VALUE 0.
88 READY-TRACE VALUE 1.
88 RESET-TRACE VALUE 0.
. . .
PROCEDURE DIVISION.
DECLARATIVES.
COBOL-II-DEBUG SECTION.
USE FOR DEBUGGING ON ALL PROCEDURES.
COBOL-II-DEBUG-PARA.
IF READY-TRACE THEN
DISPLAY DEBUG-NAME
END-IF.
END DECLARATIVES.
MAIN-PROCESSING SECTION.
. . .
PARAGRAPH-3.
. . .
SET READY-TRACE TO TRUE.
PARAGRAPH-4.
. . .
PARAGRAPH-6.
. . .
SET RESET-TRACE TO TRUE.
PARAGRAPH-7.
where DEBUG-NAME is a field of the DEBUG-ITEM
special register that displays the procedure-name causing execution of the
debugging procedure. (In this example, the object program displays the names
of procedures PARAGRAPH-4 through PARAGRAPH-6 as control reaches each procedure
within the range.)At run time, you must specify PARM=/DEBUG in your EXEC statement to activate this debugging procedure. In this way, you have no need to recompile the program to activate or deactivate the debugging declarative.
Enterprise COBOL does not accept the REMARKS paragraph. As a replacement, use comment lines beginning with an * in column 7.
MOVE A TO B THEN ADD C TO D
MOVE A TO B ADD C TO D
HHMMSS (hour, minute, second)
Enterprise COBOL does not support the TIME-OF-DAY special register.
77 TIME-IN-PROGRAM PICTURE X(6).
. . .
MOVE TIME-OF-DAY TO TIME-IN-PROGRAM.
MOVE FUNCTION CURRENT-DATE (9:6) TO TIME-IN-PROGRAM
77 DATA-T PICTURE X(9) VALUE "ABCXYZCCC"
. . .
TRANSFORM DATA-T FROM "ABC" TO "CAT"
TRANSFORM evaluates
each character, changing each A to C, each B to A, and each C to T.After the TRANSFORM statement is executed. DATA-T contains "CATXYZTTT".
77 DATA-T PICTURE X(9) VALUE "ABCXYZCCC"
. . .
INSPECT DATA-T
CONVERTING "ABC" TO "CAT"
INSPECT CONVERTING evaluates
each character just as TRANSFORM does, changing each A to C, each B to A,
and each C to T.After the INSPECT CONVERTING statement is executed. DATA-T contains "CATXYZTTT:.
Therefore, you must remove any occurrences of the USE BEFORE STANDARD LABEL statement. Enterprise COBOL does not support nonstandard labels, so you cannot process nonstandard labeled files with Enterprise COBOL.