Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

(iSeries) Insert vars based on query in CLP

Status
Not open for further replies.

shogun1950

IS-IT--Management
Oct 5, 2005
2
US
Hello all.

I am trying to automate creation and e-mailing of PDF documents from SPLF, and am using BVS's SPLTOOL (SPL2STMF) utility.

I need to get the splf name, job name, user, job number and splf number into vars so I can plug them into the SPL2STMF command.

So far, I have:
Created a SPLF of the outq (WRKOUTQ OUTQ(MYOUTQ) OUTPUT(*PRINT),
Created a 132 column PF of the SPLF (F132) with one record per entry,
Created a query with PF output with user defined fields using SUBSTR to get my information into fields.

I probably will know the username,jobname and splf name, but I need to select by date to get the jobnumber and, possibly, the splf number into vars to be inserted into the SPL2STMF command.

This has to be CLP, and I have no idea how to get that information into variables. Can someone either give me a hint or take pity on my and just give me the code????

Thanks in advance for any assistance!

Bruce Uberti
Oregon Judicial Department
 
It's surprisingly easier than you might think. You can do it all within one CL.

Declare the outfile from the query.
Run your query.
Read through that file.
Run the spool tool command using the field names prefixed with an ampersand "&".

Let's say, your outfile has the following fields...
"Field name = Description"
FIELD1 = SPLFNAME
FIELD2 = JOBNAME
FIELD3 = JOBNBR
FIELD4 = USER
FIELD5 = SPLNBR

Code:
DCLF       FILE(Library/Filename)
RUNQRY     QRY(Library/Query) - which creates the above file.
RCVF
I don't know the options for that command, so I'll just show you how to use the variables.
SPL2STMF   SPLNAME(&FIELD1) JOBNAME(&FIELD2) etc...

I assume you know how to email from the IFS.

Let me know if that works for you.

Mark
 
Mark -

Thanks for the information! I'll work with it when I get back to work and let you (and everyone else) know how it shook out.

I do know how to email from the IFS, but will not be able to do that until my enterprise people set up SMTP on our local iSeries again.

In the interim, I'll sched a Domino Agent to grab the ensuing attachment and send it via Notes.

Thanks again for the response

Bruce
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top