Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 3 Tools : @CLOSEDSN

@CLOSEDSN
Closes and frees the current file. (C)
Invocation
CALL @CLOSEDSN
Usage Notes
@WRITEDSN and @READDSN can be used to write to and read from the file.
If @CLOSEDSN is not used after @READDSN or @WRITEDSN, the file is closed automatically at the end of the transaction.
@CLOSEDSN accesses a z/OS file using the data set name. There is no provision for using a DDNAME with this tool instead of a data set name.
Example
The following rule specifies the file to use, writes data from the example table to it, closes the file, re-specifies it, reads back the first record from it, and prints that record to the message log:

 
CLOSEDSN_1;
_ LOCAL RECORD;
_ ------------------------------------------------------------------------
_ ------------------------------------------------------------+-----------
_ CALL @OPENDSN(TSOID || '.EXAMPLES.DATA'); | 1
_ FORALL EMPLOYEE : | 2
_ CALL @WRITEDSN(EMPLOYEE.LNAME); |
_ END; |
_ CALL @CLOSEDSN; | 3
_ CALL @OPENDSN(TSOID || '.EXAMPLES.DATA'); | 4
_ RECORD = @READDSN; | 5
_ CALL MSGLOG(RECORD); | 6
_ CALL @CLOSEDSN; | 7
_ ------------------------------------------------------------------------

 
Resulting Output
Pressing PF2 after executing this rule displays the following output:

 
------------------------ INFORMATIONAL MESSAGE LOG ---------------------
COMMAND ===> SCROLL ===> P
SMYTHE

 

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved