Workload Automation

Expand all | Collapse all

(CAWA DE) How to convert contents of csv file into a variable?

Jump to Best Answer
  • 1.  (CAWA DE) How to convert contents of csv file into a variable?

    Posted 09-05-2018 08:59 AM

    I have a csv file with hundreds of server names in it (File is formatted as: Server=************,Concept=xx,Corpcode=***,TZ=eastern). 

     

    Is there a way via javascript I can read a csv input file and convert the value in "Server=" to a $servername variable? In powershell I can use the Import-csv cmdlet and build an array list, but I'm looking to create a variable that I can pass into many individual jobs within espresso.

     

    Any comments or input will be greatly appreciated.

    Thanks! 



  • 2.  Re: (CAWA DE) How to convert contents of csv file into a variable?
    Best Answer

    Posted 09-10-2018 10:38 AM

    Can you try the file_read javascript function to read the contents of the file into a javascript variable? You can use the variable in subsequent jobs in the application. See example in the docs;

    File-level Javascript Functions - CA Workload Automation DE - 12.0 - CA Technologies Documentation 

     

    Hope it helps.



  • 3.  Re: (CAWA DE) How to convert contents of csv file into a variable?

    Posted 04-15-2019 06:07 PM

    I realize this is an old thread.  Wondering if you ever cracked this nut?

    We use PowerShell to read text files and then call CLI.bat to trigger applications and pass server names to jobs through the APPL._user1 - APPL._user4 fields.  In this way the variable can be passed to just about any field in an job and will be resolved at gen time.