Friday, September 21, 2007

AS/400 Control Language (CL)



The AS/400 control language (CL) is reminiscent of JCL and consists of an ever expanding set of command AS/400 object|objects (*CMD) used to invoke traditional AS/400 programs and/or get help on what those programs do. CL can also be used to create CL programs (congruent to Shell script|shell scripts) where there are additional commands that provide program-like functionality (GOTO, IF/ELSE, variable declaration, file input, etc.)

The vast majority of AS/400 commands were written by IBM developers to perform system level tasks like compiling programs, backing up data, changing system configurations, displaying system AS/400 object|object details, or deleting them. Commands are not limited to systems level concerns and can be drafted for user applications as well.

Commands and programs

Parameter (computer science)|Parameters (aka arguments) defined in the main procedures of all traditional AS/400 programs are hard coded lists that are be made up of parameters that can be numeric, alphanumeric, boolean, etc and the order in which Parameter (computer science)|parameters are passed is important. This is a stark difference from the Unix & DOS worlds where the parameter list in Unix Shell script|shell scripts and C programming language|C programs is a set or array of character pointers and more often than not the parameters are not positionally dependent.

The AS/400 developer's solution to this problem was the command AS/400 object|object (*CMD). While the parameters on the command can be specified in any order, each parameter is defined to be passed in a specific order to the program. The programmer can also define, among other things, the parameter's data type, unique parameter name, descriptive text (for prompting), default value (used only if the parameter isn't specified during execution), if the values are restricted to a certain set or range, if the data entered should be changed to another value before calling the program, etc.

At its most basic a command names a single program to call when the user types or prompts the command and presses the Enter key. The command takes all of the parameters typed by the user, and those not typed by the user, and builds a parameter list that it passes to the program when it's called.



Sample Code

The following is a sample of CL programming. The program interactively converts dates from julian to mdy and vice versa. Results are displayed on line 24 of the terminal. It accepts two parameters. The &IN parameter which is the date string to be converted. If a julian string it should be in the format yynnn where yy is the year number and nnn is the day number of the year. If a MDY string it must be in the format mmddyy. The second parameter is &TYP which is the type of date to be converted to. It must be 'J' (julian) or 'M' (mdy). For example: the command CALL PGM(ICVTDATC) PARM('04180' 'M') will convert the julian date 04180 to 062804 (June 28, 2004).




PGM PARM(&IN &TYP)

DCL VAR(&IN) TYPE(*CHAR) LEN(6)
DCL VAR(&OUT) TYPE(*CHAR) LEN(8)
DCL VAR(&TYP) TYPE(*CHAR) LEN(1)
DCL VAR(&MSG) TYPE(*CHAR) LEN(80)

IF COND(&TYP = J) THEN(DO)
CVTDAT DATE(&IN) TOVAR(&OUT) FROMFMT(*MDY) +
TOFMT(*JUL) TOSEP(*NONE)
ENDDO

IF COND(&TYP = M) THEN(DO)
CVTDAT DATE(&IN) TOVAR(&OUT) FROMFMT(*JUL) +
TOFMT(*MDY) TOSEP(*NONE)
ENDDO

CHGVAR VAR(&MSG) VALUE('IN=' || &IN || ' OUT=' || +
&OUT)
SNDPGMMSG MSG(&MSG)

ENDPGM

Retrieved from "http://csiwiki/index.php?title=AS/400_Control_Language"


Read more!

Thursday, September 20, 2007

RPG IV, a Modern Language


In 2001, with the release of OS/400 V5R1, RPG IV offered even greater freedom for calculations than offered by the Extended Factor-2 Calculation Specification: a free-format text-capable source entry, as an alternative to the original column-dependent source format. The "/FREE" calculation does not require the operation code to be placed in a particular column; the operation code is optional for the EVAL and CALLP operations; and syntax generally more closely resembles that of mainstream, general-purpose programming languages.

Today, RPG IV is a considerably more robust language. Editing can still be done via the simple editor or it can be edited via PC using IBM's Websphere Development Studio (a customized implementation of Eclipse). IBM is continually extending its capabilities and adding more built-in functions (BIFs). It has the ability to link to Java objects (See IBM's RPG Reference Manual [1] ), and i5/OS APIs; it can be used to write CGI programs with the help of IBM's Cgidev2[2]web toolkit, RPG xTools [3] CGILIB and other commercial Web enabled packages. Even with the changes it retains a great deal of backward compatibility, so an RPG program written 37 years ago could run today with little or no modification.

The OS/400 was later renamed i5/OS in correspondence with the new IBM System i branding initiative. The i5/OS V5R4 [4] (Version 5 Release 4) was released in January 2006 and is currently the latest version (as of August, 2007).


Read more!

RPG Language Evolution



RPG II was introduced with the System/3 series of computers. It was later used on System/32, System/34, and System/36, with an improved version of the language. International Computers Ltd also produced a version on its VME/K operating system

RPG III was created for the System/38 and its successor the AS/400 (a mid-range machine). RPG III significantly departed from the original language, providing modern structured constructs like IF-ENDIF blocks, DO loops, and subroutines.

DE/RPG or Data Entry RPG was exclusively available on the IBM 5280 series of data-entry workstations in the early 80s. It was similar to RPG III but lacking external Data Descriptions (DDS) to describe data(files) like on the System/38 and its successors. Instead, the DDS part had to be included into the RPG source itself.

RPG/400 with a much cleaner syntax, and tighter integration with the integrated database. This language became the mainstay of development on the AS/400, and its editor was a simple line editor with prompt templates for each specification (type of instruction).

RPG IV (aka RPGLE, aka RPG/ILE) was released in 1994 and the name, officially, was no longer an initialism. RPG IV offered a greater variety of expressions within its new Extended Factor-2 Calculation Specification.


Read more!

Wednesday, September 19, 2007

Overview and History of RPG


Overview


RPG (and RPG IV and RPGLE) is the mainstay programming language of the IBM iSeries platform. Originally designed as a query tool, IBM has enhanced the language to become a full-fledged, powerful programming language.

An RPG program typically starts off with a File Specification, listing all files being written to, read from or updated, followed by a Data Definition Specification containing program elements such as Data Structures and dimensional arrays (much like a "Working-Storage" section of a COBOL program or var statements in a C program). This is followed by the Calculation Specification, which contains the actual meat of the code. Output Specifications can follow which can be used to determine the layout of a report or the report can be defined externally.

In the early days of RPG, its major strength was known as the program cycle: every RPG program executes within an implied loop, which can apply the program to every record of a file. Alternately, the cycle can make an interactive program continue to run until explicitly stopped. Today, most RPG programmers avoid using the cycle in favor of controlling the flow of the program with standard looping constructs.

-------------------------------------------------------------------------------------

History




RPG is one of the few languages created for punch card machines that is still in common use today. This is because the language has evolved considerably over time. It was originally developed by IBM in the 1960s and ran on the popular IBM 1401. Originally, RPG was an acronym for Report Program Generator, descriptive of the purpose of the language: generation of reports from data files, including matching record and sub-total reports.


The alternative languages generally available at the time were either COBOL or BASIC: one verbose, the other a poor tool for development, so RPG became pre-eminent on IBM hardware.


RPG was further developed by IBM for their range of mainframe systems, especially the S/360 - as RPG II.


Because the language syntax was based on the plug-boards used to program unit record equipment, and the System/3 was initially developed as a successor to plug-board programmable unit record machines, RPG II was ported to the System/3, System/32, System/34, and System/36, while an improved version of the language, RPG III, was created for the System/38 and its successor the AS/400 (a mid-range machine, now evolved into the eServer iSeries) and became RPG/400 with a much cleaner syntax, and tighter integration with the integrated database. This language became the mainstay of development on the AS/400, and its editor was a simple line editor with prompt templates for each specification (type of instruction).


RPG III significantly departed from the original language, providing modern structured constructs like IF-ENDIF blocks, DO loops, and subroutines.


In 1994, RPG IV (aka RPGLE aka RPG/ILE) was released and the name, officially, was no longer an acronym. RPG IV offered a greater variety of expressions within its new Extended Factor-2 Calculation Specification.


In 2001, with the release of OS/400 V5R1, RPG IV offered even greater freedom for calculations than offered by the Extended Factor-2 Calculation Specification: a free-format text-capable source entry, as an alternative to the original column-dependent source format. The "/FREE" calculation does not require the operation code to be placed in a particular column; the operation code is optional for the EVAL and CALLP operations; and syntax generally more closely resembles that of mainstream, general-purpose programming languages.


Today, RPG IV is a considerably more robust language. Editing can still be done via the simple editor or it can edited via PC using IBM's Websphere Development Studio. IBM is continually extending its capabilities and adding more built-in functions (BIFs). It has the ability to link to Java objects (See IBM's RPG Reference Manual ), and OS/400 APIs; it can be used to write CGI programs with the help of IBM's free Cgidev2 web toolkit or other commercial packages. And yet, it retains a great deal of backward compatibility. So an RPG program written 20 years ago could run today with little or no modification

Retrieved from "http://csiwiki/index.php?title=Overview_and_History_of_RPG"


Read more!

The Application System/400 (AS/400)




The Application System/400 (AS/400), renamed to iSeries in 2000, further renamed to System i5 in 2006, is an IBM minicomputer for general business and departmental use, introduced in 1988 and still in production under the names iSeries and i5. The AS/400 is an object-based system with an integrated DB2 database that was designed to implement E. F. Codd's relational database model, which is based on Codd's 12 rules, in the operating system and hardware. All software necessary to run this computer is included and integrated. More than 2,500 business software applications were available when the first AS/400 was delivered in 1988. The AS/400 is well suited to a broad range of business, non-profit, and government applications, including back office, manufacturing, retail wholesale transportation, data base management, being an ISP. It is not a suitable platform for scientific number crunching or consumer applications.

The AS/400 was the result of the combination of the System/38 database machine (announced by IBM in October 1978 and delivered in August 1979) and the System/36. The first AS/400 systems (known by the development code names Silverlake and Olympic) were delivered in 1988, and the product line has been refreshed continually since then. IBM renamed the AS/400 to iSeries in 2000, as part of its e-Server branding initiative. The product line was further extended in 2004 with the introduction of the i5 servers, the first to utilize the IBM POWER5 processor. The AS/400 was the first general-purpose computer system to attain a C2 security rating from the NSA, and in 1995 was extended to employ a 64-bit processor and operating system. The architecture of the system allows for future implementation of 128-bit processors when they become available. Existing programs will utilize the new hardware without modification.


Features include an extremely fast DBMS, a menu-driven interface, multi-user support, terminals (IBM 5250) and printers, security, communications, client-server and web-based applications and an extensive library-based operating system, OS/400.


A big selling point is that applications can run without modification on any model in the product line, from small, single-processor machines up to those with 64 multi-core CPUs. For traditional business programming languages such as RPG, COBOL, C and SQL, it has support for external files, display files and object-based programming, which allows for increased programming productivity. It also supports Unix-like file directories, industry-leading support for Java, client-server technologies and a native Apache web server, for "modern" and GUI-style applications. IBM claims superior Total cost of ownership due to high system availability, which averages 99.98% uptime, and lower costs of administration and maintenance, when compared to Unix, Linux and Microsoft-based implementations.


The machine was originally based on a custom IBM CISC CPU which used a CPU architecture known as Internal MicroProgrammed Interface (IMPI) and an instruction set similar to the IBM 370. It was later migrated to a PowerPC-based RISC CPU family eventually known as RS64. The latest models are based on the POWER5 (announced 4 May 2004) processor.[1]


Here Debian is running natively on an iSeries Logical Partition.The machine survives because its instruction set (called TIMI for "Technology Independent Machine Interface" by IBM) allows the operating system and application programs to take advantage of advances in hardware and software without recompilation. This means that a program written and compiled on a S/38 can be run as a native 64-bit program. The HAL allows a system that costs $9000 to run exactly the same operating system and software as a $2 million system. The system can concurrently run multiple operating systems (i5/OS (OS/400), Linux, AIX) natively, and runs Windows Server and Linux on one or more single-CPU blade servers or externally-attached mutiple-CPU servers when installed. The 64-bit design provides for the seamless addressing of up to 16 exabytes (16 million terabytes) of storage.


The AS/400 enforces the use of the TIMI virtual instruction set for all user-mode programs; it is not possible for such programs to utilize the instruction set of the underlying CPU, thus ensuring hardware independence. This is conceptually somewhat similar to the virtual-machine architecture of programming environments such as SmallTalk, Java and .NET. The key difference is that it is embedded so deeply into the AS/400's design as to make all applications and even the bulk of its operating systems binary-compatible across different processor families. Note that, unlike other virtual-machine architectures in which the virtual instructions are interpreted at run-time, TIMI instructions are never interpreted. They constitute an intermediate compile-time step and are translated into the processor's instruction set as the final compilation step. The TIMI instructions are stored within the final program object, in addition to the executable machine instructions. This is how a program compiled on one processor family (e.g. CISC) can be moved to a new processor (e.g. PowerPC) without re-compilation. The program is saved from the old machine and restored onto the new machine, whereupon the OS discards the old machine instructions and re-translates the TIMI instructions into machine instructions for the new processor.


The AS/400's instruction set defines all pointers as 128-bit to allow seamless transition from older to new processor generations.


Another feature that was recently introduced to the AS/400, LPAR, came from IBM's mainframe line of computers. LPAR (Logical PARtitioning) facilitates running multiple instances of operating systems simultaneously on one AS/400 unit. A system setup with LPAR can even run different operating systems on different partitions while ensuring that one OS cannot run over the memory or resources of another. Each LPAR is given a portion of system resources (memory, hard disk space, and CPU time) via a system of weights that determines where unused resources are allocated at any given time. The OSes supported (and commonly used) under the LPAR scheme are OS/400, AIX and Linux. (Note: Currently Microsoft operating systems do not support Power-based processors.)


AS/400s are also capable of supporting mutiple instances of Linux, Microsoft Windows 2000 and Windows Server 2003, with either single-processor internal blade servers (IXS) or externally-linked mutiple-processor servers (IXA).


Even though AIX can now be natively run in an LPAR partition, the original implemenation was to allow AIX programs to be ported to the PASE environment. AIX programs ARE binary compatible with OS/400 when using OS/400's PASE (Portable Applications System Environment). PASE is essentially "an operating system within an operating system", supporting the most recent stable version of AIX. Binaries need to be re-compiled on the AIX system, with 16-bit (quadword) pointer alignment enabled. Once the program is compiled with this option, the executable can be FTP-ed to the AS/400, and executed under the PASE Korn Shell.


Additionally, tasks such as handling record locks and queuing updates are managed automatically by the system, making high-speed, multiuser applications easy to create and maintain, and extremely reliable.


Programming languages available for this machine include RPG, assembly language, C, C++, Java, COBOL, SQL, BASIC, PHP, PL/I, and REXX. Several CASE tools are available: Synon, AS/SET, Magic,and Lansa.

Commands in the Control Language (CL) are promptable and most provide cursor-sensitive help to make entering parameters easier. A command name consists of a three-letter verb and a subject part, also referred to as a noun. Some command names provide a "modifier" as well. This is intended to make it easy to understand CL code. Examples:

CRTUSRPRF - Create (verb) user (modifier) profile (noun) DLTLIB - Delete (verb) library (noun) CPYF - Copy file WRKACTJOB - Work with Active Jobs The AS/400 was designed as the successor of the IBM System/38 and the IBM System/36. The programmers who worked on OS/400, the operating system of the AS/400, did not have a UNIX background. Dr. Frank Soltis, the head architect, says that this is the main difference between this and any other operating system.


Despite the lack of a "UNIXy" background, the AS/400 has, over the years, picked up the programming/runtime model found on UNIX, Linux, and PC systems. Traditional AS/400 programming is a "one-stop shop", where a programmer writes computer code, compiles the code, and then executes the code. There is no link step that is found in other environments.


However, in 1995, that changed. IBM re-christened the one-stop shop programming style "OPM" (for Original Programming Model) and introduced a new language paradigm called "ILE" (for Integrated Language Environment). ILE had significant enhancements over OPM, including the ability to create modules (similar to .obj or .lib files), and then bind (link) the modules together into a single executable. The executable could be created as a program or a service program (service programs are similar to .lib or .dll files).


The real power of the ILE environment is in the "integrated" aspect, however. Modules in ILE-compliant languages (RPG, COBOL, C, C++, and CL) could be created and bound together. For the first time, AS/400 programmers could exploit the strengths of multiple ILE-compliant languages in a single program. Also, with the introduction of service programs, standard routines could be externalized more easily, and modularity increased. To ensure proper migration to the ILE environment, OPM RPG and COBOL programs could be migrated to ILE easily.


Interoperation with the Java language is also supported, though not as tightly as with the ILE languages. The iSeries Java implementation is distinguished by the depth of its embedment in the operating system.


iSeries servers also support common client-server-based technologies such as ODBC and JDBC for accessing its database from client-based software, created with languages such as Java, Microsoft Visual Studio .NET and other languages.


Read more!

The RPG for Scroll Bar & Mouse






*************************************************************
FGCKFM CF E WORKSTN
F SFILE(SFLA:RRNA)
FGCKF UF A E DISK INFDS(INFDS)
FGCKFL1 IF E K DISK Rename(RGCKF:RGCKF1)
F INFDS(DB1) BLOCK(*NO)
FGCKFL2 IF E K DISK Rename(RGCKF:RGCKF2)
F INFDS(DB2) BLOCK(*NO)
FGCKFL3 IF E K DISK Rename(RGCKF:RGCKF3)
F INFDS(DB3) BLOCK(*NO)
* ..................................................
D Col# S 1 0
D CTL1Saved S Like(CTL1)
D CTL2Saved S Like(CTL2)
D ColSaved S Like(Col#)

* INFDS for database file. FileSize will contain the number
* of records in the file when the file is opened.
DINFDS DS
D FILESIZE 156 159B 0

* Get the record Number, to know which record to update/process:
D DB1 DS
D DB1RRN 397 400B 0
D DB2 DS
D DB2RRN 397 400B 0
D DB3 DS
D DB3RRN 397 400B 0
* ..................................................
DRecordDataDS E DS ExtName(GCKF)
D SavedData S Like(RecordDataDs)
D ChangedData S Like(SavedData)
D CheckData S Like(SavedData)
* ..................................................
DRecord4 DS
D GNNAME
D RecNbr
D Data 300

D AR4 S 400 Dim(3000)
* ..................................................

* If file is empty:
C FILESIZE IFLE *ZEROS
C Clear RecNbr
C EXSR AddFixSR
C Else
C Z-ADD 1 RRN 4 0
C Z-ADD 1 RRNA

C If Col#=ColSaved and
C CTL1=CTL1Saved and
C CTL2=CTL2Saved
C Write FMT01
C Else
C Eval ColSaved=Col#
C Eval CTL1Saved=CTL1
C Eval CTL2Saved=CTL2

* Clear subfile & screen, prepare to re-fill or fill:
C Eval *IN90=*OFF
C Clear SFLA
C Write FOOTR
C Write FMT01

* Show Partial note, or not:
C IF CTL1=1
C Eval *IN42=*ON
C Else
C Eval *IN42=*OFF
C End

C Select
C When Col#=1
C Exsr FillSFL1
C
C When Col#=2
C Exsr FillSFL2
C
C When Col#=3
C Exsr FillSFL3
C
C When Col#=4
C Exsr FillSFL4
C EndSL
C EndIf
C
**
C RRNA IFGT 17
C MOVE *ON *IN91
C END
C Z-ADD RRNA NBRREC
C MOVE *ON *IN90
C WRITE FOOTR
C EXFMT FMT01
C Read Footr

C Select
C When *INKC=*ON
C Eval *INLR=*ON

* Was a column heading clicked?
C When CURFLD = 'COL1 ' or
C CURFLD = 'COL2 ' or
C CURFLD = 'COL3 ' or
C CURFLD = 'COL4 '
C Eval *IN31=*OFF
C Eval *IN32=*OFF
C Eval *IN33=*OFF
C Eval *IN34=*OFF
c Select
C When CURFLD = 'COL1 '
C Eval Col# = 1
C Eval *IN31=*ON

C When CURFLD = 'COL2 '
C Eval Col# = 2
C Eval *IN32=*ON

C When CURFLD = 'COL3 '
C Eval Col# = 3
C Eval *IN33=*ON

C When CURFLD = 'COL4 '
C Eval Col# = 4
C Eval *IN34=*ON

C EndSL

* Footer Push button Choices:
* Settings
C When F1=2
C
* Issue key:
C When F1=3
C Exsr IssueSR
* Add Key :
C When F1=4
C Clear RecNbr
C Exsr ADDFIXSR
* Exit
C When F1=5
C Eval *INLR=*ON
C
* If a choice was made, then do the required action:
C When RRNA>*ZEROS
C RRNA CHAIN SFLA 54
C EXSR ADDFIXSR

* Do either the maintain window or the note window:(PushButton 2)
C When PB2=1
C EXSR ADDFIXSR
C When PB2=2
C EXSR ADDFIXSR
C When PB2=3
C EXSR IssueSR

C EndSL
C END

* ________________________________________________________
* Add or Fix a record:
C AddFixSR BegSR
C If RecNbr > *zeros
C RecNbr Chain (N) GCKF
C Movel RecordDataDS Saveddata
C Else
C Clear FMT05
C End

C EXFMT FMT05
* If accepted:
C If NOT *INKC and NOT *INKL

C If RecNbr > *zeros
C Movel RecordDataDS ChangedData
C RecNbr Chain GCKF
C Movel RecordDataDS CheckData

C If CheckData = SavedData
C Movel ChangedData RecordDataDS
C Update(E) RGCKF
C Else
* send a mesage: the record wa changed at another work station
C End

C Else
C Write (E) RGCKF
C End

C End

C ENDSr
* _____________________________________________________________
C IssueSR BegSR
* Get name to use:

C Clear FMT05
C Exsr AddFixSR

C EndSR
* _____________________________________________________
C AddKeySR BegSR
* Get name to use:

C Clear FMT05
C Exsr AddFixSR

C EndSR
* _____________________________________________________
C SettingSR BegSR
C EndSR
* _____________________________________________________
C *INZSR BegSR
C Eval Col# = 2
C Eval *IN32=*ON
C Eval CTL1=1
C Eval CTL2=1
C Eval PB2=2

C EndSR
* ____________________________________________________________
* Write the line(s) in the subfile:
C WriteLineSR BegSR

C Movel GCKNOTE PNNO
* Show Name as pink if "!", or not:
C Eval *IN41=*Off
C If CTL2=1
* If first character of Note is "!" then turn the name pink:
C Movel GCKNOTE Test1 1
C If Test1 = '!'
C Eval *IN41=*On
C End

C Movel GCKNOTE PNNO
* Show Name as pink if "!", or not:
C Eval *IN41=*Off
C If CTL2=1
* If first character of Note is "!" then turn the name pink:
C Movel GCKNOTE Test1 1
C If Test1 = '!'
C Eval *IN41=*On
C End
C End

* Get name(s), if key(s) issued:
C WRITE SFLA
C ADD 1 RRN
C Z-ADD RRN RRNA

C EndSR
* ____________________________________________________________
* Logical on Name:
C FillSFL1 BegSR
* This uses the array filled earlier. "I" is the number of elements.
C SORTA AR4
C 3000 Sub I J 4 0
C J DOUGT 3000
C If AR4(J)>*Blanks
C MOVEL AR4(J) Record4
C MoveL Data RecordDataDS
C EXSR WriteLinesr
C END
C Eval J=J+1
C END

C EndSR
* _________________________________________________________________
* Logical on Key #
C FillSFL2 BegSR
C *LoVal Setll RGCKF1
C READ RGCKF1 58

* prepare an array so that a request for an alph listing will work:
C Move *Blanks AR4
C Z-Add 0 I 4 0

C* Fill the subfile:
C *IN58 DOWEQ *OFF
C Z-Add DB1RRN RecNbr
C EXSR WriteLinesr
* fill array:
C If GNNAME>*Blanks
C Eval I=I+1
C MoveL RecordDataDS Data
C Movel Record4 AR4(I)
C END

C READ RGCKF1 58
C END

C EndSR
* _________________________________________________________________
* Logical on Hook #:
C FillSFL3 BegSR
C *LoVal Setll RGCKF2
C READ RGCKF2 58
C* Fill the subfile:
C *IN58 DOWEQ *OFF
C Z-Add DB2RRN RecNbr
C EXSR WriteLinesr
C READ RGCKF2 58
C END

C EndSR
* _________________________________________________________________
* Logical on Building & door:
C FillSFL4 BegSR
C *Loval Setll RGCKF3
C READ RGCKF3 58
C* Fill the subfile:
C *IN58 DOWEQ *OFF
C Z-Add DB3RRN RecNbr
C EXSR WriteLinesr
C READ RGCKF3 58
C END

C EndSR
* _________________________________________________________________




DDS for the Scroll Bar & Mouse (Display file source code)

A*
A*%%EC
A DSPSIZ(27 132 *DS4)
A REF(*LIBL/GCKFL1 RGCKF)
A CHGINPDFT(HI UL)
A ERRSFL
A CF03(03 'Exit')
A CF12(12 'Exit')
A MOUBTN(*ULD ENTER)
A R SFLA SFL

A GNNAME R O 6 3
A 41 COLOR(PNK)
A GCKKEY# R O 6 34
A GCKHOOK# R O 6 45
A GCKBLDG R O 6 56
A GCKDOOR# R O 6 77
A RECNBR 5S 0O 6 89
A** PNNO 40A O 6 89
A PNNO 30A O 6 99
A N42 DSPATR(ND)
A GCKNOTE R H
A** RECNBR 5S 0H
A R FMT01 SFLCTL(SFLA)

A SFLPAG(0015)
A RTNCSRLOC(&CURREC &CURFLD)
A SFLSIZ(&NBRREC)
A OVERLAY
A SFLCSRRRN(&RRNA)
A 90 SFLDSP
A 90 SFLDSPCTL
A N90 SFLCLR
A 91 SFLEND(*SCRBAR *MORE)
A 1 3DATE
A EDTCDE(Y)
A 2 3TIME
A 1 79' Selection Criteria for this scr-
A een: '
A DSPATR(UL)
A COLOR(BLU)
A 1 34' Key Cabinets'
A COLOR(WHT)
A PB1 2Y 0B 2 80MLTCHCFLD
A CHOICE(1 'Show partial >note')
A CHCCTL(1 &CTL1)
A CHOICE(2 'Show ! as >pink')
A CHCCTL(2 &CTL2)
A CTL1 1Y 0H
A CTL2 1Y 0H
A PB2 2Y 0B 2105SNGCHCFLD
A CHOICE(1 'Maintain Note ')
A CHOICE(2 'Maintain Record')
A CHOICE(3 'Issue Key ')
A COL1 30A B 5 3DFTVAL('Name -
A ')
A DSPATR(UL)
A DSPATR(PR)
A N31 COLOR(BLU)
A 31 COLOR(GRN)
A COL2 10A B 5 34DFTVAL('Key # ')
A DSPATR(UL)
A DSPATR(PR)
A N32 COLOR(BLU)
A 32 COLOR(GRN)
A COL3 10A B 5 45DFTVAL('Hook # ')
A DSPATR(UL)
A DSPATR(PR)
A N33 COLOR(BLU)
A 33 COLOR(GRN)
A COL4 31A B 5 56DFTVAL('Door # ')
A DSPATR(UL)
A DSPATR(PR)
A N34 COLOR(BLU)
A 34 COLOR(GRN)
A 5 88'Comment... (First characters only)-
A '
A COLOR(BLU)
A DSPATR(UL)
A N42 DSPATR(ND)
A RRNA 5S 0H
A NBRREC 5S 0P
A CURREC 10A H
A CURFLD 10A H
A R FOOTR

A 24 3' -
A -
A -
A '
A DSPATR(UL)
A COLOR(BLU)
A F1 2Y 0B 26 10PSHBTNFLD
A DSPATR(PC)
A PSHBTNCHC(1 '>Enter' ENTER)
A PSHBTNCHC(2 '>Settings' ENTER)
A PSHBTNCHC(3 '>Add Key' ENTER)
A PSHBTNCHC(4 'E>xit' CF03)
A R FMT02

A WINDOW(*DFT 12 45 *NOMSGLIN)
A TEXT('Key Cabinet')
A BLINK
A OVERLAY
A WDWTITLE((*TEXT ' Maintain Key Reco-
A rd '))
A GCKKEY# R B 1 1
A GCKHOOK# R B 2 1CHECK(LC)
A GCKBLDG R B 3 1CHECK(LC)
A GCKDOOR# R B 3 21CHECK(LC)
A GCKNOTE R B 5 1CHECK(LC)
A CNTFLD(043)
A F2 2Y 0B 12 3PSHBTNFLD
A PSHBTNCHC(1 'Cancel' CF12)
A PSHBTNCHC(2 'Accept')
A 1 13'Key Number'
A 2 13'Hook Number'
A** 3 13'Door Number'
A R FMT03

A WINDOW(*DFT 8 45 *NOMSGLIN)
A TEXT('Maintain Notes ')
A BLINK
A OVERLAY
A* WDWTITLE((*TEXT ' Sample ') *BOTTOM)
A* WDWTITLE((*TEXT ' Top ') *TOP)
A WDWTITLE((*TEXT ' Maintain Notes '))
A GCKNOTE R B 1 1CNTFLD(043)
A CHECK(LC)
A F3 2Y 0B 8 3PSHBTNFLD
A PSHBTNCHC(1 'Cancel' CF12)
A PSHBTNCHC(2 'Accept')


thank you Booth Martin.


Read more!