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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending files to multiple outq

Status
Not open for further replies.

Ju5

Programmer
May 25, 2007
85
PH
Does anyone know how the command/program for sending one report to multiple outq looks like? Any example would be appreciated.

Thanks.
 
Look here.
Or,

SNDTCPSPLF RMTSYS(SameAS400) PRTQ('MyLib/MyOtherOutq') FILE(SplfName) JOB(.../.../...) DESTTYP(*AS400) TRANSFORM(*NO)
 
I was thinking more like duplicating an output and sending the duplicate to another OUTQ.

The user receives a report in one location and another user wants to receive the same report in another location.

Here's the example I was able to find:
CALL PGM /* program that generates QSYSPRT */
CPYSPLF FILE(QSYSPRT) TOFILE(ACJXL/SPOOL1) +
MBROPT(*REPLACE)
OVRPRTF FILE(QSYSPRT) TOFILE(QSYS/QSYSPRT) +
OUTQ(outq1) COPIES(1) HOLD(*YES) +
USRDTA('report01') SPLFNAME(report01)
CPYF FROMFILE(ACJXL/SPOOL1) TOFILE(QSYS/QSYSPRT)
DLTOVR FILE(QSYSPRT)

For some reason the OUTQ of the report remains the same and does not change to outq1. I've tried moving the OVRPRTF above the CALL but I received the same results.

Any ideas?


 
Forget the overrides. You need to do a CHGSPLFA on the last spool file to change its ouput queue (after you have duplicated the spool file):

Code:
CHGSPLFA FILE(QSYSPRT) JOB(*) SPLNBR(*LAST) OUTQ(OUTQ1)

Solum potestis prohibere ignes silvarum.

 
Flapeyre,
If you change outq with CHGSPLFA the report is no more in the previous OUTQ; however Ju5 wants the reports to remain in it as far as I understand her first request.

Ju5,
Why do you want to duplicate the spool using CPYSPLF CTLCHAR(*FCFC)? Doing so will not save the printing attributes such as CPI and LPI whilst using SNDTCPSPLF avoids the hassle of the defective CPYSPLF.
 
I'm actually just using an example I found at this link:


I think I found another way using SNDNETSPLF but which do you think would be better: SNDTCPSPLF or SNDNETSPLF?

Also I have one RPG program that produces 2 QSYSPRT files. Is there a way to duplicate both of them?
 
Looks like SNDTCPSPLF does the job! Thanks Mercury2! I wasn't sure if I could TCP the file back into the same system(the destination address is the same one you're using) but apparently, you can. Here's what I used:

SNDTCPSPLF RMTSYS(AS40008.SBY.STF.BMS.COM) PRTQ(outq1) +
FILE(QSYSPRT) SPLNBR(*LAST) +
JOBSYSNAME(*CURRENT) DESTTYP(*AS400) +
TRANSFORM(*NO)

I had to set the Transform parameter to *NO because the copied file becomes garbage if the Transform is set to *Yes. I also had to specify that the Destination type was *AS400 to retain formatting.

I still need to know if it's possible to do the same when a program outputs 2 QSYSPRT files, if it's even possible, and how.

 
I jsut noticed that the two files generated by the program have different names. SNDTCPSPLF should still work. Right?
 
Ju5 said:
I had to set the Transform parameter to *NO because the copied file becomes garbage if the Transform is set to *Yes. I also had to specify that the Destination type was *AS400 to retain formatting.
That's exactly what I showed on my example of SNDTCPSPLF above.

To answer your last question SNDNETSPLF and SNDNETSPLF send both the spooled files to the network. However SNDNETSPLF sends the spooled files over SNA (IBM Network) and I am pretty sure that you are better off with SNDTCPSPLF that sends over TCP/IP.
If the files generated by the program have different names SNDTCPSPLF will work. If they have the same name, SNDTCPSPLF will work provided that they have the correct spool number (SPLNBR).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top