Solved

protect a screen when called from another pgm

Posted on 2004-04-05
5
334 Views
Last Modified: 2008-03-06
I have an app, when the user presses F2 a call is sent to another pgm and that pgm's screen is displayed.  The problem is that the data on the screen can be maintained and I want to protect  the data.

1. I can put indicators on the fields and test for pgm "A" calling pgm "B" (in pgm "B"), and if so turn the indicator on and use the protect keyword.  My preference is to not do this.  I am looking for the easiest way.

jjjjjjj
0
Comment
Question by:jjjjjjj
  • 3
5 Comments
 
LVL 27

Expert Comment

by:tliotta
ID: 10761942
I'm pretty sure you've essentially already listed the "easiest" way. If you don't change PGMB to display in an inquiry mode instead of maintenance mode, any alternatives are going to be significantly more difficult.

E.g., you _could_ create a sockets application which connected to the telnet server, send appropriate sockets data to logon and call PGMB and then receive the telnet data stream back. (Or use native virtual terminal APIs for a similar effect.) From that, you could 'screen scrape' and display sanitized output back in PGMA, etc... but it seems a little ridiculous.
0
 
LVL 3

Accepted Solution

by:
Mind_nl earned 100 total points
ID: 10763948
You could add a parameter in pgmB ( value 2 for edit / 5 for display) and change the call in pgmA to include parameter 5. If you have pgmB only check if the parameter is 5(display) and let it run in edit mode for all other values of the parameter you don't have to change any other programs calling pgmB now.
0
 
LVL 27

Expert Comment

by:tliotta
ID: 10770785
Hmmm... come to think of it, there is at least one potential way... Issue STRDBG making sure UPDPROD(*NO) is in effect and the files are in TYPE(*PROD) libraries. Then call PGMB. _If_ PGMB is written as needed and the data being changed is in files and the library hasn't already been opened, etc., you might get the effect you want. Issue ENDDBG after the call to PGMB completes.

Authority for STRDBG, etc., would probably have to be carried in the calling program.

Tom
0
 
LVL 27

Expert Comment

by:tliotta
ID: 10770962
Also note that if you're resigned to changing PGMB to switch between maintenance/inquiry mode based on an _additional_ parm, rather than overloading an existing parm for example, there might be significant problems for programs that are already calling PGMB.

To handle an additional _optional_ parm (assuming you aren't intending to track down and change everywhere PGMB is being called now), PGMB should be an ILE program or written in a language that can handle optional parms.

If PGMB can't reasonably handle an optional parm and you can't take the time to make it do so, you can use an external object instead of a parm. For example, you could create a data area in QTEMP and PGMB could check for its existence. If found, then switch to inquiry mode. Delete the data area after the call to PGMB. Or you _might_ be able to use a job switch -- if switch 1 is on, run in inquiry mode, otherwise normal maintenance mode. (Job switches might already be in use.)

Probably best is indeed to use an additional parm since it can be clearly documented and explained; but be aware that existing program calls to PGMB are at risk.

Tom
0
 
LVL 14

Expert Comment

by:daveslater
ID: 10773469
Hi
what I would do is as Mind_NL has stated, Tom is correct in pgm b parm list causing problems.

if you  need to check how many parms have been sent to the program, this is done via the program status data structure

H                                                                    
IPSDS       SDS                                                      
I                                     *PARMS   PARM                  


or in le you can use the %parms Built in function

Dave            

0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
What is Backup? Backup software creates one or more copies of the data on your digital devices in case your original data is lost or damaged. Different backup solutions protect different kinds of data and different combinations of devices. For e…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now