Windows script to do rnddbdump to file

 6 Replies
 1 Subscribed to this topic
 17 Subscribed to this forum
Sort:
Author
Messages
tambrosi
Veteran Member
Posts: 55
Veteran Member

    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
    Veteran Member
    Posts: 1498
    Veteran Member
      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
      Veteran Member
      Posts: 55
      Veteran Member

        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
        Veteran Member
        Posts: 1498
        Veteran Member
          What you have there should work.
          I might do it without the @ sign though...

          @echo off
          set GENDIR= etc.
          Greg Moeller
          Veteran Member
          Posts: 1498
          Veteran Member
            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
            Veteran Member
            Posts: 55
            Veteran Member

              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
              Veteran Member
              Posts: 80
              Veteran Member

                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.