Jesper’s ToolBox for IBM i – Export Source to Folder

Export Source to Folder - ExpSrcFlrExport Source to Folder is a command that exports all source members from a library to a folder. Then the files can be copied by the usage of Windows Explorer, or FTP, in order to re-create the exported source files on a target system.

When two systems use compatible versions of OS/400, you can save a library on one system and then restore the library on the other system. However, if the two system does not use compatible OS/400 versions, the save/restore is not possible, and this is where this tool comes in handy.

Exports all source members to a folder.
Exports also a CL program that will be used to re-create library, sourcefile and members on the target system.

Documentation

Starting Export Source to Folder.

Type:

JWTOOLS/EXPSRCFLR

on the command prompt and press [F4]. The command screen is shown. Enter the name of the library to export and enter the name of the folder to export to.

The library must exist, and the target folder must not exist. Both conditions are checked by the command.

A folder in the QDLS file system is created with the name that you entered. You can copy the files.

When installing the files on another iSeries, you must create a folder on that system in the QDLS file system and copy all the files into that folder. Please note, that the folder must be a top level folder!

One of the files is called IMPSRC.TXT. This is actually the source of a CL program that will do the import of the files into source files.

To copy this file to a program source, issue the command as follows:

CPYFRMPCD FROMFLR(folder name) TOFILE(mytools/QCLSRC) FROMDOC(IMPSRC.TXT) TOMBR(IMPSRC)

Next review the source of IMPSRC. Note, that the program will create a library named as the original library, if it does not exist. Needed source files will be created if they to not exist. Library and files created by IMPSRC will have the text ‘Created by Export Source to Folder’.

When IMPSRC is compiled, it must be called with one parameter, the name of the folder containing the copied files.

When done, check that everything is as expected. The folder and files in it, are not deleted as a part of the process.