Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Can you redirect COBOL DISPLAYs to a file?

Posted on 2005-05-02
4
Medium Priority
?
679 Views
Last Modified: 2008-02-26
Dear Experts,

Is there any way on the AS/400 to redirect COBOL DISPLAY statements, such that they are written to a file instead of displaying on the terminal?  Could you use some sort of preceding CL override to do this?  

Thanks,
BrianMc1958
0
Comment
Question by:BrianMc1958
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
tliotta earned 750 total points
ID: 13911519
BrianMc1958:

Off the top of my head, I'd guess not.

I've never researched it, but it appears as if COBOL DISPLAYs don't do what we think of as file I/O; therefore, there is no override possible.

It _looks_ as if COBOL DISPLAYs rely on underlying support similar to SNDPGMMSG or SNDUSRMSG. That is, the output goes to the job's *EXT message queue, not to a file.

If I needed the messages to end up in a file, I'd probably look at messaging APIs that would retrieve messages from the job's message queue and write what was received to a file.

But maybe someone out there has a bright idea.

Tom
0
 
LVL 14

Expert Comment

by:daveslater
ID: 13918006
Hi
I have never tried it but in cl try

pgm

CRTDUPOBJ OBJ(QASCCPY) FROMLIB(QSYS) OBJTYPE(*FILE) TOLIB(mylib) NEWOBJ(MYFILE)

strcpysrc srcdev(*requester) outdev(*none) outfile(mylib/myfile)

call pgm

ENDCPYSCN

endpgm


Dave
0
 

Author Comment

by:BrianMc1958
ID: 13920196
Dear Everybody,

Thanks, but I'm afraid business pressures have forced me to move on from this question, so I can't try it out.  If anyone is reading this later, give it a try!  As it is, I'm forced to award points to Tom.  His response matches my experience: You can't get there from here.

Thanks again!
--BrianMc1958
0
 
LVL 27

Expert Comment

by:tliotta
ID: 13921167
BrianMc1958:

Wish I could do more. Dave's STRCPYSCN is a novel idea. Best I can do is to point to retrieving messages from the joblog (i.e., the job *EXT message queue) after the program is done.

Assuming this is a kind of audit function, I'd guess that retrieving the messages is as good as it's gonna get. Reading up on COBOL DISPLAY gave no better hint.

Tom
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Dropbox has a relatively new feature called Smart Sync.  This feature allows Dropbox Professional (not plus) and Dropbox Business (if enabled) users to store information in Dropbox WITHOUT storing any files on their computer.
Machine Learning is one of the profound applications of AI and therefore, just like AI, it is surrounded by myths and fears. Check out these facts about ML that demystify the related myths.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

580 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