Copying Natural 8.2.7 objects into PDSes

I’m new to Natural and ADABAS. In the past, workers have had a mechanism to copy Natural objects to PDSes based on type. The objects were unloaded to a work file and a REXX script read the work file and copied the object to the appropriate PDS. I don’t have much more than that to go on. I created a small Natural application. I tried using SYSOBJH to unload the objects and received an error saying the work files were unavailable. I see the work files when I enter the SYSFILE command. Something is not set up correctly. I read the Natural manual and see that the work files definitions. It says “In z/OS under TSO and in batch mode, work files need not be predefined in the JCL. Provided they are defined by subparameter AM=STD, they can be allocated dynamically during the session by a Natural program using the DEFINE WORK FILE statement or the application programming interface USR2021 (in library SYSEXT).”

Does the SYSOBJH code do what the manual says is required? Is there an easier way to get objects into PDSes? The reason why this is necessary is beyond the scope of my questions. Let’s just say I need to do this.

Perhaps there is a good reason out there somewhere to extract a Natural object to a PDS, but I haven’t seen it. (I don’t consider application conversion a good reason.) I have seen it used as a workaround for an application design flaw. SAG must agree with me, because they don’t offer a straightforward function to do this.

You have two options. One is verbose (i.e. painful to use), the other requires coding.

The first option is entirely JCL. Adjust accordingly. Note that the object’s name is specified four times. Only one object can be extracted per job step. Also, data area formatting may not be to your liking.

//CMPRINT   DD SYSOUT=*                                
//CMWKF01   DD DSN=your.pds(your-obj),DISP=SHR    
//CMSYNIN   DD *                                       
LOGON SYSDIC                                           
PUNCH your-obj,WANLIB                                  
LOGON SYSMAIN                                          
DELETE SAVED your-obj IN WANLIB                        

The second option is to code your own utility based on user exit USR1057N. Refer to SYSEXT documentation. You can code for multiple objects to be processed in a single step. I’m not sure that all object types are supported by USR1057N.

Have fun.


Thank you for your quick response. I have a couple of questions. You mention proc NATBT. I don’t have that proc. I’ve seen mention of other PROCs that I don’t have. Where is this documented? On the COPY SAVED statement you mention your-lib. Is this the same as your-pds?

Every Natural shop has a PROC to incorporate and enforce site standards and to hide the complexities of a Natural JCL step. As a Natural rookie, you are not the right person to create one. Ask your mentor or find an existing test job to determine the PROC name and parameter/override lists. I couldn’t find a PROC example in the documentation, just a list of DDNAMEs, which is not much help.

Regarding the control cards:

  • your-obj is the name of the Natural module to be extracted.
  • your-lib is the Natural library in which your-obj is found.
  • your.pds is the PDS file into which your-obj will be written.

To run my sample job:

  • You must have access to the SYSMAIN utility.
  • You must be authorized to execute SYSMAIN’s COPY and DELETE functions.
  • You must have access to SYSDIC to execute the PUNCH function.