Examples of Using Direct Commands

This section provides examples for using Object Handler direct commands.

Tip:
For additional examples, you can view the command generated for an Object Handler function. This command is automatically displayed when you use a wizard. In advanced-user mode, you can activate the display of the command by either entering the Object Handler command SET ADVANCEDCMD ON or setting the parameter Display-Cmd-in-Advanced-Mode to Y (Yes) in the Object Handler profile (see also Profile Settings).


Unloading Objects for the Same Platform

This section contains examples of how to unload objects in internal format to a work file in order to load them on the same platform, within either a local mainframe, UNIX, OpenVMS or Windows environment:

  • Unload all Natural programming objects (source objects only) from library ABC:

    UNLOAD * LIB ABC OBJTYPE N SCKIND S
  • Unload all Natural programming objects (cataloged objects only) from library ABC:

    UNLOAD * LIB ABC OBJTYPE N SCKIND C
  • Unload all Natural programming objects (cataloged objects and source objects) from library ABC:

    UNLOAD * LIB ABC OBJTYPE N SCKIND A
  • Unload all Natural programming objects (source objects only) from library ABC to load in library ABCNEW:

    UNLOAD * LIB ABC OBJTYPE N SCKIND S WITH NEWLIBRARY ABCNEW
  • On a mainframe: Unload all DDMs whose names start with EMP and which point to database 88:

    UNLOAD EMP* LIB * OBJTYPE D DDMDBID 88
  • On UNIX, OpenVMS or Windows: Unload all DDMs whose names start with EMP and which point to database 88:

    UNLOAD EMP* LIB * OBJTYPE N NATTYPE V DDMDBID 88
  • On UNIX, OpenVMS or Windows: Unload all DDMs whose names start with EMP from library VLIB to load in library VLIBNEW:

    UNLOAD EMP* LIB VLIB OBJTYPE N NATTYPE V WITH NEWLIBRARY VLIBNEW
  • Unload all user-defined error messages from library ERRLIB to load in library NEWERR:

    UNLOAD * LIB ERRLIB OBJTYPE E SLKIND A WITH NEWLIBRARY NEWERR
  • On Windows: Unload all Natural programming objects (cataloged objects and source objects) from library ABC to a portable work file on a PC:

    UNLOAD * LIB ABC OBJTYPE N WHERE WORKFILE C:\WF1.SAG WORKFILETYPE PORTABLE

    or

    UNLOAD * LIB ABC OBJTYPE N WHERE WORK C:\WF1.SAG WFT P

Unloading Objects for Different Platforms

This section contains command examples of how to unload objects in Transfer format to a work file in order to load them on a different platform such as unloading in a mainframe and loading in a UNIX, an OpenVMS or a Windows environment.

  • Unload all Natural programming objects (source objects only) from library ABC:

    UNLOAD * LIB ABC OBJTYPE N WHERE TRANSFER
  • Unload all Natural programming objects (source objects only) and user-defined error messages from library ABC:

    UNLOAD * LIB ABC WHERE TRANSFER
  • Unload all Natural programming objects (source objects only) from library ABC with fixed record length:

    UNLOAD * LIB ABC OBJTYPE N WHERE TRANSFER FIXEDLENGTH

Loading Objects in Internal Format

This section contains command examples of how to load objects from a work file in internal format.

  • Load all objects to library LIBNEW and replace any that already exist:

    LOADALL WITH NEWL LIBNEW WHERE REPLACE ALL
  • Load all object with target library TGTLIB to the new target library NEWTGT:

    LOAD * LIB TGTLIB WITH NEWLIBRARY NEWTGT
  • Load the user-defined error messages 1000 to 1500 from library ERRLIB only:

    LOAD * LIB ERRLIB OBJTYPE E FMNUM 1000 TONUM 1500

Loading Objects in Transfer Format

This section contains command examples of how to load objects from a work file in Transfer format.

  • Load all objects to library LIBNEW and replace any that already exist:

    LOADALL WITH NEWL LIBNEW WHERE TRANSFER REPLACE ALL
  • Load all object with target library TGTLIB to new target library NEWTGT:

    LOAD * LIB TGTLIB WITH NEWLIBRARY NEWTGT WHERE TRANSFER