The basic APAB/4 statement for outputting data on the screen is WRITE.
Syntax:
WRITE
. This statement outputs the field to the current list in its standard output format. By default, the list is displayed on the screen. The field can be any variable or table field or just literal. PROGRAM ZDEMO WRITE: /‘HELLO’. When you start this program, the system leaves the current screen i.e., your editor screen and branches to the output screen, which is also called as list screen: The list screen has the same name as the title of the program specified in the program attributes. First line on the screen contains the list header. By default, the list header is the same as the title of the program. The current page number (1) appears on the right. The list header is followed by one line and then the output is displayed. Write : ‘HELLO’. Write : ‘WORK HARD’ On the screen, the output is normally left justified. But in above case, because we have used two WRITE statements, the output fields are displayed one after the other, each separated by one column (i.e., one blank). If there is not enough space for an output field on the current line, a new line is started. Almost all system-defined fields are right justified except FLOAT, INTEGER, and PACKED i.e., number field. The numeric data types F, P, and I are right justified and padded with blanks on the left. If there is sufficient space, thousands of separators are also output. If a type P field contains decimal places, the default output length is increased by one. With the data type D, the internal format of a date differs from its output format. When you use the WRITE statement for outputting data, the system automatically outputs dates of type D in the format specified in the user’s master record (e.g. DD/MM/YYYY or MM/DD/YYYY).
No comments:
Post a Comment