LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Accessing Result Data in a Script

    Employee
    Posted 02-15-2012 04:44

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: jonathanm

    Is it possible to access the contents of a result data set within a BRAIN script?

    I need to access a specific job on the iSeries and have put together a group of nodes that will extract the jobs identifying characteristics (Job Name, Job Number and User ID) and populate a result set.

    I now need to retrieve these details from the data set so that I can build up a string to be run using a DB Execute node. I have tried adding the result set (which only contains 1 record) as an input to the DB Execute node, but get an error "Parameter "SpoolFile" is not defined" for the following statement:

    cmdStr = "CPYSPLF FILE(" + trim(SpoolFile) + ") TOFILE(QGPL/SPLF132) JOB(" + JobNo + "/" + 
    			trim(User) + "/" + trim(JobName) + ") SPLNBR(*LAST)"
    Is there any way of doing this in this node? If not I'll have to write a program to do it on the server, but would like to avoid that as it means having to go through the rigmarole of testing, documenting and deploying as it's a Production machine.

    Thanks

    Jonathan


  • 2.  RE: Accessing Result Data in a Script

    Employee
    Posted 02-28-2012 14:13

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rboccuzzi

    Jonathan, I am not sure what you are asking here. Where are the data sets loaded? Are they files, or in a database? Are you trying to run a command line script using the DB execute node? That node is for running database commands, SQL commands, not just executing generic scripts on the DB server.... please elaborate as to your needs.

    Cheers
    Rich


  • 3.  RE: Accessing Result Data in a Script

    Employee
    Posted 03-07-2012 04:00

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: jonathanm

    Hi Rich

    What I was trying to do was retrieve a value from a report held on an output queue on the customer's iSeries for inclusion in the graph I was working on. Using the DB Execute node I was able to run various commands that would allow me to identify the job that contained the spool file and that information had been written to a result set from a previous node.

    What I then needed to do was to build up the command string required to copy the report into a database file that the graph could then access with a DB Query. The problem was how to get the values that identified the job from the previous result set into the command string being built in the DB Execute node.

    The short answer was I couldn't and then got told about the JDBC Execute node. By building the command string in the earlier node and then outputing it as a column in the result set I was able to use field bindings to execute the command I wanted to run so problem solved.

    All the best

    Jonathan