Parsing spooled File.

45 pts.
Tags:
Application development
AS/400
CLP
Printing
Dear, I have to write a program to parse and analyse a spooled file on a daily basis. In other words, I have to extract some datas from the spooled file and work on those datas. Well, I would like to write this program in C or CL (not RPG) 'cause I'm from the Unix world... :-( Any ideas, or help ? I was thinking that it'll be more easiest to copy the spooled file to a physical file and than have a program parsing the PF, what do you think ? Thanks for your support and best regards, Pierre.

Answer Wiki

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

Hi Pierre

You are right, the easiest way is to copy the spool file to a database file and then parse it using a program.

You can copy the spoolfile to a database file using the CPYSPLF command and then my preference is to use QUERY/400 to parse the file and generate an output file that can be used by other queries or programs for analysis. By using Query to parse the file I can check straight away that the selection criteria I use is giving me exactly what I want.

Hope it helps

Jonathan

Discuss This Question: 4  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
  • Saratusthra
    Pierre You could use the CPYSPLF command to copy it to a physical file, get to the attributes (column names) of the SPLF and extract its data from a CL program. Good luck!
    0 pointsBadges:
    report
  • Jaicee
    If you need to analyze things on the fly, then using Query or Interactive SQL (provided you have it) is the easiest way. But if you are used to writing in C and can write CL programs, you shouldn't have a problem programming in ILE RPG when necessary, especially if you code in /free format. It's a very capable language. In fact, if the spool file is being generated by a program on your system, you might want to consider writing the data to an externally defined physical instead of or in addition to the spool file. Then you could use Query or SQL (or write other programs) to analyze the output. Many ways to "get there"... Drive safe! B) BTW, if you don't have Interactive SQL, there is a free utility you can download (can't remember where) that uses a QM Query wrapped in a CL command. That would allow you to execute SQL statements from a command line or from a CL program.
    0 pointsBadges:
    report
  • JPLamontre
    Why don't you write your parsing tool with C ? C is one of the 4 compilers of WebSphere Dev, others are CL, RPG & Cobol. don't be confuse by the word websphere, I speak of writing classic progs (C or CL or RPG) on green screens. And I have a tool to run SQL in CLP : http://jplamontre.free.fr/AS400/EXECUTESQL.htm
    0 pointsBadges:
    report
  • TomLiotta
    I have a hard time understanding why "parse a spooled file" is a solution at all. Why not go to the data that was used to spool the file in the first place? In any case, given "I'm from the Unix world..", I'd think you'd be interested first in the catsplf Qshell utility. Tom
    125,585 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