Posts

Showing posts from August, 2025

STOP RUN, EXIT PROGRAM , GO BACK, NEXT STATEMENT AND CONTINUE STATEMENT.

  STOP RUN: It’s the last executable statement of the main program. It returns control back to OS. EXIT PROGRAM It’s the last executable statement of sub-program. It returns control back to main program. GO BACK It can be coded in main program as well as sub-program as the last statement. It just gives the control back from where it received the control.   NEXT Statement It transfers control to next sentiment after the nearest period. Example IF A3 = B3    IF A1 = B1      NEXT STATEMENT         IF A2 = B2         ELSE         DISPLAY “NO CONDITION “         END-IF     END-IF END-IF.      DISPLAY “NEXT STATEMENT In above example first “IF” is true then it check 2nd “IF” is true then it come out from IF loop and display the DISPLAY STATEM...

Sequential file read

 Sequential file read ID DIVISION.                                         PROGRAM-ID. ESDSRD.                                 ENVIRONMENT DIVISION.                               INPUT-OUTPUT SECTION.                               FILE-CONTROL.                  ...

STATIC AND DYNAMIC CALL

   STATIC CALL   DYNAMIC CALL   1. Identified by Call literal. Ex: CALL ‘PGM1’.   Identified by Call variable and the variable should be populated at run time. 01 WS-PGM PIC X(08). Move ‘PGM1’ to WS-PGM CALL WS-PGM   2.Default Compiler option is NODYNAM and so all the literal calls are considered as static calls. If you want convert the literal calls into DYNAMIC, the program should be compiled with DYNAM option. By default, call variables and any un-resolved calls are considered as dynamic. 3. If the subprogram undergoes change, sub program and main program need to be recompiled.   If the subprogram undergoes change, recompilation of subprogram is enough.   4. Sub modules are link edited with main module.   Sub modules are picked up during run time from the load library.   5. Size of load module will be large   Size of load module will be less.   6. Fast   Slow compared to Static call.   7. Less flexible.   More...

COBOL + DB2

Image
There are various step involved before we run/execute a COBOL + DB2 program.    Below step are the various steps.   Precompile.   Compile.   Link edit.   Bind.    Package & plan. Step 1: Precompile               COBOL compiler did not understand about SQL statement so, it undergoes to precompile. In precompile.     Expands all include copybooks which are written in program.     Extracts all SQL statements into DBRM and SQL statement are convert into call statements.    Generates time-stamp for modified source codes and DBRM .there are checked at run time.    Check syndicated error of SQL statements and validates the fields based on the table declaration from dclgen copybook.    Notes: precompilation process can be executed even if DB2 is down. DSNHPC    ----------- It is the program used for precompilation. Step 2:  Compile       ...

cobol abends

  1.       What are the causes for S0C1, S0C4, S0C5, S0C7, and S0CB ABENDs? S0C1  - May be due to 1.Missing or misspelled DD name 2.Read/Write to unopened DataSet 3.Read to DataSet opened output 4.Write to DataSet opened input 5.Called subprogram not found S0C4     - M ay be due to 1.Missing Select statement   (during compile) 2.Bad Subscript/index 3.Protection Exception 4.Missing parameters on called subprogram 5.Read/Write to unopened file 6.Move data from/to unopened file S0C5    -  May be due to 1.Bad Subscript/index 2.Close an  unopen unopened  DataSet 3.Bad exit from a perform 4.Access to I/O area   (FD) before read S0C7   -  M m ay be due to 1.Numeric operation on non-numeric data 2.Un-initialize working-storage 3.Coding past the maximum allowed sub script S0CB  - M m ay be due to 1.Division by Zero       2.       What do you do to resol...

files and db2 abends&cics

  File error codes: 00: Successful operation. 02: Duplicate key, non-unique key, alt index. 10: End of file. 20: Invalid key VSAM KSDS/RRDS. 21: Key errors (rewrite & write). 22: Duplicate primary key found. 23: Record not found. 24: Disk filled or key outside of boundary of file. 37: Wrong mode. 39: File attributes do not match COBOL description. 91: password or authorization failed. 92: logic error. 93: Resources are not available. 95: Invalid file information. 96: No DD statement for the file. 97: Open successful. 98: File is locked. 99: Record locked. -------------------------------------------------------------------------------------------- DB2 Return code. Note: 0: means successful execution. -ve: Negative means unsuccessful with an error. +ve: Positive means successful execution with a warning. 00: Successful operation. -104: illegal symbol using. -117: no of values in the insert does not match the no of columns. -180: wrong data passing to column. -204: Object not defi...

jcl

  what is ABEND?   An ABEND (abnormal end) is an exception condition which results in the abnormal termination of a program or software. It is a common terminology used in the mainframe world where a JCL terminates with an error code.  S0CB  -   Attempting to divide by 0 and not using ON SIZE ERROR S002  -   Very large record length/ wrong record length Sx22  -  Job has been cancelled. The value of x will vary depending on the way the job was  cancelled. . S222  -   Means job was cancelled by a user or operator without a dump.               If a TSO session times out you will probably get an S522 ABEND code. S222  -   The job was cancelled (by subsystem or operator) because it violated               Some restriction. S522 ...