Cob Questions
Cob Questions
34 NUMBER
Use the NUMBER compiler option if you have line numbers in your source code and
want those numbers to be used in error messages and SOURCE, MAP, LIST, and XREF
listings.
If you request NUMBER, the compiler checks columns 1 through 6 to make sure that
they contain only numbers and that the numbers are in numeric collating sequence.
(In contrast, SEQUENCE checks the characters in these columns according to EBCDIC
collating sequence.) When a line number is found to be out of sequence, the
compiler assigns to it a line number with a value one higher than the line number
of the preceding statement. The compiler flags the new value with two asterisks and
includes in the listing a message indicating an out-of-sequence error. Sequence-
checking continues with the next statement, based on the newly assigned value of
the previous line.
If you use COPY statements and NUMBER is in effect, be sure that your source
program line numbers and the copybook line numbers are coordinated.
If you are doing a batch compilation and LIB and NUMBER are in effect, all programs
in the batch compile will be treated as a single input file. The sequence numbers
of the entire input file must be in ascending order.
Use NONUMBER if you do not have line numbers in your source code, or if you want
the compiler to ignore the line numbers you do have in your source code. With
NONUMBER in effect, the compiler generates line numbers for your source statements
and uses those numbers as references in listings.
---
------
MAIN-PARA.
COMPUTE OUTPUT1 = FUNCTION INTEGER-OF-DATE(DATE-TIME)
DISPLAY OUTPUT1.
STOP RUN.
argument-1
Must be an integer of the form YYYYMMDD, whose value is obtained from the
calculation (YYYY * 10,000) + (MM * 100) + DD, where:
* DD represents a day and must be a positive integer less than 32, provided that
it is valid for the specified month and year combination.
Are you aware that "integer" in the context of the manual quote means a PIC 9(08)
variable? Using a group level as you are doing is not allowed -- hence the compile
error. Either use a REDEFINES or MOVE the group level variable to an elementary
variable.
---
---
file status 44 :
Quote:
| | | 4 | A boundary violation exists because an attempt was made to rewrite a |
| | | | record to a file and the record was not the same size as the record being |
---
The EXIT statement leaves files open in memory. The CANCEL statement closes the
files and releases the memory that the canceled program occupies,
----
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
UNLOAD TABLESPACE DSN8D10A.DSN8S81E
FROM TABLE DSN8A10.EMP
WHEN (WORKDEPT = 'D11' AND SALARY > 25000)
Example 2: Unloading specific columns by using a field specification list
The following control statement specifies that columns EMPNO, LASTNAME, and SALARY
are to be unloaded, in that order, for all rows that meet the specified conditions.
These conditions are specified in the WHEN clause and are the same as those
conditions in example 1. The SALARY column is to be unloaded as type DECIMAL
EXTERNAL. The NOPAD option indicates that variable-length fields are to be unloaded
without any padding.
UNLOAD TABLESPACE DSN8D10A.DSN8S81E NOPAD
FROM TABLE DSN8A10.EMP
(EMPNO, LASTNAME, SALARY DECIMAL EXTERNAL)
WHEN (WORKDEPT = 'D11' AND SALARY > 25000)
The output from this example might look similar to the following output:
000060@@STERN# 32250.00
000150@@ADAMSON# 25280.00
000200@@BROWN# 27740.00
000220@@LUTZ# 29840.00
200220@@JOHN# 29840.00
In this output:
'@@' before the last name represents the 2-byte binary field that contains the
length of the VARCHAR field LASTNAME (for example, X'0005' for STERN).
'#' represents the NULL indicator byte for the nullable SALARY field.
----