copy spool file to another user’s spool file

55 pts.
Tags:
AS/400
AS/400 Spool Files
IBM iSeries
hi, any command allowed me to copy printer file in my spool file to another user's id spool file. thanks.

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 10  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Meandyou
    You don't name the platform. When you say "spool file" are you referring to z/OS JES queue file?
    5,220 pointsBadges:
    report
  • Satsho
    Have you tried the SNDNETSPLF command ?
    1,245 pointsBadges:
    report
  • Boulevard
    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?
    0 pointsBadges:
    report
  • Boulevard
    Hi Satsho, i think i can't use SNDNETSPLF as SECADM may not want to enroll user id by id, any other way out?
    55 pointsBadges:
    report
  • CharlieBrowne
    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
    41,380 pointsBadges:
    report
  • Boulevard
    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
    55 pointsBadges:
    report
  • CharlieBrowne
    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.
    41,380 pointsBadges:
    report
  • Boulevard
    guys, thank for the advice. Cheers.
    55 pointsBadges:
    report
  • Satsho
    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...
    1,245 pointsBadges:
    report
  • Splat
    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.
    7,625 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following