Question Incremental .df Using Dump_inc.p

BigSlick

Member
OE 10.2BSP05 Windows 7 64bit

Hi All,

I'm looking at creating an incremental .df file programatically. I Started to use a .bat file, but my knowledge isnt great but the benefit is that you can use dump_inc.p easily; which i have done.

But for better understanding and manageability i've re-wrote the script in OE. One issue I have encountered is the call to dump_inc.p

Mine it currently:

Code:
IF ipiDBStat = 1 
THEN DO:
    SET DUMP_INC_DFFILE=cFileLoc + "incremental_" + cSrcDBName + "_to_" + cTgtDBName + "_" + cRelSfx + ".df".       
END.
ELSE IF ipiDBStat = 2
THEN DO:
    SET DUMP_INC_DFFILE=cFileLoc + "incremental_" + cSrcDBName + "_to_" + cTgtDBName + "_" + cRelSfx + "_2.df".
END.
   
SET DUMP_INC_CODEPAGE="1252". 
SET DUMP_INC_INDEXMODE="active". 
SET DUMP_INC_RENAMEFILE= cFileLoc + "renamefile.rf". 
SET DUMP_INC_DEBUG="0".

OS-COMMAND SILENT VALUE(cDLC + "/bin/_progres -b -db " + cSrcDB + " -ld 1 -db " + cTgtDB + " -ld 2 -p prodict/dump_inc.p  > " + cTempLog).

My original bat was:

Code:
if %~1 == 1 (set DUMP_INC_DFFILE=%FILE_LOC%incremental_%DB1_NAME%_to_%DB2_NAME%_%REL_SFX%.df)
if %~1 == 2 (set DUMP_INC_DFFILE=%FILE_LOC%incremental_%DB1_NAME%_to_%DB2_NAME%_%REL_SFX%_2.df)
set DUMP_INC_CODEPAGE=1252 
set DUMP_INC_INDEXMODE=active 
set DUMP_INC_RENAMEFILE=%FILE_LOC%renamefile.rf 
set DUMP_INC_DEBUG=0
%DLC_VAL%/bin/_progres -b %DB1% -ld 1 %DB2% -ld 2 -p prodict/dump_inc.p > %FILE_LOC%dump_bat_inc.log.

Now the output .df file is not being created through OE. It's as if the variables aren't being passed.

In batch files, it does this magically but i assume with OE i need to do something special. I'm (as always) missing the something special.:(

Any clues would be appreciated.

Thanks
 

RealHeavyDude

Well-Known Member
For one I think you miss the following in your bat ( mine is a Unix example )
Code:
DUMP_INC_DFFILE="${delta_df}" ; export DUMP_INC_DFFILE


Heavy Regards, RealHeavyDude.
 

RealHeavyDude

Well-Known Member
The ABL ( or OE as you call it ) is not a script language that runs on the OS level - it gets compiled to plattform independent byte code that gets executed on a virtual machine ( the AVM ). What you define in the ABL procedure are local variables that are only known by the procedure you define them in. They are not "magically" passed to another procedure. The dump_inc.p expects them to be OS environment variables which need to be define outside of the AVM.

Heavy Regards, RealHeavyDude.
 

RealHeavyDude

Well-Known Member
Please see my previous post. You are mixing and matching different things - namely a procedure that gets executed on a virtual machine ( your ABL procedure ) and commands that get executed in the operating system.

Heavy Regards, RealHeavyDude.
 

RealHeavyDude

Well-Known Member
Usually, when I shell out to execute an operating system command that needs to rely on OS environment variables that are derived from values that I only know within the AVM session:
  1. I generate the operating system script on the fly within the AVM session ( which also contains code to write the exit code into a file since OS exit codes are not returned to the AVM ).
  2. Execute the operating system script.
  3. Parse the file holding the exit code of the OS command.
Another alternative would be to supply the values as parameters to your shell script. But that would need some code in the shell script ( bats and the like are somewhat limited compared to shell scripts on *nix ... ) that sets them as OS environment variables from the parameters.

Heavy Regards, RealHeavyDude.
 
Top