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.
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!
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.
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
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
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 4  Replies