IF <expr>
<statements to execute if true>
ELSE
<statements to execute if false>
ENDIF
IF allows for the flow of control within a CMD or DO file based on various conditions that can be tested. Refer to CMD and DO Files for more information.
Example
Here is a simple example of a DO file that takes a filename argument. If the file (with a BAS extension) does not exist, it is created by making a copy of a file called APPLIB:STDHDR.TXT. Then, in either case, the file is VUE’d.
IF LOOKUP("$0.BAS") = 0
COPY $0.BAS=APPLIB:STDHDR.TXT
ENDIF
VUE $0.BAS