Link to home
Start Free TrialLog in
Avatar of Sambasivam Subramanian
Sambasivam Subramanian

asked on

Copying spool file into the from the output queue into a physical file in AS400

Hi All,
The below is the requirement.
I have multiple queues  as below and i want to retrieve only specific output queues . These specific queue represent each day e.g
MON1,TUE1,WED1,THU1,FRI1 .These output queues are placed in random order and are in 'RDY' status in the queue.
Every day when the spool file comes into a specific queue , it should be copied into a physical file.
For Eg. On Monday, once the spool file SPOOLF1 is present in the output queue MON1, it should be immediately written to the physical file even if it is empty.There are many  other spool files present in MON1, however, the copy should be performed only to the specific file SPOOLF1 for MON1.

On similar lines, once the spool file SPOOLF1 comes to TUE1 queue , it should immediately be copied to another physical file and so on and so forth for queues WED1,THU1 and FRI1.

Work with all output queues:

Queue          Library
A                    XYZ
MON1           XYZ
C                    XYZ
D                   XYZ
TUE1             XYZ
F                    XYZ
H                    
I
WED1          XYZ
J
THU1           XYZ
K
L
FRI1                XYZ

After selecting output queue TUE1, i am in the below screen:
Work with output queue:
File                 User                    User Data       Sts
SPOOLX        user1                    ud1                 RDY
SPOOLY        user1                     ud2                RDY
SPOOLZ        user1                     ud3                RDY
SPOOLF1      user1                     ud4                RDY                -->    This file needs to be copied to a physical file
SPOOLQ       user1                     ud5                RDY
SPOOLR        user1                     ud6                RDY
SPOOLS        user1                     ud7                 RDY


Would really appreciate if someone can help me out with this, Thanks in advance for the help !
ASKER CERTIFIED SOLUTION
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Member_2_276102
Member_2_276102

I would also go with PDFs rather than with physical files. But a few other questions should be answered first.

If SPOOLF1 is copied to a PF from MON1, will SPOOLF1 from TUE1 be copied into the same PF? Or is a new PF created for every SPOOLF1? If it's the same PF, will it be the same meber or is a new member created? If it's the same member, is it replace or add?

There are plenty of other questions such as "What's the point?", but those above would be better.

Personally, I'd prefer basic spooled file backup rather than copying to a PF. Store the backups somewhere off-line. And in fact, I generally don't believe in "spooled file backup" much at all. Whenever possible, the data that generates a spooled file should be what gets stored. With the data, spooled files can be generated over and over whenever needed. In addition, storing the data as database files gives far easier opportunities for future queries against it, something that can be very messy for "spooled file backups".

Also, if data for spooled files is generated into intermediate database files and spooled files are created from that data, alternative output methods can be applied. A spooled file might be created or a PDF or a spreadsheet or a display file or...? The spooling programs will also be simpler since their only purpose will be to format output. Logic for generating the data will be separated from the printing function.