Reading DDM in Natural Program

I am looking out for the approach to read DDM directly in my natural program. I want to read DDM to get the field names of each Adabas file in a database. And whenever any field of a File is added/changed, there should not be a need of changes in my program as any changes in the file gets reflected in the DDM and my program will pick up all the field names from DDM directly.

Thanks
Shanky

USR1056N + USR1058N on SYSEXT

1 Like

sorry I didn’t get it

Can you please bit explain!

What Wolfgang is suggesting is that if you need to find out all the current DDMs you can access from a given library are for the purpose of checking for new files and/or new fields defined to a DDM, you can use the interface modules found in SYSEXT library.

USR1056N provides a list of DDMs on the FDIC file or in a library. Running this will give you a base from which you can tell any new DDMs (if you save the last result set) as well as having the input for USR1058N, which reads DDM source into an array. Reading the results of USR1058N, you can compare to the last run or just check for an updated catalogued date before doing the comparison to the last run to see if any fields were added.

HTH

1 Like

Thanks Brian for explaining it further. Seems API USR1058N will be the correct for my requirement as I just want to know all the latest updated field names of any file in current library. Now I have two queries -

  1. As the interface modules are found in SYSEXT library how we can I call/execute them from the Natural programs of my user library?
  2. As “USR1058N” reads a DDM source code into an array how can I know the structure of array for calling and receiving data from the API?

Thanks
Shanky

Either SYSEXT needs to be a STEPLIB or the interface modules need to be in your library.

The structure is equivalent to the LIST command for a DDM, just run USR1058P and see for yourself.

1 Like

Another alternative to making SYSEXT a STEPLIB would be to copy the USR* modules to SYSTEM, but that would make it harder on the person performing upgrades.

1 Like

http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat427mf/utis/sysext.htm#sysext_SYSEXT_using