What exactly are you trying to accomplish?
Knowing that, it would be easier to give you a solution.
*
You can use CPYSPLF to a flat file and then use CPYF to put it back into a spool file, but that may not be the best solution for you.
-----------------------------------------------
There are a few choices
1. A cl program can do
1.1 an OPNQRYF to select the one persons records
1.2 an OVRPRF can set the SPLFOWN - although we usually use seperate outq's
1.3 call the invoice processing program
1.4 clof the qryf
1.5 dltovr
1.6 go back to 1.1 for next user
2. The invoice processing program can be changed with the printer file set to usropn
2.1 an OVRPRF can set the SPLFOWN - although we usually use seperate outq's
2.2 open the printer file
2.3 process records for that user
2.4 close the printer file
2.5 dltovr
2.6 goto 2.1
3. If the spool file is not *AFPDS
3.1 use CPYSPLF to copy it to a flat file with *FCFC
3.2 have a program read through the file picking each record for user1
3.3 write each record for user1 to a second flat file
3.4 use cpyf to copy the spool file to qsysprt
3.5 repeat steps 3.3-3.5 for each user
Phil
--------------
ROBOT reports can break down the spoolfile, if there is something on the page to determine the routing.
Phil
Last Wiki Answer Submitted: September 10, 2009 2:09 pm by philpl1jb44,630 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
Boulevard rephrased his question, which I’ve copied here. Question clarifications and follow ups should be added in the discussion area below. Thanks! -Michael
When i (user id A) call a RPGLE program to generate report, the report will reside in my spool file(user id A). i would like to copy this report for user id B and C, meaning, when user id B type WRKSPLF, he/she can see the report generated. any means to do this?
The easiest way is to use other options on the WRKSPLF command.
For instance, when you write the spool file, specify a unique value in the “User Data”
Then do WRKSPL *ALL and put that value in the UserData field
thank you for your suggestion but this solution is not what i am looking for.
actually the report will print all invoices created for the day by all users. during night time, this program will be called and program should be ‘smart’ enough to segregate invoices created by each user and send them a copy.
for example,
invoice created by
inv001 Jerry
inv002 Jerry
inv003 Tom
Inv004 Mickey
the invoice report contain inv001, inv002 will be appeared in jerry’s spool file
the invoice report contain inv003 will be appeared only in Tom’s spool file
the invoice report contain inv004 will be appeared only in Mickey’s spool file
hope you can share with me how you will handle in such scenario.
Seems like you are trying to do a log of after-the-fact work.
When you are printing your invoices, can you have the input file sorted in user sequence.
Then within your program, you make the printer file USROPN.
Whenever there is a level break in user,
Close the printer file if it is open
Then CALL QCMD to do and OVRPRTF with user information,
then OPEN the file.
What I do when I need to break a report up for different people is to define the printer file as USROPN. If you issue an override before you open the file, you can specify things like output queue, user data, etc. When the ‘break’ occurs, close the file and delete the override, then issue an override for the new group of output. It can give you a lot of small spool entries, but a good amount of control over direction.
You don’t name the platform. When you say “spool file” are you referring to z/OS JES queue file?
Have you tried the SNDNETSPLF command ?
Boulevard rephrased his question, which I’ve copied here. Question clarifications and follow ups should be added in the discussion area below. Thanks! -Michael
When i (user id A) call a RPGLE program to generate report, the report will reside in my spool file(user id A). i would like to copy this report for user id B and C, meaning, when user id B type WRKSPLF, he/she can see the report generated. any means to do this?
Hi Satsho,
i think i can’t use SNDNETSPLF as SECADM may not want to enroll user id by id, any other way out?
The easiest way is to use other options on the WRKSPLF command.
For instance, when you write the spool file, specify a unique value in the “User Data”
Then do WRKSPL *ALL and put that value in the UserData field
Hi Charlie,
thank you for your suggestion but this solution is not what i am looking for.
actually the report will print all invoices created for the day by all users. during night time, this program will be called and program should be ‘smart’ enough to segregate invoices created by each user and send them a copy.
for example,
invoice created by
inv001 Jerry
inv002 Jerry
inv003 Tom
Inv004 Mickey
the invoice report contain inv001, inv002 will be appeared in jerry’s spool file
the invoice report contain inv003 will be appeared only in Tom’s spool file
the invoice report contain inv004 will be appeared only in Mickey’s spool file
hope you can share with me how you will handle in such scenario.
thanks
Seems like you are trying to do a log of after-the-fact work.
When you are printing your invoices, can you have the input file sorted in user sequence.
Then within your program, you make the printer file USROPN.
Whenever there is a level break in user,
Close the printer file if it is open
Then CALL QCMD to do and OVRPRTF with user information,
then OPEN the file.
guys,
thank for the advice.
Cheers.
I found a parm on the OVRPRTF – SPLFOWN – that specifies, for spooled output only, who the owner of the spooled file is. Worth a try…
What I do when I need to break a report up for different people is to define the printer file as USROPN. If you issue an override before you open the file, you can specify things like output queue, user data, etc. When the ‘break’ occurs, close the file and delete the override, then issue an override for the new group of output. It can give you a lot of small spool entries, but a good amount of control over direction.