Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : @READDSN

@READDSN
Returns the next record from the current file. (F)
Invocation
record = @READDSN
 
On return, contains the record that was read. Its syntax can be either C (fixed-length character string) or V (variable-length character string).
Usage Notes
On a TIBCO Object Service Broker for Windows system, when the data is written to the external file, it is subject to the type specification for the file as given in filespec.dsn or by the DSBIFTYPE Execution Environment parameter. If the file type is LENGTH_PREFIXED_EBCDIC, the data is left alone and read as EBCDIC. If the file type is LINE_SEPARATED_ASCII, the data is converted from ASCII to EBCDIC when read, and back from EBCDIC to ASCII when written (using @WRITEDSN).
@READDSN 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.

Exceptions
 
Example
The following rule (READDSN_1) specifies an existing file, writes data from the example table to it, closes the file, re-specifies it, and calls another rule.

 
READDSN_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
_ CALL READFILE; | 5
_ CALL @CLOSEDSN; | 6
_ CALL MSGLOG('END OF FILE'); | 7
_ ------------------------------------------------------------------------

 
 
READFILE;
_
_ ------------------------------------------------------------------------
_ ------------------------------------------------------------+-----------
_ UNTIL ENDFILE: | 1
_ RECORD = @READDSN; |
_ CALL MSGLOG(RECORD); |
_ END; |
_ ------------------------------------------------------------------------

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

 
------------------------- INFORMATIONAL MESSAGE LOG -------------------------
COMMAND ===> SCROLL ===> P
DRABEK
ROEDER
HOEGSON
TERAMURA
LEES
MORANG
CROFTON
 SMITH
SOUZA
SAUNDERS
HRODEK
CANNON...

 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved