Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

protect a screen when called from another pgm

Posted on 2004-04-05
5
Medium Priority
?
362 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 400 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: 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

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

772 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