Copy the object code of a program whose source is deleted.

Hi all,

I have a program, whose source has been deleted.
I was wondering if there is a way of copying this program (which only has object code) from 1 library to another.

Hi Girish,

It is very much possible to copy modules with object only (no source) with the SYSMAIN utility. Please contact your Natural administrator to request this if it is needed to be done.

Also, you may wish to ask your Natural admin if there are any backups of the system files or NATUNLDs laying around that might still have the source code.

If your shop has N2O installed, it may contain the source code as well in its archives. Again, you should discuss this further with your Natural admin.

In many shops SYSMAIN is secured for use only by Natural Administrators. If so, try Object Handler (SYSOBJH).

In many shops, SYSOBJH is also not freely opened up to all.

Definitely, the theme here is speak with your Natural administrator for help in migrating object code without source and/or restoring source from any backups or archives that may exist.

SYSMAIN worked well with programs in normal libraries.
The reason I asked this question was to copy one of the Natural APIs (USR1058N) from SYSEXT library to my library. When i used SYSMAIN, it gave me an error “4890:Invalid owner/co-owner confirmation.(SYSEXT)”.

Is there any other way to use Natural APIs ?

Also i found that we can put SYSEXT as a steplib to our library, the procedure of which i am not aware.

Your help is much appreciated!

Girish,

Below are my points:

  1. The Natural APIs (subprograms) are always cataloged objects hence source code of API USR1058N is not deleted but not made available by SAG (to any customer :?: ). Hence I doubt if it can be retrieved by any means.

  2. When you’re trying to copy the object from SYSEXT to your library, you lack the necessary access.

  3. Ask your Natural admin if the SYSEXT system library is defined in the FNAT system file as a steplib (should be 8)) library for the user library which contains the Natural objects that use this API. If so, no API-specific actions are required when upgrading your Natural version. You then simply access this with CALLNAT ‘API-name’. Keep in mind to have any LDAs, PDAs need.

  4. Sample program (how to use it) USR1058P can be found in SYSEXT library (if you are permitted). Try copying just this program into your library (how :?: , check the last point) and it should work fine (without any necessity of steplib if already defined by your admin).

You can work around with this program (in your library) for any additional requirements.

  1. The procedure of putting SYSEXT as a steplib is briefly expained in point 3. Your Natural admin would be more than happy to do this for you.

  2. If you don’t have right to copy objects from SYSEXT using SYSMAIN/SYSOBJH but can logon to SYSEXT and edit programs (not APIs i.e. subprograms) use below commnads on command line:

    a. LOGON SYSEXT
    b. E USR1058P
    c. LOGON your-library
    d. STOW

This should make a copy (source & cataloged object) of USR1058P in your library with same name.

Hope this helps.

I will contact my Adabas DBA, Thanks all for your help!