Solved

Electronically burst a PRN file that contains 50 reports.

Posted on 2001-06-09
6
207 Views
Last Modified: 2010-05-02
Can VB be used to create a program to burst a PRN file containing 50 reports?  Is there a better way to do this?

The program would start at the first line of the file.  It would store the first line and then proceed to the first line of the next page and compare it to the first line on the previous page. When the first line of the page changes a new report has started.  All subsequent pages would be cut and pasted to a new file and given a file name using the first line of the page.  The program would then continue using the new first line of the file.  This would continue until the end of the file has been reached.
0
Comment
Question by:claudedavidj
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

by:Microsoft
Comment Utility
would this be used for checking a file to see if there is any duplicate pages by any chance ?

the answer is yes

0
 

Author Comment

by:claudedavidj
Comment Utility
Checking for duplicate pages would be a good addition to the program.  But the main job to be accomplished is to burst the PRN file into the 50 separate reports that are contained in it.  The PRN file is 90 megs.
0
 
LVL 4

Expert Comment

by:mcoop
Comment Utility
If the PRN file is plain text, or close enough to plain text, then the task isn't all that hard, however if it is targeted at a specific printer, then chances are that the text is broken down to graphic words, and will be very difficult to parse apart (i.e. you need to emulate the printer's inmternal code to process the print stream).

Can you cut & paste a bit of the PRN file (say first 256 bytes from a couple of pages) - so we can see what is in the PRN file.

(This will also be affected if you choose a different printer driver at different times - the PRN file will contain different print stream data.)

Of course the answer to a lot of this is to select the Generic TTY print driver when you create the PRN file - at least this will be plain text - but won't have any of your fancy report formatting (which you probably want to keep).

Over to you.

DO you have any other options - like driving the application in some way to generate the reports separately... ?
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:claudedavidj
Comment Utility
Unfortunately we are dealing with a legacy mainframe accounting application that is table driven with very poor report distribution capabilities.  Cobol programs are necessary just to send the reports to a data set on the mainframe.  We then FTP the file from the mainframe to our PC.  Whatever bursting is done will have to take place on the file server or PC after FTP.

The reports contain accounting information with three to six sort levels or groupings.  Graphics are minimal.  I will post a few pages.
0
 
LVL 4

Accepted Solution

by:
mcoop earned 50 total points
Comment Utility
The good news is that as a mainframe based COBOL program, it is likely to be nearly plain-vanilla ASCII text.  
This will make it relatively easy to do what you want.

If you can find somewhere (FTP site?) to post a full report file, I'll put some code together to rip it apart.

Alternately, you can send it to me directly at mcoop@aussietech.com
0
 
LVL 4

Expert Comment

by:mcoop
Comment Utility
Which part of my answers helped ??
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now