CICS ENDBR provides browse operation termination capabilities in CICS environments. It enables programs to end browse operations, manage file operations, and handle browse termination for proper resource cleanup and file management.
12345EXEC CICS ENDBR [FILE(file-name)] [RESP(response-code)] [RESP2(response-code-2)] END-EXEC.
Specifies the name of the file for which the browse operation will be ended. This parameter identifies the target file for browse termination.
Specifies the response code variable to receive the operation result. This parameter provides error handling and status information.
Specifies the secondary response code variable for additional error information. This parameter provides extended error details when available.
ENDBR terminates browse operations normally, releasing file resources and completing the browse session for proper cleanup.
The command supports emergency browse termination for handling error conditions and abnormal program termination.
Conditional browse termination enables ending browse operations based on specific business rules and data conditions.
Resource cleanup ensures proper release of file resources, locks, and browse cursors for optimal system performance.
12345678910111213141516171819WORKING-STORAGE SECTION. 01 FILE-NAME PIC X(8) VALUE 'CUSTOMER'. 01 RESPONSE-CODE PIC S9(8) COMP. 01 RESPONSE-CODE-2 PIC S9(8) COMP. PROCEDURE DIVISION. EXEC CICS ENDBR FILE(FILE-NAME) RESP(RESPONSE-CODE) RESP2(RESPONSE-CODE-2) END-EXEC IF RESPONSE-CODE = 0 DISPLAY 'Browse operation ended successfully' DISPLAY 'File: ' FILE-NAME DISPLAY 'Resources released' ELSE DISPLAY 'Error ending browse: ' RESPONSE-CODE END-IF.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546WORKING-STORAGE SECTION. 01 FILE-NAME PIC X(8). 01 RESPONSE-CODE PIC S9(8) COMP. 01 RESPONSE-CODE-2 PIC S9(8) COMP. 01 END-COUNT PIC S9(8) COMP VALUE 0. PROCEDURE DIVISION. PERFORM END-CUSTOMER-BROWSE PERFORM END-PRODUCT-BROWSE PERFORM END-ORDER-BROWSE. END-CUSTOMER-BROWSE. MOVE 'CUSTOMER' TO FILE-NAME EXEC CICS ENDBR FILE(FILE-NAME) RESP(RESPONSE-CODE) RESP2(RESPONSE-CODE-2) END-EXEC IF RESPONSE-CODE = 0 ADD 1 TO END-COUNT DISPLAY 'Customer browse ended' END-IF. END-PRODUCT-BROWSE. MOVE 'PRODUCT' TO FILE-NAME EXEC CICS ENDBR FILE(FILE-NAME) RESP(RESPONSE-CODE) RESP2(RESPONSE-CODE-2) END-EXEC IF RESPONSE-CODE = 0 ADD 1 TO END-COUNT DISPLAY 'Product browse ended' END-IF. END-ORDER-BROWSE. MOVE 'ORDER' TO FILE-NAME EXEC CICS ENDBR FILE(FILE-NAME) RESP(RESPONSE-CODE) RESP2(RESPONSE-CODE-2) END-EXEC IF RESPONSE-CODE = 0 ADD 1 TO END-COUNT DISPLAY 'Order browse ended' END-IF.
1234567891011121314151617181920212223242526272829303132333435WORKING-STORAGE SECTION. 01 FILE-NAME PIC X(8). 01 RESPONSE-CODE PIC S9(8) COMP. 01 RESPONSE-CODE-2 PIC S9(8) COMP. 01 PROCESSING-COUNT PIC S9(8) COMP VALUE 0. PROCEDURE DIVISION. PERFORM VARYING PROCESSING-COUNT FROM 1 BY 1 UNTIL PROCESSING-COUNT > 3 PERFORM BUILD-FILE-NAME PERFORM END-BROWSE-OPERATION END-PERFORM. BUILD-FILE-NAME. EVALUATE PROCESSING-COUNT WHEN 1 MOVE 'CUSTOMER' TO FILE-NAME WHEN 2 MOVE 'PRODUCT' TO FILE-NAME WHEN 3 MOVE 'ORDER' TO FILE-NAME END-EVALUATE. END-BROWSE-OPERATION. EXEC CICS ENDBR FILE(FILE-NAME) RESP(RESPONSE-CODE) RESP2(RESPONSE-CODE-2) END-EXEC IF RESPONSE-CODE = 0 DISPLAY 'Browse ended for ' FILE-NAME ELSE DISPLAY 'Error ending browse for ' FILE-NAME ': ' RESPONSE-CODE END-IF.
Successful browse termination. The browse operation has been successfully ended and resources have been released.
Invalid file name. The specified file name is invalid or not supported.
No active browse. There is no active browse operation for the specified file.
End operation failed. The browse termination operation failed due to system conditions.
Resource not available. The browse termination capability is not available in the current execution context.
ENDBR efficiently releases file resources, but delayed termination may impact system performance and resource availability.
Proper resource management ensures efficient browse operations and prevents resource leaks and system performance issues.
Cleanup efficiency ensures optimal resource release and prevents resource exhaustion in high-volume environments.
Always check response codes and handle errors appropriately, especially for browse validation and resource availability.
Implement proper resource cleanup by ensuring all browse operations are properly terminated to prevent resource leaks.
Manage browse operations efficiently by ending them at appropriate times and preventing unnecessary resource consumption.
Implement proper exception handling to ensure browse operations are terminated even when errors occur during processing.
Imagine you're looking through a big book, and when you're done looking, you need to close the book and put it back on the shelf. CICS ENDBR is like closing the book and putting it back.
The file name is like the name of the book you were looking through. When you end the browse, you're telling the program that you're done looking at that book and it can put it away.
Just like you need to close books when you're done with them so other people can use them, the program needs to end browse operations so other programs can use the files.
Write a program that uses ENDBR to terminate a browse operation and verify the termination was successful.
Create a program that manages multiple browse operations and terminates them appropriately.
Implement a browse management system that ensures browse operations are terminated even when errors occur.