rngdbdump question

 10 Replies
 0 Subscribed to this topic
 27 Subscribed to this forum
Sort:
Author
Messages
thanef
Veteran Member Send Private Message
Posts: 47
Veteran Member

Does anyone know how to use a variable in the rngdbdump command?

Example below:

CURRENTDATE=`date '+%Y%m%d'`

rngdbdump -n GEN queuedjob -f jobname username jobqueue -v stopdate=$CURRENTDATE

 

It works if i type in YYYYMMDD manually.

Thanks

Greg Moeller
Veteran Member Send Private Message
Posts: 1498
Veteran Member
What you are using, works just fine on our system here. One thing you may want to do is make sure that your lawson environment variables (GENDIR for sure) get set correctly if you are using a script.

You can do so at the start of any of your scripts with the following:
eval `/usr/bin/cvx -b prod`

Where prod is replaced with whatever your environment name happens to be.

-Greg
John Henley
Send Private Message
Posts: 3351
thanef, UNIX or Windows?
Thanks for using the LawsonGuru.com forums!
John
thanef
Veteran Member Send Private Message
Posts: 47
Veteran Member
UNIX
thanef
Veteran Member Send Private Message
Posts: 47
Veteran Member
I did a . cv prod at the top of the script and it's not executing still.
Greg, were you able to perform the rngdbdump with a variable inside it?
Greg Moeller
Veteran Member Send Private Message
Posts: 1498
Veteran Member
thanef - we have found that doing a . cv prod is at best tentative within scripts.
Use the eval command that I gave you previously instead or specifically set GENDIR, LAWDIR, etc.
Yes, we do rngdbdump commands with variables ALL the time!!
Ben Coonfield
Veteran Member Send Private Message
Posts: 146
Veteran Member
The only problem I have encountered using a command like . cv prod in a script is that if you are passing parameters to the script and referencing them using variables like $1, $2 or $*, the . cv command (or any "dot" command) will wipe out the parameters. So if I want to do this I need to save the parameters first with something like

P1=$1
P2=$2
. cv prod
etc.
thanef
Veteran Member Send Private Message
Posts: 47
Veteran Member
Thanks Greg, Ben. I'll post what ends up working for me soon.
Chesca
Veteran Member Send Private Message
Posts: 490
Veteran Member
Hello all, I am writing custom code in a routine that's called from LP140. This program has a date that I would like to use but I am getting the following error even though the field is defined and used by LP140.

Error - PRM-PROCESS-THRU-DATE Not Defined In Specified WS

Error - RdLibInt Failed For LPCUSTOMPD

        Fix The Errors In LPCUSTOMPD And Try Again

bismark -PLPELIGPD upgradepl

Our Lawson consultant suggested the following but since I am a newbie to Lawson, I had no idea what he meant. Could you please let me know if I could use an script like the one mentioned here?
The tough part is that it is difficult to cross a productline to see GEN. The only way I have seen others do it before is to use the ability to call command line, and rngdbdmp the DB LP140 params, and get it from there.

John Henley
Send Private Message
Posts: 3351
https://www.lawsonguru.co...ands-from-COBOL.aspx
Thanks for using the LawsonGuru.com forums!
John
Chesca
Veteran Member Send Private Message
Posts: 490
Veteran Member
Perfect! I will add the code to PD and WS and then I would have to find out what the input file or db would be the get the PRM date from LP140 parameters, correct? Your help is greatly apreciated!