Loading to wrong database

I unloaded an object from a database into a PDS member. I try to load that object into a different database but the job always loads to the original database. The original database was DBID=1,FNR=9. The new database is is DBID=10,FNR=9. This is the load job.

//NATBAT   EXEC PGM=NAT827BA                          
//STEPLIB   DD DSN=SYS2.SAG.NAT827.SMALOAD,DISP=SHR   
//          DD DSN=SYS2.SAG.ADABAS.V834.LOAD,DISP=SHR 
//DDCARD    DD *                                      
ADARUN DB=10,DE=3390,SVC=205,MODE=MULTI               
//CMPRINT   DD SYSOUT=*                               
//CMPRT01   DD SYSOUT=*                               
//CMWKF01   DD DSN=myuserid.ISPW.NATALL(GDA01),        
//             DISP=SHR                               
//SYSOUT    DD DUMMY                                  
//CMSYNIN   DD *                                      
LOGON TUTORIAL                                        
SYSOBJH                                               
  LOAD GDA01 LIB TUTORIAL OBJTYPE N                   
FIN                                                   

This is the CMPRINT output.

Status                         Library  Object Name                      Type        S/C  DBID/FNR 
------------------------------ -------- -------------------------------- ----------- --- ----------
Not replaced                   TUTORIAL GDA01                            Global      Src     1/9   
Function completed successfully.                                                                   

What am I missing?

ADARUN DB=10

is an Adabas parameter. It is not seen by Object Handler.

Try

 LOAD GDA01 LIB TUTORIAL DBID 10 FNR 9 OBJTYPE N

I made the suggested changes.

DATA   LOAD GDA01 LIB TUTORIAL DBID 10 FNR 9 OBJTYPE N 

Same result.

Status                         Library  Object Name                      Type        S/C  DBID/FNR
------------------------------ -------- -------------------------------- ----------- --- ---------
Not replaced                   TUTORIAL GDA01                            Global      Src     1/9  

“Not replaced” probably means the object already exists in the destination library and SYSOBJH needs to be told it’s OK to overlay the existing module.

This manual page shows options that can be added to a LOAD command with a WHERE clause. I’m guessing you need to add something like WHERE REPLACE ALL, (or WHERE REPL A ) to the end of your command or on a continuation line.

http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat825mf/utis/sysobjh_option.htm#sysobjh_option

Hope that helps.
George

Sorry, I should have been clear about that. I know about the not replace. That’s not the issue. The database ID and the FNR are not what was specified in the LOAD statement. That’s my issue. How do I get this job to put the object in the database I want.

OK, sorry. Digging into the manual a bit more, it looks like the DBID and FNR specified as Ralph suggested are part of the selection criteria, and may not be needed for your application.

This manual page specifies the “WITH” parameter settings and seems to be where you would specify your target destination,

http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat825mf/utis/sysobjh_parm.htm#sysobjh_parm

parameter-setting

The parameter-setting clause is used to change attributes for the LOAD or UNLOAD command for the objects to be processed and to define target destinations for the LOAD command (for example, FNAT).

The following syntax applies to the parameter-setting clause:
WITH

(parameter-workplan)

parameter-clause

So, it seems you would need to specify

WITH LOADFNATDBID fnat-dbid LOADFNATFNR fnat-fnr
and/or LOADFUSERDBID fuser-dbid LOADFUSERFNR fuser-fnr

to load programs into a different Natural environment.

Hopefully that gets you closer to what you need.

Cheers,
George

George:

The LOADFUSERxxxx did the trick. Many thanks.

Walter