Skip to content

Export all Source Members for a Promotion Level to the IFS

If some of your IBM i source code is currently stored as members within source files, MDOpen provides the option to export those members into IFS folder structures and files.

Export Source Members to IFS

In MDOpen: Settings → Environment Settings → Levels

Position to the Level containing the source members you wish to export and select option Export Source Members to IFS.

This option is recommended when converting all source members for an application to the IFS in order to then export the IFS structure to a Git Repository.

If you are looking to only export certain types of members to the IFS to keep the source in the IFS, it is recommended to use the MDSRC2IFS command instead.

The option will only appear if you have MDSEC authority to manage Promotion Levels (code md/4).

If you have multiple levels for an application, the following process is recommended to prepare for exporting to Git:

  1. Perform the Export for the Level containing all of the production-level source for the application.
  2. If you want to include lower-level versions of the source, then reuse the Export option for the next lower level, with the options Update Existing Fies, Remove Deleted Members and Remove Duplicates set to true.
  3. Repeat for each next lower level until having processed the bottom of the chain.
  4. If you manage multiple versions of your application using the Based-On level concept, then reuse the Export option for the next version level with the options Update Existing Fies, Remove Deleted Members and Remove Duplicates set to true.
  5. Repeat for each next version level until having processed the newest version.

The Structure of the IFS directories

The source members will be exported to a structure that fully follows the MD standards MD Recommended Git Repository Structure.

This means the following default path:

IFS-Parent-Path>/<Library-Name>/<Source-File-Name>/<Member-Name.Member-Type>

<Library-Name> is the name of each Source Library defined by one or more MDCMS Attributes for the selected Application/Level. A folder named after the library will be created within the IFS parent folder if at least 1 source member exists in a defined Source File for the library.

<Source-File-Name> is the name of each Source File defined by one or more MDCMS Attributes for the selected Application/Level. A folder named after the source file will be created within the library folder if at least 1 source member exists in that Source File.

Additional Subfolders within <Source-File-Name> for the following conditions:

  1. If the source type for a member isn't defined in the attributes for a level, the member will be placed in a to-do folder.
  2. If attributes of type *PGM and *MODULE point at the same source file, a subfolder named modules and a subfolder named programs will be created and members will be placed in one or the other depending on MDXREF information.
  3. Since source for SQL entities typically have the same SQL file extension, subfolders are created per type of SQL entity as follows:

| | | | | :--- | :--- | | Folder Name | Attribute Type | | aliases | *SQLALS | | constraints | *SQLCST | | functions | *SQLFUN | | indexes | *SQLIDX | | materialized-query-tables | *SQLMQT | | procedures | *SQLPRC | | scripts | *SQLSCR | | sequences | *SQLSEQ | | tables | *SQLTAB | | triggers | *SQLTRG | | user-defined-types | *SQLUDT | | variables | *SQLVAR | | views | *SQLVW |

Before you Begin

  • It is highly recommended to verify that the Dft Source Type value for each attribute in the application matches the intended file extension value to be used in Git.
  • For SQL source (for tables, indexes, scripts, etc.), it is recommended to set the Dft Source Type to SQL, as this is the file extension that is automatically understood by editors and AI agents.
  • Review the members in the source files to ensure that the correct source type is applied to those members.

The Export Dialog

The option will open a dialog with the following parameters:

Level for Library Naming

The source will be exported from the selected level. However, the name of the library folders can be based on a different level. For example, you may be exporting from the development level 100, but want the library names in the structure to match the names in production level 500. Use content-assist to select from a list.

IFS Path

The path within the IFS that the member structure should be exported to. A path within /MDCMS is not allowed.

Object Authority Template

Specifies the MDCMS Object Authority template of type *IFS that contains the authority definitions to apply to each generated IFS file and each created folder.

Upper-Case Library Name

  • True — The generated folder for the Library will be in UPPER CASE.
  • False - The generated folder for the Library will be in lower case.

Upper-Case Source File Name

  • True — The generated folder for the Source File will be in UPPER CASE.
  • False - The generated folder for the Source File will be in lower case.

Upper-Case Subfolder Name

  • True — The generated folder for the special subfolders (like programs, tables, to-do, etc.) will be in UPPER CASE.
  • False - The generated folder for the special subfolders will be in lower case.

Upper-Case File Name

  • True — The name of the file for a member will be in UPPER CASE.
  • False - The name of the file for a member will be in lower case.

Upper-Case File Type

  • True — The file extension of the file for a member will be in UPPER CASE.
  • False - The file extension of the file for a member will be in lower case.

Add New Files

  • True — If the IFS file doesn't exist, add it.
  • False - If the IFS file doesn't exist, skip the export of the member.

Update Existing Files

  • True — If the IFS file exists, overwrite it with the content of the member.
  • False - If the IFS file exists, skip the export of the member.

Remove Deleted Members

  • True — MDCMS will check the installation history for the selected Promotion Level and if the most recent activity for the member was to delete it, then the corresponding IFS file will be deleted from the IFS.
  • False - The deletion check will not be performed.

Remove Duplicates

  • True — For program or module source where the same file name exists in the same IFS folder, but with multiple file extensions, MDCMS will check the installation history for the selected Promotion Level and retain the entry matching the most recent activity and delete the other entry.
  • False - The deletion check will not be performed.

The Export Process

When you click the Submit button to start the export, a job named MDOPRC(MD instance) will be submitted to batch to perform the export. A log showing the progress of the export appears in MDOpen and is then written to a Report Output file, once complete.