By using Intrinsic function, FUNCTION CURRENT-DATE
Posted Date:- 2021-09-03 06:21:34
The difference between the next and continue verb is that in the continue verb it is used for a situation where there in no EOF condition that is the records are to be accessed again and again in an file, whereas in the next verb the indexed file is accessed sequentially, read next record command is used.
Posted Date:- 2021-09-03 06:20:54
Because, Occurs clause is there to repeat fields with same format, not the records.
Posted Date:- 2021-09-03 06:19:44
Always compare on the highest-level first, because if you have a break at a highest level, each level beneath it must also break. Add to the lowest level for each record but add to the higher level only on a break.
Posted Date:- 2021-09-03 06:18:54
There is no picture clause to be given. Example 01 WS-VAR USAGE COMP-1.
Posted Date:- 2021-09-03 06:17:52
It is stored in the most significant bit. Bit is ON if -ve, OFF if +ve.
Posted Date:- 2021-09-03 06:17:14
01 EMP-GRP.
49 E-LEN PIC S9(4) COMP.
49 E-NAME PIC X(25).
Posted Date:- 2021-09-03 06:16:02
The PERFORM and END-PERFORM statements bracket all COBOL II statements between them. The COBOL equivalent is to PERFORM or PERFORM THRU a paragraph. In line PERFORMs work as long as there are no internal GO TOs, not even to an exit. The in line PERFORM for readability should not exceed a page length - often it will reference other PERFORM paragraphs.
Posted Date:- 2021-09-03 06:14:57
A report item is a field to be printed which has Edit Symbols.
Posted Date:- 2021-09-03 06:14:16
A literal is a data item which consists value by itself. It cannot be referred by a name. They are constant data items. There are two types of literals:
String / Alphanumeric Literals
Numeric Literals
Posted Date:- 2021-09-03 06:13:30
S(8) can store 4 bytes and the highest value is 99999999.
Posted Date:- 2021-09-03 06:12:58
The serial SEARCH verb is equivalent to the Perform-Varying statement, and it is nothing but search without ALL.
Posted Date:- 2021-09-03 06:12:18
Even before the REWRITE is performed, the record must be opened and read from the file. For the same purpose, the file must be opened in I-O mode for REWRITE functionality.
Posted Date:- 2021-09-03 06:11:43
The parameters passed in a call by context are protected from modification by the called program. In a normal call they are able to be modified.
Posted Date:- 2021-09-03 06:10:56
A subscript is a working storage data definition item, typically a PIC (999) where a value must be moved to the subscript and then incremented or decrements by ADD TO and SUBTRACT FROM statements. An index is a register item that exists outside the programs working storage. You SET an index to a value and SET it UP BY value and DOWN BY value.
Posted Date:- 2021-09-03 06:09:14
1) use 'evaluate' stmt for constructing cases.
2) use scope terminators for nesting.
3) use in line perform stmt for writing 'do ' constructions.
4) use test before and test after in the perform stmt for writing do-while constructions.
Posted Date:- 2021-09-03 06:07:34
The program will go in an infinite loop.
Posted Date:- 2021-09-03 06:06:21
INITIALIZE moves spaces to alphabetic fields and zeros to alphanumeric fields. The REPLACING option can be used to override these defaults.
Posted Date:- 2021-09-03 06:05:34
In a binary search the table element key values must be in ascending or descending sequence. The table is 'halved' to search for equal to, greater than or less than conditions until the element is found. In a sequential search the table is searched from top to bottom, so (ironically) the elements do not have to be in a specific sequence. The binary search is much faster for larger tables, while sequential works well with smaller ones. SEARCH ALL is used for binary searches; SEARCH for sequential.
Posted Date:- 2021-09-03 06:04:58
Searching orders for SEARCH ALL can be either ASCENDING or DESCENDING. ASCENDING is the default one. If you want the search to be done on an array sorted in descending order, then while defining the array, you should give DESCENDING KEY clause. (You must load the table in the specified order).
Posted Date:- 2021-09-03 06:03:38
INITIALIZE verb initializes the values in a data item to the default value. Numeric edited items are set to zero, alphabetic fields and alphanumeric edited items are set to spaces. FILLERS, OCCURS DEPENDING ON items are left untouched.
Posted Date:- 2021-09-03 06:02:46
Fixed Block File – Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0 .
Fixed Unblocked – Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, do not use BLOCK CONTAINS
Variable Block File – Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, BLOCK CONTAINS 0. Do not code the 4 bytes for record length in FD ie JCL rec length will be max rec length in pgm + 4 Variable Unblocked – Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, do not use BLOCK CONTAINS. Do not code 4 bytes for record length in FD ie JCL rec length will be max rec length in pgm + 4.
ESDS VSAM file – Use ORGANISATION IS SEQUENTIAL.
KSDS VSAM file – Use ORGANISATION IS INDEXED, RECORD KEY IS, ALTERNATE RECORD KEY IS
RRDS File – Use ORGANISATION IS RELATIVE, RELATIVE KEY IS
Printer File – Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0. (Use RECFM=FBA in JCL DCB).
Posted Date:- 2021-09-03 06:01:54
In COBOL II the optional clause WITH TEST BEFORE or WITH TEST AFTER can be added to all perform statements. By default the test is performed before the perform.
Posted Date:- 2021-09-03 06:01:27
A subscript is a working storage data definition item, typically a PIC (999) where a value must be moved to the subscript and then incremented or decrements by ADD TO and SUBTRACT FROM statements. An index is a register item that exists outside the program's working storage. You SET an index to a value and SET it UP BY value and DOWN BY value.
Posted Date:- 2021-09-03 06:00:45
Scope terminators are mandatory for in-line PERFORMS and EVALUATE statements. Make scope terminator as explicit for good coding standards.
Posted Date:- 2021-09-03 06:00:06
SORT can be performed when
1. Input and Output files must remain closed
2. Working file must have a select clause
3. Input and Output files have FD entries
4. Work file should have short description in File Section
Posted Date:- 2021-09-03 05:59:39
Using EXEC CICS SPOOL WRITE (var-name) END-EXEC command. Var-name is a COBOL host structure containing JCL statements.
Posted Date:- 2021-09-03 05:58:12
1. You can REDEFINE a Variable from one PICTURE class to another PICTURE class by using the same memory location.
2. By REDEFINES we can INITIALISE the variable in WORKING-STORAGE Section itself.
3. We can REDEFINE a Single Variable into so many sub variables. (This facility is very useful in solving Y2000 Problem.)
Posted Date:- 2021-09-03 05:57:40
A program that follows a top down approach. It is also one that other programmers or users can follow logically and is easy to read and understand.
Posted Date:- 2021-09-03 05:57:13
In a binary search, the table element key values will be in ascending or descending sequence. The table is ‘halved'(Divided into two) to search for equal to, greater than or less than conditions until the element is found.
In a sequential search, the table is searched from top to bottom, so the elements do not have to be in a specific sequence.
The binary search is much faster for more tables, while sequential Search works well with lesser ones. SEARCH ALL is used for binary search; SEARCH for sequential search.
Posted Date:- 2021-09-03 05:56:47
First, we have to compare the item to be searched with the item at the center.
If it matches, it is good to go with the value else repeat the process with the left half or the right half depending on where the item lies.
Posted Date:- 2021-09-03 05:56:03
To find out the current date with the century, use an Intrinsic function called Function Current Date.
Posted Date:- 2021-09-03 05:55:22
Following guidelines to be following while writing Cobol program:
>> Use ‘EVALUATE’ statement for constructing cases.
>> Use scope terminators for nesting.
>> Use in-line Perform statement for writing ‘do’ constructions.
>> Use Test Before and Test After in the Perform statement while writing Do-While statements.
Posted Date:- 2021-09-03 05:54:38
One must follow certain guidelines while writing COBOL. They are mentioned below:
Using the ‘EVALUATE’ statement for constructing cases
Using scope terminators for nesting
Using in-line Perform statement for writing ‘do’ constructions
Using Test Before and Test After in the Perform statement while writing Do-While statements
Posted Date:- 2021-09-03 05:53:19
Pic 9v99 refers to a three-position numeric field with an implied or assumed decimal point after the first position.
Here, v stands for an implied decimal point.
Posted Date:- 2021-09-03 05:52:50
When any data name, file-name, Record-name, condition name or Index defined in an Including Program can be referenced by a directly or indirectly in an included program, Provided the said name has been declared to be a global name by GLOBAL Format of Global Clause is01 data-1 pic 9(5) IS GLOBAL.
Posted Date:- 2021-09-03 05:52:11
REPLACING allows for the same copy to be repeated more than once in the same code just by replacing the value.
Syntax: COPY REPLACING BY
Posted Date:- 2021-09-03 05:51:33
Because, Occurs clause is there to repeat fields with same format, not the records.
Posted Date:- 2021-09-03 05:51:11
No, it can be used only with alphabetic and alphanumeric data types.
Posted Date:- 2021-09-03 05:50:48
You can REDEFINE a Variable from one PICTURE class to another PICTURE class by using the same memory location. By REDEFINES we can INITIALIZE the variable in WORKING-STORAGE Section itself. We can REDEFINE a Single Variable into so many sub-variables. (This facility is very useful in solving Y2K Problem.)
Posted Date:- 2021-09-03 05:50:26
The PERFORM and END-PERFORM statements bracket all COBOL II statements between them. The COBOL equivalent is to PERFORM or PERFORM THRU a paragraph. In line PERFORMs work as long as there are no internal GO TOs, not even to an exit. The in line PERFORM for readability should not exceed a page length - often it will reference other PERFORM paragraphs.
Posted Date:- 2021-09-03 05:50:05
A scope terminator brackets its preceding verb, e.g. IF .. END-IF, so that all statements between the verb and its scope terminator are grouped together. Other common COBOL II verbs are READ, PERFORM, EVALUATE, SEARCH and STRING.
Posted Date:- 2021-09-03 05:49:33
There are at least five differences:
COBOL II supports structured programming by using in line Performs and explicit scope terminators, It introduces
new features (EVALUATE, SET. TO TRUE, CALL. BY CONTEXT, etc) It permits programs to be loaded and
addressed above the 16-megabyte line It does not support many old features (READY TRACE, REPORT-WRITER,
ISAM, Etc.), and It offers enhanced CICS support.
Posted Date:- 2021-09-03 05:49:04
COMP is a binary storage format while COMP-3 is packed decimal format.
Posted Date:- 2021-09-03 05:48:21
Packed Decimal fields: Sign is stored as a hex value in the last nibble (4 bits ) of the storage.
Zoned Decimal fields: As a default, sign is over punched with the numeric value stored in the last bite
Posted Date:- 2021-09-03 05:48:00
Scope terminator is used to mark the end of a verb e.g. EVALUATE, END-EVALUATE; IF, END-IF.
Posted Date:- 2021-09-03 05:47:23
Through an IN-LINE PERFORM statement, the routine is being performed to be nested within the perform statement instead of being a separate paragraph.
While the PERFORM and END-PERFORM statements are used to block the COBOL statements between them, in line PERFORM work as long as there are no internal GO TOs, not even to an exit.
Posted Date:- 2021-09-03 05:46:53
Each time the program is called, Local-Storage is allocated, and then it is deallocated when the program stops via an EXIT PROGRAM, GOBACK, or STOP RUN. It is defined in the DATA DIVISION after WORKING-STORAGE SECTION.
Posted Date:- 2021-09-03 05:46:32
Structured programming can be defined as a logical way of programming. In this, the functionalities are divided into modules and help the programmer to write the code logically.
Object-Oriented COBOL is a natural way of programming. In this, programmers identify the objects and then write functions and procedures around that object.
Posted Date:- 2021-09-03 05:46:10
The ACCEPT verb is a basic statement used in COBOL for retrieving data like time, date and day from the user or program. In the educational data, ACCEPT verb and DISPLAY are used to receive information for a student record.
Posted Date:- 2021-09-03 05:45:36