Progress0 of 0 lessons

CICS DOCUMENT SET - Document Configuration

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.

Command Syntax

cobol
1
2
3
4
5
6
7
EXEC CICS DOCUMENT SET [DOCUMENT(document-name)] [ATTRIBUTE(attribute-name)] [VALUE(attribute-value)] [RESP(response-code)] [RESP2(response-code-2)] END-EXEC.

Parameters

DOCUMENT(document-name)

Specifies the name of the document for which settings will be configured. This parameter identifies the target document for configuration operations.

ATTRIBUTE(attribute-name)

Specifies the name of the attribute to be set for the document. This parameter identifies the specific setting to be configured.

VALUE(attribute-value)

Specifies the value to be assigned to the specified attribute. This parameter provides the configuration value for the document setting.

RESP(response-code)

Specifies the response code variable to receive the operation result. This parameter provides error handling and status information.

RESP2(response-code-2)

Specifies the secondary response code variable for additional error information. This parameter provides extended error details when available.

Configuration Types

Format Settings

DOCUMENT SET configures document format settings such as page layout, margins, fonts, and presentation styles for document output.

Security Settings

The command supports security configuration for document access control, encryption, and authorization settings.

Processing Settings

Processing settings control document processing behavior, validation rules, and business logic parameters.

Output Settings

Output settings configure document generation parameters, delivery options, and output format specifications.

Programming Examples

Basic Document Configuration

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
WORKING-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.

Multiple Attribute Configuration

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
WORKING-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.

Dynamic Configuration Management

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
WORKING-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.

Error Handling

Response Code 0

Successful configuration setting. The document attribute has been successfully configured with the specified value.

Response Code 8

Invalid document name. The specified document name is invalid or not supported.

Response Code 12

Invalid attribute. The specified attribute name is invalid or not supported for the document.

Response Code 16

Invalid value. The specified attribute value is invalid or not compatible with the attribute.

Response Code 20

Configuration failed. The document configuration operation failed due to system conditions.

Performance Considerations

Configuration Impact

DOCUMENT SET efficiently applies configuration changes, but complex settings may impact document processing performance.

Attribute Validation

Proper attribute validation ensures configuration integrity and prevents invalid settings that could affect document processing.

Configuration Management

Efficient configuration management ensures optimal document processing and prevents configuration conflicts.

Best Practices

Error Handling

Always check response codes and handle errors appropriately, especially for attribute validation and value compatibility.

Attribute Validation

Validate attribute names and values before setting to ensure configuration integrity and prevent processing errors.

Configuration Consistency

Maintain configuration consistency across related documents to ensure uniform processing and output quality.

Document Optimization

Optimize document configurations for specific use cases and requirements to achieve optimal processing performance.

Explain It Like I's 5 Years Old

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.

Exercises

Exercise 1: Basic Document Configuration

Write a program that uses DOCUMENT SET to configure basic document attributes like page size and format.

Exercise 2: Multiple Attribute Configuration

Create a program that configures multiple document attributes including format, security, and output settings.

Exercise 3: Dynamic Configuration Management

Implement a configuration management system that dynamically sets document attributes based on business requirements.