Question prodict/load_df.p

jmac13

Member
Hi All,

I'm using 10.2b, I'm in the process of automating our database upgrade procedure and I’m using prodict/load_df.p to load in some dfs. Is there a way to throw up any errors that I get when loading a df in? e.g. I’ve got a dummy df where I’m creating a field for a table that doesn’t exist the load_df.p tells me the error but outputs it to the screen is there a way to throw this up a level so I can do something else with it rather than it sitting there and waiting for my input or I’m going have to edit the files prodict/load_df.p uses?

Thanks
 

Stefan

Well-Known Member
OpenEdge 11.2.1 has prodict/load_df_silent.p - at least some errors seem to be passed to your own logger as can be seen in prodict/dump/_load_df.p

Code:
  cMsg = "You do not have permission to load table definitions.".
  if valid-object(dictLoader) then
      dictLoader:AddError(cMsg).
  else    
      MESSAGE cMsg.

For 10.2B it would seem you are out of luck. On the other hand, are you getting 'handled errors' or record not on file type error messages?
 

KMoody

Member
You could run prodict/load_df.p (or whatever program calls it to run) in batch mode and pipe the output to a file. That way, the program can run without your input, and you can see the errors in a file.

Is that what you're trying to do?
 

Stefan

Well-Known Member
I think that will work for OP - we use AppServers / WebSpeed agents - a ui client shouldn't be connected to a database in the first place. :)
 

jmac13

Member
I'm not familiar with batch mode is this via appserver cause we don't have one.... what I'm doing is running prodict/load_df.p and loading in a df I know has an error in (trying to add a field to table that doesn't exist). I then get a message saying “error occurred during load. press OK to back out of transaction. please check mis.e for load errors and/or warnings. Which is what a expect but now it’s sat there waiting for me to press space. When what I want is to take that output and say there’s been an error loading a df stop the auto upgrade and send a message to say this site has had an issue loading the df. (of course this should be picked up during my testing when applying the df’s to sites test data but I’d like a something to able to pick this up if possible)

 

jmac13

Member
yeah I'm just looking at that now...to see if that will do what I want it to do.. Might have to ask some more questions
 

jmac13

Member
Can't get it to work.. I'm running the following command

Code:
  os-command silent value("call C:\Progress\OpenEdge\bin\prowin32.exe -ini ..\upgrade\DbUpgrade\CdmDbUpgrade.ini -pf ..\upgrade\Dbupgrade\upgrade.pf -p ..\system-files\DbUpgradeLogs\loaddf.p > c:\temp-tables\testLog.txt -b -inp 8192 -Wa -wpp").[/FONT]
[FONT=Georgia]

but it doesn't put the error to the file c:\temp-tables\test.text.

now if i do the following:

Code:
[/FONT]
[FONT=Georgia]                  DEFINE VARIABLE Chrfilename AS CHARACTER NO-UNDO.[/FONT]
[FONT=Georgia] [/FONT]
[FONT=Georgia]                    DEFINE STREAM ostream.[/FONT]
[FONT=Georgia]                   [/FONT]
[FONT=Georgia]                    ASSIGN Chrfilename =  "c:\temp-tables\OtherLog.Txt".[/FONT]
[FONT=Georgia]                   [/FONT]
[FONT=Georgia]                    OUTPUT STREAM ostream TO VALUE(Chrfilename) KEEP-MESSAGES.[/FONT]
[FONT=Georgia]         [/FONT]
[FONT=Georgia]                    CREATE alias DICTDB for database value("mis").[/FONT]
[FONT=Georgia]                    run prodict/load_df.p ("C:\cdmsdep\upgrade\dbupgrade\df\misDeltaV69.df").[/FONT]
[FONT=Georgia]                    delete alias DICTDB. /* Optional */[/FONT]
[FONT=Georgia] [/FONT]
[FONT=Georgia]                    OUTPUT STREAM ostream CLOSE.   [/FONT]
[FONT=Georgia]

then it puts the error in otherLog.txt but still comes up with "press space to continue"

any ideas?


Thanks in Advance
 

Stefan

Well-Known Member
There is no -b on your startup command line.

At least not where it matters. You have it as part of the output redirection, so it is not something being passed to the AVM.

add it as first parameter after the .exe.

There is generally also no point in starting a prowin32 in batch-mode, _progres.exe will generally do.
 

jmac13

Member
Thanks Stefan.. I gave that a go but I couldn't get it to put anything out to a file... so I just used the -b to suppress the message and then and went and found the .e that the program creates and used that as a indicator that something has gone wrong.


Also I couldn't get _progres.exe to work it kept saying that the DLC path needs to be correct.. I’m guessing that’s something to do with some setting in my .ini for the winchar section but I couldn’t see it even when I’ve got an environment variable setup with %DLC% as c:\progress\openedge\bin.
 

TomBascom

Curmudgeon
Why would you want to load a .df with known errors in it?

set DLC=c:\progress\openedge

Not c:\progress\openedge\bin

DLC is progress install directory. Things like progress.cfg (your installed licenses) startup.pf, and promsgs are found there. The bin directory needs to be in the PATH -- that is where the executables are.

If you run _progres from a "proenv" window or icon everything should be correctly set.
 

Stefan

Well-Known Member
_progres.exe looks at the [winchar startup] section - you only need a correct DLC and PROPATH in there (both are commented out by default). As always, be sure you are pointing at the ini you think you are pointing at.
 

jmac13

Member
I'll give it another go with _progres.exe today see if I can get it working. Tom I'm not loading in the errors I just don't want it sitting there with an error I want it to stop my script and send out an email saying an error happend
 

TomBascom

Curmudgeon
Try this:

Code:
/* loaddf.p
 *
 * _progres -b -db dbName -p loaddf.p -param dbName.df > dbName.err
 *
 */

run prodict/load_df ( input session:parameter ) no-error.
 
if error-status:num-messages > 0 then
  do:
    message "loaddf.p error!".
  end.
 
return.
 

jmac13

Member
Right I tired that tom and still nothing gets put in the file... couldn't get it to work with _progres either it came up with an error (when I took off the -b). it said program prodict/dump/_loadvdf.p was compiled under another incompatible display environment cannot run without recompile. which I'm guessing is the character environment. we only ever use _progres for our RF system never anything else.... I also tired with a prowin32 but same again no errors put to a log
 

TomBascom

Curmudgeon
That's kind of backwards. You should use _progres for everything except Windows GUI programs. The only time anyone should ever use prowin32 is when they absolutely must depend upon some aspect of the Windows GUI environment.

It sounds to me like your environment is pretty confused. Probably from of all that editing of INI files and PATH variables.
 

jmac13

Member
well our default for the winchar start up is:

which uses a environment variable..but these doesn't seem to work..(this isn't something I've set up). If I change it to have c:\progress\openedge in it works and doesn't complain about the valid dlc path. but i cant get the load df thing to work

Code:
[WinChar Startup]
DLC=%DLC%
PROBUILD=%DLC%\PROBUILD
PROPATH=.,%DLC%\PROBUILD\EUCAPP\EUC.PL,%DLC%\PROBUILD\EUCAPP
 

TomBascom

Curmudgeon
I think you're all bound up in a sea of changes. Some of which are not working.

I have no idea which ones are messing you up but it is fairly obvious that your environment is messed up.

If you were to freshly install Progress on a new machine that does not have any Progress environment variables set and if you were to stay out of the INI files and just use plain old "proenv" the code provided will work just fine.
 

jmac13

Member
Hi Tom,

It turns out it was the use of the .ini.. but still doesn't output the error..I'll stick with what I've got for now.. Thanks for the help
 

TomBascom

Curmudgeon
I'm not sure what you're expecting in terms of outputting an error when you're in batch mode. DF load errors *always* go to the .e file. But my ERROR-STATUS handler doesn't work as intended for the .err file. Try this instead:

Code:
/* loaddf.p
 *
 * _progres -b -db dbName -p loaddf.p -param dbName.df > dbName.err
 *
 */

run prodict/load_df ( input session:parameter ).

file-info:file-name = ldbname(1) + ".e".
if file-info:full-pathname <> ? then
  do:
    message "errors are in" file-info:full-pathname.
  end.

return.
 
Top