0

can you please suggest me the manual or example codes on how i can read the content of a file to be displayed in a rexx panel. the number of lines from the file can vary and so cannot use the static manner.

thanks, Samuel Mathews.

Samuel Mathews
  • 171
  • 1
  • 2
  • 17

1 Answers1

3

In ZOS to read the file in rexx use the execio command i.e.

"EXECIO  *  DISKR  myindd  (STEM fileContentsVar."

Reads the file into a stem variable (fileContentsVar.0 holds the number of records and fileContentsVar.1 ... hold the actual data).

You could store the file contents in a ISPF table and display the table using the TBDispl command

The rexx code will be roughly

address ispexec
'tbcreate myfile names(line)'

do i=1 to fileContentsVar.0
   line = fileContentsVar.i
   'tbadd myfile'
end
'tbtop myfile'
'tbdispl mypanel'
'tbend myfile'

For an example of a table-panel definition see http://pic.dhe.ibm.com/infocenter/zos/v1r12/index.jsp?topic=%2Fcom.ibm.zos.r12.f54dg00%2Fispzdg8040.htm

A table-panel would look like:

************************************************************
* )Attr                                                    *
*   @ Type(output) Intens(low) Just(asis)   Caps(off)      *
* )Body                                                    *
* -------------------- ????????????????? ----------------- *
* +Command ==>Cmdfld                    +Scroll ==>_samt+  *   
* +                                                        *    
* This table shows  ...                                    *    
*                                                          *   
* Line                                                     * 
* )Model                                                   *   ---- The model setion holds the
* @line                           +                        *        Table display section
*                                                          *
* )Init                                                    *
*   &samt=page                                             *
* )Proc                                                    *
* )End                                                     *
************************************************************
Bruce Martin
  • 10,358
  • 1
  • 27
  • 38