API or procedure to print layout of spool file in app program

160 pts.
Tags:
API
Print Spool File
Query/400
Hi all,

I stuck in one of the procedure where I am selecting one file and their fields,on next screen function should availble for user to see the layout of spool file for selected filed.

Please share if there is any api or procedure I can call from this screen.

(this functionally is simillar to Query/400)

 

 

 

Answer Wiki

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

Other than processing the source, the only useful APIs that I can think of would be <a href=”http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/apis/quslrcd.htm”>List Record Formats (QUSLRCD)</a> to list the record formats and <a href=”http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/apis/quslfld.htm”>List Fields (QUSLFLD)</a> to list the fields from each format.

But because programs are free to output formats in any order they choose and because printer formats don’t have to come in any particular order (and many might not even be used for a given spooled file), I’m not sure that a “layout” utility could be very useful.

Again, processing the source might give a better indication of any intended layout. Maybe.

Tom

Discuss This Question: 3  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
  • Samule400
    Thanks Tom, Is there any other alternative to print the layout in app programs....?
    160 pointsBadges:
    report
  • TomLiotta
    First, if you have a program described printerfile, you can only process the source O-specs to get any idea what a layout might be. Those might be modified by C-specs since there is no "layout" other than what the program chooses for any print line. Print lines may be different every time the program runs. And if you have an externally-described printerfile, the program has no information about the layout. The layout may change in the printerfile every time the program runs. As long as format-level identifiers don't change, the program will have idea that the layout has changed. Any "layout" would have to be extracted from the compiled printerfile object. I have never seen any API that can extract anything resembling a "layout" from a compiled printerfile object. Often, programmers will use one of IBM's externally-described printerfiles, such as QSYSPRT or QPRINT. Those have almost no layout specified in the objects. Instead, programmers construct printlines inside of their programs and cause those printlines to be inserted into the QSYSPRT or QPRINT output. IMO, that's a very poor way to create reports, but it's still common. In such cases, you need to analyze both the program source and the printerfile description and merge the two in order to guess at the eventual "layout" result. Regardless of the circumstances, the only realistic choice is to process the DDS source for an externally-described printerfile or the RPG O-spec source for a program-described printerfile. There is no generally known alternative unless you can de-compile a printerfile object and can process the internals of the object itself. If you can do that, then there is no point to asking questions here. Processing the DDS source is the only reasonable choice. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    As long as format-level identifiers don’t change, the program will have no idea that the layout has changed. Typo correction... 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