April  27,  1981  CMS   MACROS   FOR   TERMINAL  COMMUNICATIONS   There  are  four  CMS   macros  you  can  use  to  write  interactive,  
terminal-oriented programs. They are RDTERM,WRTERM,   LINEDIT,  and  PAITT.   RDTERM  and  WRTERM   only  require  a  read/write  buffer  for  sending  and  rece1v1ng   lines  from  the  terminal.  The  third,  LINEDIT,  has  a  
substitution and translation capability.When   you  use  the  WRTERM   macro  to  write  a  line  to  your  terminal  you  
canspecify   the  actual  text  line  in  the  macro  instruction,  for  example:  DISPLAY   WRTERM   'GOOD   MORNING'   You   can  al30   specify  the  message   text  by  referri.ng  to  a  buffer  that  
contains the message.
TheRDTERM   macro  accepts  a  line  from  the  terminal  and  reads  it   into  a  
buffer you specify.You   could  use  the  RDTERM  and  WRTERM   macros  together,  
as follows:WRITE   READ  REWRITE   BUFFER   WRTERM   'ENTER  LINE'  
RDTERMBUFFER   LR  3,0   WRTERM   BUFFER,   (3)  
DSCL130   In  this  example,  the  WRTERM   macro  results  in  a  prompting  message.  Then  
the RDTERM macro accepts a line from the terminal and places it in the
bufferBUFFER.   The  length  of  the  line  read,  contained  in   register  0   on  
return from the RDTERM macro, is saved in register 3.When   you  specify  
a buffer address on theWRTERM   macro  instruction,  you  must  specify  the  
length of the line to be written. Here, register notation is used to
indicate that the length is contained in register 3.
The LINEDIT macro converts decimal and hexadecimal data intoEBCDIC,   and  places  the  converted  value  into  a  specified  field  in  an  output  line.  
There are list and execute forms of the macro instruction, which you can
use in writing reentrant code. Another optionallows   you  to  write  lines  
to the offline printer. The LINEDIT macrois   described,  with  examples,  
inCMS   AnS   Macro  Reference.  Figure  21  shows  how  you  
miqht use the LINEDIT macro to convert and displayCMS   return  codes.  
TheWAITT   (wait  terminal)  macro  instruction  can  help  you  to  
synchronize input and output to the terminal. If you are executing a
program that reads and writes tothe·terminal   frequently,  you  may  want  
to issue aWAITT   macro  instruction  to  halt  execution  of  the  program  
until all terminalI/O   has  completed.  CMS   MACROS   FOR   UNIT   RECORD   AND  TAPE   I/O   CMS   provides  macros  to  simplify  reading  and  punching  cards  (RDCARD   and  PUNCHC),   and  creating  printer  files  (PRINTL).  When   you  use  either  the  PUNCHC   or  PRINTL   macros  to  write  or  punch  output  files  while  a  program  
is executing,you   should  remember  to  issue  a  CLOSE   command  for  your  
virtual printer or punch when you are finished.You   can  do  this  either  
after your proqram returns control toCMS,   by  entering:  250   IBM   VM/370   CMS   User's   Guide  
terminal-oriented programs. They are RDTERM,
substitution and translation capability.
can
contains the message.
The
buffer you specify.
as follows:
RDTERM
DS
the RDTERM macro accepts a line from the terminal and places it in the
buffer
return from the RDTERM macro, is saved in register 3.
a buffer address on the
length of the line to be written. Here, register notation is used to
indicate that the length is contained in register 3.
The LINEDIT macro converts decimal and hexadecimal data into
There are list and execute forms of the macro instruction, which you can
use in writing reentrant code. Another option
to the offline printer. The LINEDIT macro
in
miqht use the LINEDIT macro to convert and display
The
synchronize input and output to the terminal. If you are executing a
program that reads and writes to
to issue a
until all terminal
is executing,
virtual printer or punch when you are finished.
after your proqram returns control to
 
             
            











































































































































































































































































































































































































































































































