PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 01/19/2016 4:36 PM by  pbelsky
Windows script to do rnddbdump to file
 6 Replies
Sort:
You are not authorized to post a reply.
Author Messages
tambrosi
Enterprise System Analysis
Private
Veteran Member
(103 points)
Veteran Member
Posts:49


Send Message:

--
11/17/2015 9:49 AM

    Hi all,  I am looking for some help on scripting in Lawson,  I am new to the software, looking to run a script to dump a table to csv file. I can run the  rngdbdump –c gen queuedjob >  jqstat.csv   from the server and it will run clean and dump the data to the csv file. 

    When I apply the same code in a script, nothing gets dumped to the csv file,  the file is created but no records in the file. 

    I also tried the jqstatus same issue.    

    wscript.echo "VBS Script running parameters " 

    Dim objShell
    Set objShell = WScript.CreateObject( "WScript.Shell" )
    objShell.Run("cmd /K CD D:\Lsftest\Gen\bin\rngdbdump –c gen queuedjob > D:\GBPScripts\jqstat.csv")
    Set objShell = Nothing

     

    Any help would sure be appreciated.

    Thanks

    Terry

    Greg Moeller
    Private
    Private
    Veteran Member
    (3915 points)
    Veteran Member
    Posts:1391


    Send Message:

    --
    11/17/2015 10:04 AM
    There are a bunch of environment variables set on the server that I bet your script doesn't set.
    %GENDIR%, would be one that would need to be set for this to work.
    Compare what you have listed in the command 'set' on the server vs where you are running the script from.
    tambrosi
    Enterprise System Analysis
    Private
    Veteran Member
    (103 points)
    Veteran Member
    Posts:49


    Send Message:

    --
    11/17/2015 10:32 AM

    Hi Greg,  thanks for the info---

    not being a script writer,  can you let me know how to set a variable in a script,   

    @set GENDIR=D:\lsftest\gen
    @set LAWDIR=D:\lsftest\law
    @set LADBDIR=D:\lsftest\db

    Thanks

    Terry

    Greg Moeller
    Private
    Private
    Veteran Member
    (3915 points)
    Veteran Member
    Posts:1391


    Send Message:

    --
    11/17/2015 10:52 AM
    What you have there should work.
    I might do it without the @ sign though...

    @echo off
    set GENDIR= etc.
    Greg Moeller
    Private
    Private
    Veteran Member
    (3915 points)
    Veteran Member
    Posts:1391


    Send Message:

    --
    11/17/2015 11:38 AM
    If you just want to call the Lawson provided 'enter.cmd' this would set everything you have to set....
    So, at the beginning of your script(s)
    CALL d:\infor\prod\enter.cmd
    rngdbdump -whatever other commands you want-
    tambrosi
    Enterprise System Analysis
    Private
    Veteran Member
    (103 points)
    Veteran Member
    Posts:49


    Send Message:

    --
    11/18/2015 8:11 AM

    Greg,   Thanks for the info,   I got pulled off onto something else for now----will get back to this later this week.  

    This is a vbs script so I am not sure if I can do a call,  will investigate.   

    Thanks

    Terry

    pbelsky
    Sr Analyst Project Manager
    Weyerhaeuser
    Veteran Member
    (215 points)
    Veteran Member
    Posts:75


    Send Message:

    --
    01/19/2016 4:36 PM

    If you are on Windows, have you considered using OSQL or BCP. You can create a BCP or OSQL command that dumps the file into a csv and put the command in a batch file. You can execute the file as a job on the server or I believe also through tokendef in LID if you want to keep everything in Lawson.

    You are not authorized to post a reply.