The comand DSPLNK

pts.
Tags:
AS/400
The comand DSPLNK have for output (*Print) or (*display on screen.) How can I get the result to a file like there is in teh command DSPFLR OUTPUT(*OUTFILE). My files that I have to porcess is under the Root. Best Regards TBJ

Answer Wiki

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

NOT SURE IF THIS IS WHAT YOU NEED BUT IT’S A SUGGESTION

CREATE A FILE RECORD LENGTH 198, I NAMED IT PRTFILE.

PGM
OVRPRTF FILE(QSYSPRT) HOLD(*YES) USRDTA(QSYSPRT) +
SPLFNAME(QSYSPRT)
DSPLNK OUTPUT(*PRINT)
CPYSPLF FILE(QSYSPRT) TOFILE(PRTFILE) SPLNBR(*LAST)
” PUT PROGRAM HERE TO READ THE FILE AND DO WHAT YOU NEED BASED ON RECORD CONTENT”
ENDPGM

===========================================================

Your question doesn’t make much sense. First, if you have a link to a streamfile, then you already have a “file” — a “stream” file. Your question seems to imply that you want the spooled file that is created from printing a streamfile to be put into some other kind of file. What kind of file are you trying to populate? Not a spooled file nor a display file, and apparently not another streamfile. So… a physical file?

But why would you want the physical file to contain the output from DSPLNK *PRINT? What can you use the printed output for?

Okay, you probably don’t really want that. My guess for what you want is the CPYFRMSTMF command. You want to copy a streamfile into a physical file for some strange reason. So, just use CPYFRMSTMF (Copy From Streamfile).

I can’t think of any good reason for doing so, but you must have one. Why not just process the file where it is? RPG, COBOL, C — they’re all perfectly capable of reading and writing streamfiles.

But maybe someone is sending you a streamfile and it belongs in a physical file…? Perhaps it’s in .CSV or tab-delimited format and you need a quick way to break it out into its rows and columns. If so, then you probably should investigate the CPYFRMIMPF (Copy From Import File) command. It might be all you need.

Tom

Discuss This Question:  

 
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

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