Home > Ask the AS/400 Experts > iSeries Application Development Questions & Answers > Using 15,000 line RPG programs
Ask The iSeries 400 Expert: Questions & Answers
EMAIL THIS

Using 15,000 line RPG programs

John Blenkinsop EXPERT RESPONSE FROM: John Blenkinsop

Pose a Question
Other iSeries 400 Categories
Meet all iSeries 400 Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 31 October 2005
I have a strange problem with a 15000 line RPG program in which all of the 99 indicators are used. I need at least one more indicator to use in the display file the program uses. I need to use that one in the display file to protect a field from updating.

>
15,000 line RPG programs shouldn't be allowed; there is always a better way. But I assume that this is a legacy program. If it is ILE, then it is disgraceful! You can condition a field in a display file without indicators. Create a field in the record format as a 'program-to-system' field ("P" in position 38, size 1 alpha character). Say the field is called P#CUST where the display field you want to control is called D#CUST. It would look like this:

 

        AAN01N02N03T.Name++++++RLen++TDpBLinPosFunction
        A            P#CUST         1A  P

Now add a DSPATR to the field you want to condition :

        AAN01N02N03T.Name++++++RLen++TDpBLinPosFunction
        A            D#CUST        11   B      DSPATR(&P#CUST)

In your program, create a hex value for each display attribute you want to use :

        C              BITON'25'     HXOGUS
Green underscore open
        C              BITON'02'     HXPGRN
Green normal protected

HXOGUS is Hex 24, HXPGRN is Hex A0. 

Now in your program when you want the field to be open for the user to change its value, set P#CUST to HXOGUS before you EXFMT (or WRITE/READ) the format. It will appear in green and underlined, and the user can change its value.

When you want to protect the field set P#CUST to HXCGRN. Now when you EXFMT the format the field will be in green, without underlines, and protected. No indicators have been used.

Read the OS/400 DDS Reference manual section on valid P-field values for a list of the hex values that are allowed in the program-to-system field.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
iSeries Application Development
Monitoring escape messages and using RCVMSG for diagnostic messages
Listing contents of multiple FTP directories on AS/400
Chain operation error after converting RPG3 to ILE RPG (RPGIV)
Space offset X'0015FF00' or X'0000000000000000' is outside current limit for object QIGC2424C
Searching fields for values
iSeries application display subfiles with other program windows
Searching part of a name or address in AS/400
Passing parameters in an ILE RPG module
What's happening to my subfile?
What happening to my subfile?

iSeries application development
System i Web app dev for free
iSeries Access for Web tutorial
iSeries Access for Web tutorial: system requirements
Managing ASF Tomcat settings
iSeries Access for Web tutorial: Creating the HTTP server
iSeries Access for Web tutorial: Configuring iSeries Access for Web
COMMON product round-up: Modernizing the IBM System i
Antiquated iSeries ERP module gets Web overhaul
An SOA call to arms
VoIP for iSeries now available
iSeries application development Research

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



iSeries Networking - Printing, Remote Access, TCP/IP
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts