Category: Cobol

COBOL date functions list, add find Duration

Below are COBOL date functions to add, Subtract and Find the duration between Dates, Times and Time stamps. 1. ADD-DURATION This is rarely seen in our programs but really a helpful Intrinsic function that COBOL provided. This is to add a specific duration to a date/time variable/value. For example if 1 year needs to be

COBOL Edited Picture Clause Examples

Edited Picture Clause in COBOL is to format the display of data in the required format. COBOL provides symbols toformat the data, these are called “Edit Symbols” and the PIC clauses that contain these symbols are called “Edited Picture clauses”. There are basically two types of Edited picture clauses based on their type of editing.1.

Initialization in Cobol

Initialization in COBOL is used to set the declared variable values to an initial value. It sets the Alphanumeric type(alphabetic, alphanumeric, alphanumeric-edited, DBCS, national, or national-edited) field values to Spaces and Numeric type(numeric or numeric-edited) field values to Zeroes. It is equivalent of moving eirther zeroes are spaces to the variables according to their data

Reference Modification With OF

COBOL Reference Modification With OF Syntax to use reference modification for a filed, which exists in multiple groups. Ex: 01 ww-grp1 03 name1 pic x(10) 03 sal pic 9(4) 01 ww-grp2 03 name1 pic x(10) 03 sal pic 9(4) name1 exists in both groups. So if we want to use reference modification for ww-grp1 move

Difference Between LINK/XCTL and COBOL Calls

Difference Between LINK XCTL and COBOL Calls(Static & Dynamic) 1. LINK –> Every time a subprogram is invoked an initialized version of working storage is provided. Dynamic& Static –> Not every time a separate copy of working storage is provided. It is provided only for the first time invocation of sub-program and for the subsequent

COBOL RANDOM Function Examples

COBOL RANDOM Function generates the random fractional values ranging from 0 to 1. It generates values like 0.xxx For example if we declared the variable as below 01 WW-RANDOM-NUMBERS PIC 99.999 VALUE ZEROES. PERFORM VARYING WW-SUB1 FROM 1 BY 1 UNTIL WW-SUB1 > 9 COMPUTE WW-RANDOM-NUMBERS = FUNCTION RANDOM DISPLAY ‘–>’WW-RANDOM-NUMBERS END-PERFORM Result: –>00.443 –>00.060

COBOL INSPECT VERB USAGE & SYNTAX WITH EXAMPLES

INSPECT verb in COBOL is very useful and it is used to do the following functionalities  Count a particular Character in a string  Convert Lower case to upper case  Replace a particular Character with other character in a string  Replace a set of characters with another set of characters Below are the different examples on

COBOL DB2 Multi Row Fetch

Multi row Fetch Overview in COBOl Db2 program WITH EXAMPLE: Cobol Db2 multi row fetch concept will be used to retrieve multiple rows with a single fetch statement as opposed with a normal cursor which fetches only single record at a time. The multi-row fetch capability was introduced to DB2 z/OS in Version 8. This

COBOL Index & Subscript

COBOL Index and Subscript – Performance considerations Index and Subscript in COBOL are the very important concepts. Both are used to reference an array or table element in COBOL programs. By knowing the basic differences between the two, one can code the programs efficiently in performance point of view. 1. Index –> Represents the displacement

COBOL Perform Types and Usage with examples

Perform Verb in COBOL is used to execute a set of COBOL statements. There exists different types of performs based on the way that is being used. It is vital in keeping a cobol program structured by making it possible to call different paragraphs or sections from another paragraph or section. Following are some of
Close Bitnami banner