Solved

protect a screen when called from another pgm

Posted on 2004-04-05
5
344 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
IBM 840 flash storage Array 3 188
AS/400 created the PO exchange server sends the email 5 92
creating materialized view in ibm i series 5 87
IBM TS3100 tape Library 3 59
Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
Direct mail marketing is the act of mailing materials straight to prospective customers. This wide form of marketing is one of the oldest methods of communicating with a geographic based demographic. So is it useful in 2017 and beyond?
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

735 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