how to call UNIX script from tokendef

 5 Replies
 0 Subscribed to this topic
 17 Subscribed to this forum
Sort:
Author
Messages
Lilyb
New Member
Posts: 3
New Member

    We're migrating from UNIX platform to Windows, and have tons of UNIX scripts.  I can run the shell scripts from LID prompt just like on UNIX after running initluu.  However, when I define the script in tokendef, it will not run.  Does anyone know how to make UNIX script to run with tokendef?

     

    Thanks.

    Greg Moeller
    Veteran Member
    Posts: 1498
    Veteran Member
      Well, we also migrated from Unix to Windows.... although the process has not been without it's challenges, I can tell you what I've found so far.
      It's probably far easier and less time consuming to just create a custom program that calls your Unix script... 1 program to 1 script relation is how we have it set up here. You really only need a couple pieces of information to do this:
      1) In your WS file:
      000100******************************************************************
      000200* GH190WS *
      000300******************************************************************
      01 GH075WS.
      02 WS-CONVERT-SCRIPT PIC X(50).
      In your PD file:
      000100******************************************************************
      000200 050-EDIT-PARAMETERS SECTION 10.
      000300******************************************************************
      000400 050-START.
      000500
      000600 050-END.
      000700
      000800******************************************************************
      000900 100-PROGRAM-CONTROL SECTION 10.
      001000******************************************************************
      001100 100-START.
      001200
      001910 MOVE "D:\LSFPROD\LAW\PROD\SCRIPT\APCHECK.BAT" TO
      001920 WS-CONVERT-SCRIPT.
      001930 CALL "SYSTEM" USING WS-CONVERT-SCRIPT.
      002000
      002100 100-END.
      002200
      002300******************************************************************
      002400 1000-SEL-REPORT SECTION 50.
      002500******************************************************************
      002600 1000-START.
      005600
      012500******************************************************************
      012600 1000-END.
      012700******************************************************************

      Replace the MOVE statement with the path and name of your script.
      Add security to LS
      Compile and you should be set... then the users can just call those as they do normal programs.

      There is a way to get scripts working from tokendef too... but I had to spend way too much time figuring it out to explain it all in a message.
      Jeff Shumate
      Advanced Member
      Posts: 31
      Advanced Member
        Include "cmd" at the beginning of the token string
        Stuart Perkins
        Basic Member
        Posts: 18
        Basic Member
          I have two clients with this issue.  One has written a custom program to execute "ksh prm-scriptname" and it does the command call with their script directory in place. 

          For the other client who was already on Windows, I wrote one with four 78 character input lines and allow the Lawson administrator/system maintenance person access to that program only.  It can basically do anything you would from a LID command prompt.  This lets you define a multi-step job which is essentially a program itself.  It is used heavily to create extract files for interfaces using a small collection of batch files in the Lawson user home directory for things like copying and date time stamping files into an archive directory, renaming files from vendors to a standard name for import &c.  Some of these extracts are created via sqlcmd with a T-SQL file as well as some being a 4 G/L program.
          John Desmarais
          Basic Member
          Posts: 20
          Basic Member

             

            In tokendef

            Go to "User Form IDs"

            Create a category if you don't have one

            Add a form ID to your category

            Define form

            In the Command field enter the full path to scripts (ie. /lawson/nhscripts/sample.sh)

            Save and exit

             

            In jobdef

            Create a job

            Tab down to first Step # line

            In Form ID hit F4

            In Type hit F4, select User

            Tab down to Category, F4, select your category (from tokendef)

            Tab down to the token you created for your script and select

            Save job

            Submit job

             

            To create/submit job in Portal you may need to use the "Multi-Step Job Definition" screen, leave the Data Area field blank and type the Token name into teh Form field (drop down won't work).

            Don't forget to add your token to the security role(s) as needed.

             

             

            EDIT: Just realized that you said you were migrating to Windows from Unix - I had originally read it eh other way around.  I am unfamiliar with how intluu works, so my response above may be completely worthless.

            Japheth
            New Member
            Posts: 1
            New Member

              Running Unix scripts on a Windows environment is mainly depended on what Windows version you are on. We moved from unix to Windows 2008 R2 and I was able to get all the scripts to work but we recently upgraded to 2012 R2 and i could not get the scripts to run hence I had to convert all the script to batch. Thought  I can run the batch scripts as tokens, i decided to have a single program which allows user to enter parameters and that allows them to run the scripts without worrying about updating userratts when they change passwords.

              Let me know what Windows version you are running.