Considerations for opening inline data files

You need to consider these elements when you open inline date files.

  • The record length specifies the length of the input records. (The record length is optional.) When the record length exceeds the length of the data, a message is sent to your program. The data is padded with blanks. When the record length is less than the data length, the records are truncated.
  • When a file is specified in a program, the system searches for the file as a named inline data file before it searches for the file in a library. Therefore, if a named inline data file has the same name as a file that is not an inline data file, the inline data file is always used, even if the file name is qualified by a library name.
  • Named inline data files can be shared between programs in the same job by specifying SHARE(*YES) on a create file or override file command. For example, if an override file command specifying a file named INPUT and SHARE(*YES) is in a batch job with an inline data file named INPUT, any programs running in the job that specify the file name INPUT shares the same named inline data file. Unnamed inline data files cannot be shared between programs in the same job.
  • When you use inline data files, make sure the correct file type is specified on the //DATA command. For example, if the file is to be used as a source file, the file type on the //DATA command must be source.
  • Inline data files must be opened for input only.