• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 903
  • Last Modified:

AS400 outqueue files need to go to pc for archieve.

My First Ask.  Be gentle.   I joined today and have searched myself confused.
Problem: Need to get files from the AS400 output queues moved to a pc drive but need to keep the splf date on the file listing for furture retrieval.  EVERYTIME I MOVE A FILE USING NAVIGATOR, TO MY PC, THE PC FILE IS DATED TODAY.  I NEED THE ORGINAL FILE DATE.  Would be able to put groups of files back to AS400 to see date if that is necessary.   These "dayend reports" files are a must archieve item.  I have iSeries Nav and ibm Access for win V5R4mod0.  Files are stored in outqueues with a monthly name.  Oct, Nov, and on etc.  FTP? Will ftp work? How do I get to the outqueue TO get all 4,000 files in there.  Is there some kind of wild card to get them all (LIKE GET THE WHOLE OUTQ).   I really need all files in each outqueue associated with dayend reports moved to my PC.
Further these reports are generated daily with the same filename with a different date.  Moved to a monthly outq but now taking 20% of our space so need to move to windows drive.  Got a 2TB on my system just for this purpose.
  • 3
  • 2
2 Solutions
Gary PattersonVP Technology / Senior Consultant Commented:
Let's take the requirements and questions one at a time.  I'll play nice!

BTW: You mentioned that your Client Access version is V5R4, is your OS/400 version  V5R4?  They often match, but don't have to.  We'll assume they do unless you post back otherwise.

1) Navigator really isn't the tool for this job.  It is designed as an ad-hoc tool to allow you to grab the occasional file, not as a mass file conversion or archive tool.  There are lots of $$$ document management systems that you can use to archive AS/400 spoole dfiles offline, and many will preserve what you want preserved, but none are cheap.

2) Moving spooled files to the PC with Navigator only preserves the CONTENTS of the spooled files, not the ATTRIBUTES.  You want to preserve the attributes.

3) Forget FTP.  Spooled files aren't designed to be accessed this way.  Not a viable approach.

Now that I've told you what you can't do, let's focus on the positive:

Starting in V5R4, it is possible to use standard AS/400 SAVE commands such as SAVOBJ / SAVLIB with the SAVSPLF parameter to save spooled files in a format that preserves spooled file attributes and contents.  If you backup to a special file called a SAVE FILE (the AS/400 version of a tar zip), this save file can be downloaded in binary format via FTP, archived on a PC, and then later uploaded and restored.  Other solutions exist, for example if you own and use the BRMS product, but this is the best way with straight native command on a vanilla AS/400.  

Of couse you can back up to tape or optical, too.  If you do daily or weekly backups, as long as you modify them to specify the SPLFDTA(*YES), you may be able to just add spooled files to your normal backup / archival strategy, or do a special weekly spooled file backup before cleaning up to archive off all the spooled files.


It is not a trivial challenge, but here is the basic process:

1) Move the spooled files to be archived to a dedicated output queue.  You can't back up part of an outq using this technique, so you need to isolate the spooled files.  You may need to write some code or modify your existing jobs to point to a new outq every day.  You can scrit this using spooled file APIs and/or the CHGSPLFA command, or you can download and use a utility like this one:  http://www.dbg400.net/foswiki/bin/view/DBG400/MovOutQ

2) Create an empty save file using the CRTSAVF command

3) SAVOBJ the new OUTQ specifying the new OUTQ as the OBJ, and using the SAVSPLF and SAVF parameters to back up the contents of the outq in question to the specified save file.

4) Use FTP to do a ***BINARY*** download of the SAVF

5) Delete the outq you created and the save file to conserve disk space.

- Gary Patterson
I have iSeries Nav and ibm Access for win V5R4mod0.

I had a lengthy and detailed reply but made the mistake of trying to paste the above line into my reply before submitting. In Rich-Text mode, that's a risky action.

So, all you get this time is a simple suggestion to read about saving/restoring output queues in V5R4:

You can archive savefiles on a PC.

Heh, never mind... Gary's on the job!

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Gary PattersonVP Technology / Senior Consultant Commented:

What I hate is when I've composed a long, carefully crafted reply, and then forget and do a toolbar Search for a reference and wipe it out.  I did that on this one and had to start over.

I've found through trial-and-error that the Undo button can usually unravel the damage done when pasting into the editor window wipes it out.

- Gary

smartfiddlestixAuthor Commented:
I'm trying to be responsive here.  I will now go verify if I have the wherewithall to complete the two assignments.  I sure appreciate the lengthy answer and the missing lengthy answer with the reference.  If I can't get it done from here I need to retire.
Thank you gentleman.
Dan Grammer
Gary PattersonVP Technology / Senior Consultant Commented:
Happy to help, Dan.

- Gary
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now