Note: Built-In Function Rules Usage Options
Sets a file's database attributes.
An edit session must be commenced by using the START_FILE_EDIT Built-In Function prior to using this Built-In Function.
This is a Specialized Built-In Function for use in a Development Environment only.
Arguments
|
Return Values
|
Note: Currently this Built-In Function can only be used to determine whether or not a file will have an I/O module.
Example
A LANSA function to emulate the 'File definition Menu' has been written. When a certain option is taken the user can decide to set a file attribute. IE Do you want an I/O module (Yes/No) ?
********** Define arguments and lists
DEFINE FIELD(#FILNAM) TYPE(*CHAR) LENGTH(10)
DEFINE FIELD(#LIBNAM) TYPE(*CHAR) LENGTH(10)
DEFINE FIELD(#YESNO) TYPE(*CHAR) LENGTH(32) LABEL('I/O Module')
DEFINE FIELD(#RETCOD) TYPE(*CHAR) LENGTH(2)
BEGIN_LOOP
********** Request File and library name and I/O module attribute
REQUEST FIELDS(#FILNAM #LIBNAM #YESNO)
**********
USE BUILTIN(START_FILE_EDIT) WITH_ARGS(#FILNAM #LIBNAM 'DEM') TO_GET(#RETCODE)
IF COND('#YESNO *EQ YES')
USE BUILTIN(SET_FILE_ATTRIBUTE) WITH_ARGS('''IOMODULE=YES''') TO_GET(#RETCOD)
ELSE
USE BUILTIN(SET_FILE_ATTRIBUTE) WITH_ARGS('''IOMODULE=NO ''') TO_GET(#RETCOD)
ENDIF
USE BUILTIN(END_FILE_EDIT) WITH_ARGS('Y') TO_GET(#RETCOD)
********** Submit job to make file operational
USE BUILTIN(MAKE_FILE_OPERATIONL) WITH_ARGS(#FILNAM #LIBNAM)
TO_GET(#RETCOD)
**********
END_LOOP