Writing the output from a command directly to a database file

 

You can store the output from many control language (CL) commands in an output physical file by specifying the OUTFILE parameter on the commands. You can then use the output files in programs or utilities (for example, Query) for data analysis.

For example, you can send the output of the Display Program References (DSPPGMREF) command to a physical file, then query that file to determine which programs use a specific file.

The physical files are created for you when you specify the OUTFILE parameter on the commands. Initially, the files are created with private authority; only the owner (the person who ran the command) can use it. However, the owner can authorize other users to these files as you would for any other database file. The system supplies model files that identify the record format for each command that can specify the OUTFILE parameter. If you specify a file name on the OUTFILE parameter for a file that does not already exist, the system creates the file using the same record format as the model file. If you specify a file name for an existing output file, the system checks to see if the record format is the same record format as the model file. If the record formats do not match, the system sends a message to the job and the command does not complete.

You must use your own files for output files, rather than specifying the system-supplied model files on the OUTFILE parameter. See the Control language (CL) topic for a list of commands that allow output files and the names of the model files supplied for those commands.

All system-supplied model files are located in the QSYS library.

You can display the fields contained in the record formats of the system-supplied model files using the Display File Field Descriptions (DSPFFD) command.

 

Parent topic:

Using database attribute and cross-reference information

 

Related concepts


Control language

 

Related reference


Display File Field Description (DSPFFD) command
Display Journal (DSPJRN) command
Display Problems (DSPPRB) command