I am supporting my co-worker on Natural migration from Unix to Linux, and one of the tasks is to transfer the objects from one site to other. One option would be to use IMPORT function; however, it seems this procedure needs to inform whether the object is in report mode or structured mode. As I have many of them, and they are developed mixing report and structured, I don’t have any option to leave the object as the origin.
So, is there a way to solve it, or do I need to transfer using SYSTRANS or SYSOBJH? Would be great if it is possible to use IMPORT function? Is there any trick to use SYSOBJH handling many libraries or not on Unix? My experience is on MF.
thank you for your information. I have tested using SYSOBJH online and it works. now, as Linux is not my expertise as well, I am trying to do it in batch mode, because I have many libraries to transfer. Using SYSOBJH command, as you are suggesting and I also am trying to do it, it seems that I need to execute the object OBJHCMD before, however, it is a little different than MF on batchmode.
The idea is to create a program that would read a sequencial file where the libraries are included, and then for each library I would build the command to transfer. So, if anyone knows how to create this procedure, I would appreciate it a lot, because I will spend a lot time testing.
I don’t have a Linux script to offer you, but here’s the Windows equivalent.
@echo off
SETLOCAL
SET PATH=%PATH%;C:\Program Files\Software AG\Natural\6.3\Bin
SET NATFILE=ObjH
echo sysobjh >%NATFILE%.inc
echo unload s* lib jcl objtype n >>%NATFILE%.inc
echo unload * lib junk objtype n >>%NATFILE%.inc
echo FIN >>%NATFILE%.inc
@echo on
natural batchmode parm=NATBATCH CMSYNIN=%NATFILE%.inc CMOBJIN=%NATFILE%.inc CMPRINT=%NATFILE%.out CMPRT01=%NATFILE%.txt NATLOG=ALL BMSIM=MF
rem config file: CMWKF01=%natfile%.sag CMWKF04=%natfile%.prt
@echo off
If ERRORLEVEL 1 GOTO :NATERROR
goto :EXIT
:NATERROR
echo Error from Natural Step, check %NATFILE%.OUT for details
pause
:EXIT
del %NATFILE%.inc
rem del %NATFILE%.out
rem del %NATFILE%.txt
ENDLOCAL
exit
You must define Work 1 (unloaded objects) and Work 4 (optional report) in your NatParms via the Natural Configuration Utility.
For this test, I generate the ObjH parameters in-stream using ECHO commands. You’ll provide .INC as a separate file.
Your proposal to read and edit a list of library names seems overly complicated to me. Is the list created manually or computer-generated? Is it very dynamic? Is it very large but not a complete set? Wouldn’t wildcards help? (eg LIB * or LIB rgz*)
if “THE objects” means all of them you should be able to just copy the whole FUSER directory across.
As soon as you move just a subset you’ll have to use SYSOBJH, unless you have NDV servers
set up on both sides which would allow you to just DnD it from Natural Windows / Natural Studio.
Thank you very much for the information and script, I appreciated a lot.
Unfortunately, I cannot copy the entire fuser, because the customer wants to take advantage to the moment to clean up the environment. So, there are some libraries that need to be copied and other not.