Question

spool file from the as400

Asked by: bear23

I have a spool file from the as400 when it is copied to a physical file for pc manipulation, it loses it format. How can I get the spool file to the pc without losing the format. I will post a question if someone can reply back.
I am using vb6. I would prefer having a way to go right to the spool file and take it and copy it to the pc. See what I am trying to do is. We what to get the spool file data and dump it into a database so that we can create a better and manipulated report. We want to transferring of the data to a physical file all automated. If this is needed. I thought about just having a certain spool file go to a pdf printer and then try and find a way to convert the pdf to a text file. Any ideas would be appreciated.

I like it being dumped to a physical file but it loses all if format. Example, if there was two enter lines after the sentence:
I love the gym

Great


It would look like
Great



Can anyone help?

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2003-08-15 at 08:50:05ID20710819
Tags

spool

,

file

,

as400

Topic

Programming for iSeries / AS400

Participating Experts
6
Points
50
Comments
29

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. spool file transfer from AS400 to PC
    I'm looking for a program which can download AS400 spool files to PC. if you know such programs, please send me internet address of the programs.
  2. how to copy an as400 spool file to the pc
    My pc runs an as400 emulator called 'Bosanova'. The spool file contains reports which can be printed out. I would like to capture the spool file to my pc so that the report can be enhanced. Help would be appreciated.
  3. AS400 Spool into Word? Mail Merge?
    Hello, I would like to know how to get data from a spooled as400 file into ms word. We print of remitance slips on a pre-printed form but we would like to email them instead but the email must contain the company logo etc.. The spool file contains several different companie...
  4. As400 spool files with overlay how do I convert to PDF
    Hi I have AS400 printer files with overlays applied to them using OVRPRTF. I want to contvert them to a PDF format on the IFS so they can be loaded into a archive system. We have a utility to create the PDF but it does not take the overlay with it and will only work if it is ...
  5. Transfer an AS400 spooled file from one user to another
    I have a CL program that runs several dozen AS400 queries. The resulting spooled files appear under my user id. I would like some of them appear under another user id so that when they check "their own" spooled files using WRKSPLF they can see and manage these repor...
  6. Transfer AS400 Spool file to another AS400
    We recently installed a new AS400. How do I transfer SPOOL files from the old AS400 to the new AS400 output queue while retaining the correct format?

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: jjjjjjjPosted on 2003-08-15 at 09:02:49ID: 9160260

I believe that ShalomC can help on this one as he assisted me on a similar problem ( I don't want to snipe his points as he can be the best source on this.)

jjjjjjj

 

by: bear23Posted on 2003-08-15 at 10:10:17ID: 9161147

I have a the as400 and when I try and send the spool file into a physical file the spaces get eliminated meaning that the format is not the same. Even when I use operation navigator, drag and drop the format is still different. Why. Is there a way to get a spool file from the as400 to the pc with the same format and without having to do anything with the as400, meaning not having to install anything on it. please someone help...

 

by: murphey2Posted on 2003-08-15 at 12:05:18ID: 9161933

Hi bear23,

Most easy way to do it, is via the Client Access "Operation navigator".
When you start the navigator, click on as/400 hostname in the left part of the window (if you have more then 1 AS/400 select the one you want to work with), click on basic-operations and  than click on output.
Now a list is shown with all of your AS/400 spoolfiles, Just drag and drop them somewhere on your PC.

Regards,

murphey

 

by: jjjjjjjPosted on 2003-08-15 at 12:17:35ID: 9162010

Hey Murph,

If you know how to do this without using the operations navigator (either a CL, RPG etc..) could you please post those comments?  If I need to post a question to put some points out there, I can do that as well.  It would be nice to know how to automate a splf move to a workstation folder so the user can get access to it, all from the 400.

I'm sure it has something to with the the data transfer protocol, but I can't figure it out.

That way, when the user calls an established app, the CL is called and the transfer is automatic.

jjjjjjj

 

by: bear23Posted on 2003-08-15 at 13:28:57ID: 9162548

The problem with that is that the format is gone. I lose all the special formatting that the orginal spool file had.

 

by: murphey2Posted on 2003-08-16 at 11:42:40ID: 9166284

As far as I know, dosn't have an AS/400 printerfile no special format (maybe exept for bold, what is actualy double strike printing). All oter spoolfiles (with format) are not real AS/400 spoolfiles, what you can do is to try to create an PDF file of it.

 

by: shalomcPosted on 2003-08-18 at 08:52:23ID: 9174392

bear23,
Are you interested in converting an existing spool file into a PC readable format (like PDF) while retaining the format, or do you want to merge Office documents with AS400 data?

 

by: bear23Posted on 2003-08-18 at 09:00:39ID: 9174447

yes, The bottom line is that I want to take what I see on the as400 spool file, format and all and have it accessable on the pc the same way. This has to be done programmably. I preferr visual basic. I am even playing with the idea to have the spool file print to a generic printer driver, but the format is still not all the same. Then I tried to print to the pdf driver and it prompts me for a save location, plus I really didn't want to have to go and buy pdf printers. The generic is available for free. Can you please help

 

by: shalomcPosted on 2003-08-18 at 09:46:14ID: 9174742

What AS400 version are you using?
Do you have InfoPrint installed?
Do you have Java installed?
Are the reports large?
Are you willing to spend a few bucks for a spool to pdf conversion tool?

 

by: bear23Posted on 2003-08-18 at 10:01:54ID: 9174860

there isn't a way to connect to a spool file then using vb 6

 

by: shalomcPosted on 2003-08-18 at 11:51:08ID: 9175621

Create a flat file on the AS400 that has a record length of 200.
CPYSPLF your printed output into this flat file with parameter CTLCHAR(*FCFC).
The resulting file will have a control character in the first position of each record, that tells you how to treat each record.
Now, you can write your VB program and process the printed output properly.
If you cannot decode the meaning of the control characters give us a shout.

ShalomC

 

by: murphey2Posted on 2003-08-19 at 08:11:43ID: 9181482

Hi bear23

What exactly do you mean by "loosing the Format", Are you using diferent chracter sizes, lines and or barcodes etc.
or do you mean only the empty lines and form feeds?

 

by: jjjjjjjPosted on 2003-08-19 at 08:30:54ID: 9181613

I have been tagging along for the ride on this one, and have worked with the CTLCHAR(*FCFC) that Shalom suggested.  I created a folder in the IFS, and saved the PF (with the special character at the beginning of each line) and it looks correct to me, ie.... it is an exact representation of the SPLF.  I see this via a mapped drive, and I also saved the PF as an extension of .TXT.

Maybe you should consider (if it is possible) creating an HTML document on the 400 and then creating a mapped drive to the folder in the IFS, which could contain the HTML doc.  Then you could just get the HTML and do what you need with it.

Keep in mind, this would only work if it is possible to create HTML on the 400.  Shalom or Murph, what are your thoughts on this idea?

jjjjjjj

 

by: bear23Posted on 2003-08-19 at 08:51:47ID: 9181731

This is what I mean when I say format.
This is what it looks like on the 400

           Tim Allen        John Smith


Love to be here
           Great Day


This is what it looks like when I drag and drop the spool file to pc


           Tim Allen        John Smith
Love to be here
           Great Day


This is a small thing, but really screws up the forms when this is printed. No if I create a physical file then each line of that physical file will be a record.

Meaning if I tied into it using access. This would be the only advantage of using the physical file I think. Then each line is a record. Then what would be needed is identifiers for each secton meaning.

           1Tim Allen        John Smith
Love to be here
           2Great Day


So that a code could be written to gather all the 1 and place in a field
then gather all the 2 and place it in the second field, etc.

Then you would have each section seperated and then the format could be easily fixed. The problem is that I would need to program idenifiers it is just oo much work.

Make sense or did I really lose you.


All I am tried to do is find a way to have the spool file look actually the way it looks on the as400. From the pc I will place the data to a form that I will create with a letter head and column lines.
Thats all.

 

by: shalomcPosted on 2003-08-19 at 09:03:22ID: 9181808

jjjjjjj,
An HTML representation of a report cannot provide accurate rendering of the overstriking, so you lose the format.
The only way is to either create an RTF file via some VB voodoo, or to create a PDF file.
I would go for PDF.
There are quite a few options for PDF.
Acquire a PDF print server like Acrobat or Optio which supports LPD and define a remote OUTQ to that server.
Install IBM's InfoPrint for iSeries.
Get other AS400 PDF utilities, here are some links
http://www.experts-exchange.com/Programming/Programming_Platforms/AS400/Q_20502773.html
http://www.experts-exchange.com/Programming/Programming_Platforms/AS400/Q_20125952.html

There is also
http://www.bvstools.com/spltoolsuite.html (which I can testify that really works..)

If you must have a free solution, but without any support, you can find a couple more on Google.

 

by: jjjjjjjPosted on 2003-08-19 at 09:05:53ID: 9181824

Here is the code I used to get the splf into a PCD (PC document):

 ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+
 NEWFLDSUB:  PGM                                                
                                                                 
             DCL        VAR(&DOC)   TYPE(*CHAR) LEN(8)          
             DCL        VAR(&USER)  TYPE(*CHAR) LEN(10)          
             RTVJOBA    USER(&USER)                              
                                                                 
             CHGVAR     VAR(&DOC) VALUE(%SST(&USER 1 8) +        
                          *TCAT '.TXT')                          
                                                                 
             CRTPF      FILE(QTEMP/TEMPFL) RCDLEN(150)          
             CPYSPLF    FILE(YOURSPLF) TOFILE(QTEMP/TEMPFL) +    
                          SPLNBR(*LAST) CTLCHAR(*FCFC)          
                                                                 
             CPYTOPCD   FROMFILE(QTEMP/TEMPFL) TOFLR(OUTPUT) +  
                        TODOC(&DOC) REPLACE(*YES)                
                                                                 
                                                                 
                                                                 
                                                                 
 ENDCLP:     ENDPGM                                              

As you can see, I use the CPYTOPCD command to get the PF and move it to the OUTPUT folder in the IFS, with the name that I created from the user who called the CL pgm.  Once it is in this format, you do get what you desire.


You first have to create the folder in the IFS using the CRTFLR command.  Once you have the the folder created, you can then map a drive to the folder on your PC and have your VB code use that path to get the document and convert.  



jjjjjjj

 

by: bear23Posted on 2003-08-20 at 07:58:31ID: 9188725

so there isn't any way to easily connect straight to the spool file using vb6 and there isn't any way to get the spool file with the page formatting without using the as400 is some way. Even if I use a generic printer that keeps the formatting. Anything. I really don't want to have to touch the 400

 

by: jjjjjjjPosted on 2003-08-20 at 12:35:28ID: 9190750

Why don't you use ADO or RDO or ODBC and then use MSquery to do what you need?  It could even be a timed event!

Since the PF that was created using CPYTOPCD does not alter the format I think that this will get you the format that you need, unless I am missing something.

The CTLCHAR(*FCFC) looks good for tagging the records in the PF as well; this could help you IMHO.

jjjjjjj

 

by: bear23Posted on 2003-08-20 at 13:35:20ID: 9191151

I am loosing the page format on the pf. And it you link to the pf you will notice that each line of the spool file is a record. If that is the case then there is no way to identify which page is what.

 

by: jjjjjjjPosted on 2003-08-20 at 14:02:34ID: 9191302

bear23,

I am sure that you are familiar with using substring commands in VB, and also being able to map fields from the PF into your finished document.  As Shalom commented concerning PDF formats, and myself giving you actual code and examples of how to get a PCD, you should be able to write some code and create a connection to get access to the PF, substring the fields out by getting the attributes from the DDS and mapping the results via VB voodoo ( I had quite a chuckle over that one, Shalom :)    ).

You can identify what page is what by using the CTLCHAR(*FCFC) command.  I did it and it works fine, just as Shalomc stated.

At this point, I don't see where any more help can be given.  Please give the points to Shalomc and close this question down.

jjjjjjj

 

by: bear23Posted on 2003-08-27 at 13:30:17ID: 9235556

I have been trying but still nothing. All I want is to be able to have the data on the as400 be on the pc without lossing the page format.
I keep lossing the page format, spaces.
I have even tried generic printers that print to file and still no luck. Isn't there a way with java or anything that I can just tie right to the spool file and convert the data to pc without lossing the format???

 

by: shalomcPosted on 2003-08-28 at 22:47:42ID: 9245706

bear23,
I don't understand. You were given instructions on getting the formatting information yourself, yet you were not satisfied.
You were given tips on converting a spool file to HTML, to MS-Word format, and to PDF, yet you were not satisfied.
I see from your question history that you are no stranger to Acrobat. What is an acceptable answer in your eyes?


 

by: bear23Posted on 2003-08-29 at 05:52:27ID: 9247512

I know I am sound like a pain, but I am trying to do this without having to change or write anything on the as400.  PF file would not work because like I said before if you link to the pf, each line was a record in MS access or any  other database program. Since these are reports for customers, each set of data has to be with each customer in a certain format. We use to use preformatted paper and the as400 was formatted to print to the paper format. With boxes, tables etc. So we are trying to eliminate the preprinted paper and have the data come out and have the computer make the form. But when I convert to pdf the text is smaller. That is why I wanted to go to a text file so the font could be bigger(same as if printed on the 400). Also a major thing is that I do not want to install anything on the AS400. It seems like all the spool file program requires you to install something. Isn't there anything else that will work for me. Please be patient..

 

by: shalomcPosted on 2003-08-31 at 01:25:42ID: 9256436

Hey bear23,
If the problem is the font size, then I suggest playing with different fixed width fonts and sizes, until you have found the one that suits you most.

The point is that a text file does not carry ANY formatting information.
If you cannot install anything on the AS400 server, then you have 2 options:
One: use the technique I described above to write an application that will parse the spooled file with it's control data, and create any output you like, for example using Adobe SDK.

Two: Get yourself an appliction that manages Postsrcipt or PCL datastreams. Harness this to a LPD server on a windows machine that saves it's incoming datastreams. Define a Remote OUTQ that points to this LPD and converts the spool data either to Postscript or to PCL.
There are commercial products that will do all this and more (like merge the printout with all kinds of templates).
Give us a shout if you need recommendations.

ShalomC

 

by: bear23Posted on 2003-09-02 at 06:22:18ID: 9266991

could you elaborate more on then two idea. I will open up a new question if desired.

Thanks so much

 

by: shalomcPosted on 2003-09-04 at 06:33:10ID: 9287947

bear23,
take a look here for a commercial product that does just that.
Once you see how it works, it is not too dificult to write a similar solution with VB and Acrobat SDK.
You will need a VB LPD component, unless you wish to write your own.

The solutution is not expensive, so you just might end up buying it instead of developing a parallel tool.

I would appreciate it if you grant more points (by opening new question), since the scope did grow a bit...


Cheers,
ShalomC

 

by: bturnerPosted on 2004-05-28 at 04:41:57ID: 11179276

I found this post while searching for solutions for a similar problem.  I print invoices from our iseries to special forms.  We then copy the spool file to a file on the AS400.  When you copy the spool file to the file on the AS400 it codes each line with the spacing as follows:
CODE 1 WILL SKIP TO NEW PAGE    
CODE ' '  WILL SPACE ONE BEFORE THE LINE DATA
CODE '0'  WILL SPACE TWO BEFORE  THE LIINE DATA
CODE '-'  WILL SPACE THREE BEFORE THE LINE DATA
To reprint I wrote a program in RPG to use the codes in the first space on the line to format the document.  That works great on the AS400 but we only keep the current month out there and then archive to microfiche.  I now want to be able to move that file to the network and import to Access for archive purposes.  The user could then search the database for a historic invoice and reprint or email it to the customer.  I am not sure how to code it so the spacing is correct.  

 

by: blueknight529Posted on 2004-07-19 at 20:02:56ID: 11589371

Here's a solution that I have used.
1) Install the Windows GENERIC TEXT PRINTER DRIVERS. Assign it's port as " C:\TEMP\ASCII.TXT" or what ever destination and file name you desire.
2) Use Client Access (iSeries Access) and start a printer session to you AS/400, and make sure it's printer setup is using the Generic Text Printer. Make sure you specify a session name ie: GENTEXT
3)Move your original spool file to the outq you just created in step 2, by putting a 2 beside the original spool file and typing the following on the command line:  OUTQ(GENTEXT) SAVE(*YES)
4) Hit Enter.
5) You should get an ascii text file, with original formatting in the location specified in step 1.
6) By using the SAVE(*YES) option, you will not loose the original spoolfile.

 

by: RVITPosted on 2004-11-23 at 07:43:03ID: 12655970

There is a product by ASC called ESEND.  it contains an outq monitor.  Basically you setup an outq and apply some rules to it in the software.  The spooled files then appear in your mailbox as whatever format you specify - PDF, TEXT, etc.

its really good.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...