When exporting a lot of Report Facility (PRF) Forms and Queries and transferring them to another subsystem, to make it simple, use the
option EXPORT with BOTH=Y, which exports the form and the related query
But if the objects are imported separately PRF forgets the relationship between FORM and QUERY and the query must then be attached manually to the form.
How can the Forms and Queries be imported so as to eliminate this manual process?
The subcommand ATTACH indicates the query that will be attached to the imported forms.
The syntax for the IMPORT procedure command is as follows:
IMPORT object-type object-list dataset-name
The ATTACH subcommand has the following syntax:
(ATTACH=creator.query name);
The default is to not change the query that is assigned to a form.
If you use a wildcard as the object-type, the subcommand is ignored for any queries that are imported.
If the object-type is not FORM, the ATTACH subcommand is invalid and an error message is generated.
The query you specify must exist in Report Facility.
For example:
IMPORT FORM TEST.DEC PRF.EXPORT(OBJECTS) (ATTACH=TEST.NEWQUERY);
If running in Batch, the commands are:
IMPORT QUERY Creator.* 'dataset name' (REPLACE=Y);
IMPORT FORM Creator.* 'dataset name' (ATTACH=SAME);
OR the above 2 commands can be combined in the following way:
IMPORT FORM Creator.* 'dataset name' (ATTACH=SAME REPLACE=Y);