CICS DOCUMENT SET provides document configuration capabilities in CICS environments. It enables programs to configure document settings, manage document operations, and handle document configuration for customization and control purposes.
1234567EXEC CICS DOCUMENT SET [DOCUMENT(document-name)] [ATTRIBUTE(attribute-name)] [VALUE(attribute-value)] [RESP(response-code)] [RESP2(response-code-2)] END-EXEC.
Specifies the name of the document for which settings will be configured. This parameter identifies the target document for configuration operations.
Specifies the name of the attribute to be set for the document. This parameter identifies the specific setting to be configured.
Specifies the value to be assigned to the specified attribute. This parameter provides the configuration value for the document setting.
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.
DOCUMENT SET configures document format settings such as page layout, margins, fonts, and presentation styles for document output.
The command supports security configuration for document access control, encryption, and authorization settings.
Processing settings control document processing behavior, validation rules, and business logic parameters.
Output settings configure document generation parameters, delivery options, and output format specifications.
123456789101112131415161718192021WORKING-STORAGE SECTION. 01 DOCUMENT-NAME PIC X(16) VALUE 'INVOICE-001'. 01 ATTRIBUTE-NAME PIC X(20) VALUE 'PAGE-SIZE'. 01 ATTRIBUTE-VALUE PIC X(20) VALUE 'A4'. 01 RESPONSE-CODE PIC S9(8) COMP. 01 RESPONSE-CODE-2 PIC S9(8) COMP. PROCEDURE DIVISION. EXEC CICS DOCUMENT SET DOCUMENT(DOCUMENT-NAME) ATTRIBUTE(ATTRIBUTE-NAME) VALUE(ATTRIBUTE-VALUE) RESP(RESPONSE-CODE) RESP2(RESPONSE-CODE-2) END-EXEC IF RESPONSE-CODE = 0 DISPLAY 'Document configuration set successfully' ELSE DISPLAY 'Error setting document configuration: ' RESPONSE-CODE END-IF.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657WORKING-STORAGE SECTION. 01 DOCUMENT-NAME PIC X(16) VALUE 'REPORT-001'. 01 ATTRIBUTE-NAME PIC X(20). 01 ATTRIBUTE-VALUE PIC X(20). 01 RESPONSE-CODE PIC S9(8) COMP. 01 RESPONSE-CODE-2 PIC S9(8) COMP. 01 CONFIG-COUNT PIC S9(8) COMP VALUE 0. PROCEDURE DIVISION. PERFORM SET-PAGE-FORMAT PERFORM SET-SECURITY-LEVEL PERFORM SET-OUTPUT-OPTIONS. SET-PAGE-FORMAT. MOVE 'PAGE-SIZE' TO ATTRIBUTE-NAME MOVE 'LETTER' TO ATTRIBUTE-VALUE EXEC CICS DOCUMENT SET DOCUMENT(DOCUMENT-NAME) ATTRIBUTE(ATTRIBUTE-NAME) VALUE(ATTRIBUTE-VALUE) RESP(RESPONSE-CODE) RESP2(RESPONSE-CODE-2) END-EXEC IF RESPONSE-CODE = 0 ADD 1 TO CONFIG-COUNT DISPLAY 'Page format configured' END-IF. SET-SECURITY-LEVEL. MOVE 'SECURITY-LEVEL' TO ATTRIBUTE-NAME MOVE 'HIGH' TO ATTRIBUTE-VALUE EXEC CICS DOCUMENT SET DOCUMENT(DOCUMENT-NAME) ATTRIBUTE(ATTRIBUTE-NAME) VALUE(ATTRIBUTE-VALUE) RESP(RESPONSE-CODE) RESP2(RESPONSE-CODE-2) END-EXEC IF RESPONSE-CODE = 0 ADD 1 TO CONFIG-COUNT DISPLAY 'Security level configured' END-IF. SET-OUTPUT-OPTIONS. MOVE 'OUTPUT-FORMAT' TO ATTRIBUTE-NAME MOVE 'PDF' TO ATTRIBUTE-VALUE EXEC CICS DOCUMENT SET DOCUMENT(DOCUMENT-NAME) ATTRIBUTE(ATTRIBUTE-NAME) VALUE(ATTRIBUTE-VALUE) RESP(RESPONSE-CODE) RESP2(RESPONSE-CODE-2) END-EXEC IF RESPONSE-CODE = 0 ADD 1 TO CONFIG-COUNT DISPLAY 'Output format configured' END-IF.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354WORKING-STORAGE SECTION. 01 DOCUMENT-NAME PIC X(16) VALUE 'DYNAMIC-DOC'. 01 ATTRIBUTE-NAME PIC X(20). 01 ATTRIBUTE-VALUE PIC X(20). 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 > 4 PERFORM BUILD-ATTRIBUTE-NAME PERFORM BUILD-ATTRIBUTE-VALUE PERFORM SET-DOCUMENT-ATTRIBUTE END-PERFORM. BUILD-ATTRIBUTE-NAME. EVALUATE PROCESSING-COUNT WHEN 1 MOVE 'FONT-SIZE' TO ATTRIBUTE-NAME WHEN 2 MOVE 'MARGIN-LEFT' TO ATTRIBUTE-NAME WHEN 3 MOVE 'MARGIN-RIGHT' TO ATTRIBUTE-NAME WHEN 4 MOVE 'LINE-SPACING' TO ATTRIBUTE-NAME END-EVALUATE. BUILD-ATTRIBUTE-VALUE. EVALUATE PROCESSING-COUNT WHEN 1 MOVE '12' TO ATTRIBUTE-VALUE WHEN 2 MOVE '1.0' TO ATTRIBUTE-VALUE WHEN 3 MOVE '1.0' TO ATTRIBUTE-VALUE WHEN 4 MOVE '1.5' TO ATTRIBUTE-VALUE END-EVALUATE. SET-DOCUMENT-ATTRIBUTE. EXEC CICS DOCUMENT SET DOCUMENT(DOCUMENT-NAME) ATTRIBUTE(ATTRIBUTE-NAME) VALUE(ATTRIBUTE-VALUE) RESP(RESPONSE-CODE) RESP2(RESPONSE-CODE-2) END-EXEC IF RESPONSE-CODE = 0 DISPLAY 'Attribute ' ATTRIBUTE-NAME ' set to ' ATTRIBUTE-VALUE ELSE DISPLAY 'Error setting attribute ' ATTRIBUTE-NAME ': ' RESPONSE-CODE END-IF.
Successful configuration setting. The document attribute has been successfully configured with the specified value.
Invalid document name. The specified document name is invalid or not supported.
Invalid attribute. The specified attribute name is invalid or not supported for the document.
Invalid value. The specified attribute value is invalid or not compatible with the attribute.
Configuration failed. The document configuration operation failed due to system conditions.
DOCUMENT SET efficiently applies configuration changes, but complex settings may impact document processing performance.
Proper attribute validation ensures configuration integrity and prevents invalid settings that could affect document processing.
Efficient configuration management ensures optimal document processing and prevents configuration conflicts.
Always check response codes and handle errors appropriately, especially for attribute validation and value compatibility.
Validate attribute names and values before setting to ensure configuration integrity and prevent processing errors.
Maintain configuration consistency across related documents to ensure uniform processing and output quality.
Optimize document configurations for specific use cases and requirements to achieve optimal processing performance.
Imagine you have a coloring book, and you want to change how you color it. CICS DOCUMENT SET is like choosing different crayons and settings for your coloring book.
The document name is like the name of your coloring book, the attribute is like what you want to change (like the color or size), and the value is like what you want to change it to (like red or big).
Just like you need to make sure you're using the right crayons for your coloring book, the program needs to make sure it's using the right settings for the document.
Write a program that uses DOCUMENT SET to configure basic document attributes like page size and format.
Create a program that configures multiple document attributes including format, security, and output settings.
Implement a configuration management system that dynamically sets document attributes based on business requirements.
Understanding CICS document management and operations
Learning about CICS configuration and settings management
Understanding CICS document formatting and presentation
Learning about CICS error handling and response codes