Window Subfile:
Overview:
This module enables the student to understand the concept of Window Subfile.
Outline:
Topics covered,
· Kew
words used for Window Subfile.
- How
to design Window subfile
- CL
commands related to Window subfile
- Code
for Window subfile
Objective:
By the end of this module, the student should be
able to:
· Understand
the concept of Kew words used for Window Subfile.
- Understand
how to design Window subfile
- Understand
CL commands related to Window
subfile
- Understand
code for Window subfile
Windows Subfile
Physical File:
Columns
. . . : 1 71
Edit
PB01U01D/MYDDS
SEU==>
WINSFP
FMT PF
.....A..........T.Name++++++RLen++TDpB......Functions++++++++++++++++++
*************** Beginning of data
*************************************
0001.00 A
R EMPR
0002.00 A EMPNO 4S
0003.00 A EMPNAM 10A
0004.00 A EMPADD 25A
0005.00 A EMPSAL 6S
0006.00 A
K EMPNO
****************** End of data
****************************************
F3=Exit
F4=Prompt F5=Refresh F9=Retrieve
F10=Cursor F11=Toggle
F16=Repeat find F17=Repeat change F24=More keys
(C)
COPYRIGHT IBM CORP. 1981, 2002.
RPG
Columns . . . : 1 71 Edit PB01U01S/MYRPG
SEU==> WINRPG1
FMT FX .....FFilenameIPEAF........L..I........Device+......KExit++Entry+A....U
*************** Beginning of data *************************************
0001.00 FWINSFP IF E K DISK
0002.00 FWINDSP CF E WORKSTN
0003.00 F @RRN KSFILE WIN1
0004.00 C***************************************************************
0005.00 C *IN03 DOWEQ*OFF
0006.00 C EXFMTEMP1
0007.00 C *IN01 IFEQ *ON
0008.00 C EXSR CLRSR
0009.00 C EXSR LDSR
0010.00 C @RRN IFGT 0
0011.00 C SETON 50
0012.00 C ELSE
0013.00 C SETOF 50
0014.00 C ENDIF
0015.00 C SETON 5153
0016.00 C EXFMTWIN2
0017.00 C EXSR OPTSR
0018.00 C ENDIF
0019.00 C ENDDO
0020.00 C SETON LR
0021.00 C**************************************************************
0022.00 C*SUBROUTINES
0023.00 C CLRSR BEGSR
0024.00 C SETON 52
0025.00 C WRITEWIN2
0026.00 C SETOF 52
0027.00 C Z-ADD0 @RRN 40
0028.00 C ENDSR
0029.00 C******
0030.00 C LDSR BEGSR
0031.00 C *LOVAL SETLLEMPR
0032.00 C READ EMPR 90
0033.00 C *IN90 DOWEQ*OFF
0034.00 C MOVE EMPNO EMPNO1
0035.00 C ADD 1 @RRN
0036.00 C WRITEWIN1
0037.00 C READ EMPR 90
0038.00 C ENDDO
0039.00 C ENDSR
0040.00 C*******
0041.00 C OPTSR BEGSR
0042.00 C READCWIN1 50
0043.00 C *IN50 DOWEQ*OFF
0044.00 C OPT IFEQ 'Y'
0045.00 C EMPNO1 CHAINEMPR 80
0046.00 C *IN80 IFEQ *OFF
0047.00 C MOVE EMPNO EMPNO1
0048.00 C ENDIF
0049.00 C ENDIF
0050.00 C READCWIN1 50
0051.00 C ENDDO
0052.00 C ENDSR
***************EOF*******
F3=Exit F4=Prompt F5=Refresh F9=Retrieve F10=Cursor F11=Toggle
F16=Repeat find F17=Repeat change F24=More keys
(C) COPYRIGHT IBM CORP. 1981, 2002.
JPC TECHNOLOGIES
EMPLOYEE DETAILS
EMPLOYEE NUMBER => 9999-
EMPLOYEE NAME => BBBBBBBBBB
EMPLOYEE ADDRESS => BBBBBBBBBBBBBBBBBBBBBBBBB
EMPLOYEE SALARY => 999999-
F3=EXIT F1=HELP
Working with Window Subfile:
Work with Display Records
File . . . . . . : MYRPG Member . . . . . . : WINDSP1
Library . . . . : PB01U01S Source type . . . : DSPF
Type options, press Enter.
1=Add 2=Edit comments 3=Copy 4=Delete
7=Rename 8=Select keywords 12=Design image
Opt Order Record Type Related Subfile Date DDS Error
1
10 EMP1 RECORD 03/29/05
Bottom
F3=Exit F12=Cancel F14=File-level keywords
F15=File-level comments F17=Subset F24=More keys
Image updated for record EMP1.
Add a new record:
Give name for the Subfile Record.
Type for Window Subfile is WDWSFL.
Add New Record
File . . : MYRPG Member . . : WINDSP1
Library : PB01U01S Source type : DSPF
Type choices, press Enter.
New record . . . . . . WIN1 Name
Type . . . . . . . . . WDWSFL RECORD, USRDFN
SFL, SFLMSG
WINDOW, WDWSFL
PULDWN, PDNSFL
MNUBAR
F3=Exit F5=Refresh F12=Cancel
Give name for the Subfile Control Record.
Add New Record
File . . . . . . : MYRPG Member . . . . . . : WINDSP1
Library . . . . : PB01U01S Source type . . . : DSPF
Type choices, press Enter.
New record . . . . . . . . . . . . . . . WIN1 Name
Type . . . . . . . . . . . . . . . . . . WDWSFL RECORD, USRDFN
SFL, SFLMSG
WINDOW, WDWSFL
PULDWN, PDNSFL
MNUBAR
Subfile control record . . . . . . . . . WIN2 Name
F3=Exit F5=Refresh F12=Cancel
Subfile Keywords:
Select Subfile
Keywords
Subfile record . . . . . . : WIN1
Type choices, press Enter
Y=Yes
General keywords . . . . . . . . Y
Indicator keywords . . . . . . . Y
TEXT keyword
. . . . . . . . . .
F3=Exit
F4=Display Selected Keywords
Subfile General Keywords:
Select General
Keywords
Subfile record . . . . . . : WIN1
Type choices, press Enter.
Keyword Y=Yes Indicators/+
Return this record
on read next changed . . . SFLNXTCHG
Write this record to the job log -LOGOUT
Write this record to the job log -LOGINP
Keep records on display
when closing the file . . . . . KEEP
Allow blanks . . . . . . . . . . CHECK(AB)
Move cursor right to left . . . CHECK(RL) Change input defaults . . . . . CHGINPDFT
Select parameters . . . . . . . . . . .
F3=Exit F12=Cancel
Subfile Indicator Keywords:
Define Indicator
Keywords
Subfile record . . . . . . . : WIN1
Type keywords and parameters, press
Enter.
Keywords:
INDTXT SETOF CHANGE
Keyword
Indicator Text
Bottom
F3=Exit
F12=Cancel
Window Keywords:
Select Window
Keywords
Window record . . . . . . . . . . . . . : WIN2
Type choices, press Enter.
Y=Yes
General keywords . . . . . . . . Y
Select record keywords . . . . .
Y
General SFLCTL keywords . . . . . Y
Subfile display layout . . . . .
Y
Subfile messages . . . . . . . . Y
TEXT keyword
. . . . . . . . . .
F3=Exit
F4=Display Selected Keywords
F12=Cancel
Window
General Keywords:
Window
parameters :Type Y (Yes) in the Select parameters prompt to change the
window
border parameters on the Define Window Border Parameters display.
Window
borders: A Y (Yes) is displayed next to
the WDWBORDER keyword to indicate that you have defined the window border
parameters.
Select General Keywords
Window record . . . . . . . . . . . . . : WIN2
Type choices, press Enter.
Keyword Y=Yes Indicators/+
Window parameters . . . . . . . . . . . . WINDOW
Y
Select parameters . . . . . . . . . . . Y
Window borders . . . . . . . . . . . . .
. WDWBORDER y
Select parameters . . . . . . . . . . . Y
Remove windows . . . . . . . . . . . . .
. RMVWDW
User Restore Display . . . . . . . . . .
. USRRSTDSP
F3=Exit
F12=Cancel
Define
Window Parameters:
Start line: The location of the starting
line of the window record.
Start position: The location of the
starting position of the window record.
Window lines: The number of rows to display
in the window.
Window position: The number of columns to
display in the window.
Define Window
Parameters
Record . . . : WIN2
Keyword
. . : WINDOW
Referenced window . . . . . . . . . . . . Name
-OR-
Window definition
Default start positioning . . . . . . . Y=Yes
-OR-
Start line
Program-to-system field . . . . . . . Name
Actual line . . . . . . . . . . . . . 4 1-25
Start position
Program-to-system field . . . . . . . Name
Actual position . . . . . . . . . . . 40 1-128
Window lines . . . . . . . . . . . . .
. 15
1-25
Window position . . . . . . . . . . . . 35 1-128
Message line . . . . . . . . . . . . .
. Y Y=Yes
Restrict cursor to window . . . . . . . Y Y=Yes
F3=Exit
F12=Cancel
Window
Border Parameters:
Color: Type Y (Yes) in the Define
parameters prompt to add or change values for the color parameter on the Select
Border Color display. A Y (Yes) is
displayed on the first line to indicate that you have defined the color
parameter. If you remove the Y, the value defined for the
color parameter is removed.
Display Attributes: Type Y (Yes) in the
Define parameters prompt to add or change values for the display attributes
parameter on the Select Border Display Attributes display. A Y (Yes) is displayed on the first line to
indicate that you have defined the display attributes parameter. If you remove the Y, the values defined for
the display attributes parameter are removed.
Border
Characters: Type Y (Yes) in the Define parameters prompt to add or change
values for the border characters parameter on the Select Border characters
display. A Y (Yes) is displayed on the
first line to indicate that you have defined the border characters parameter.
Define Window Border
Parameters
Record . . . : WIN2
Keyword
. . : WDWBORDER
Keyword
number Roll
1 of
1 +/-
F4 for list
Indicators/+ . . . . . . . . . . . . . . . . .
. .
Color. . . . . . . . . . . . . . . . . . . . .
. . Y Y=Yes
Define parameters . . . . . . . . . . . . . . . Y Y=Yes
Display attributes . . . . . . . . . . . . . .
. . Y Y=Yes
Define parameters . . . . . . . . . . . . . . . Y Y=Yes
Border Characters . . . . . . . . . . . . . . . . Y
Y=Yes
Define parameters . . . . . . . . . . . . . . . Y Y=Yes
F3=Exit
F12=Cancel
Border
Color:
Select Border
Color
Record . . . : WIN2
Keyword
. . : WDWBORDER
Keyword number
1 of 1
Type choices, press Enter.
Colors:
COLOR Y=Yes
Blue . . . . . . . . . . . . . . . . . . . .
. . BLU
Green
. . . . . . . . . . . . . . . . . . . . . GRN
Pink . . . . . . . . . . . . . . . . . . . .
. . PNK Y
Red .
. . . . . . . . . . . . . . . . . . . . .
RED
Turquoise
. . . . . . . . . . . . . . . . . . .
TRQ
White
. . . . . . . . . . . . . . . . . . . . . WHT
Yellow . . . . . . . . . . . . . . . . . . .
. . YLW
F3=Exit
F12=Cancel
Border Display Attributes:
Select Border Display
Attributes
Record . . . : WIN2
Keyword
. . : WDWBORDER
Keyword number
1 of 1
Type choices, press Enter.
Display attributes: DSPATR Y=Yes
High intensity . . . . . . . . . . . . . . .
. . HI
Reverse image . . . . . . . . . . . . . . . . . RI
Column separators . . . . . . . . . . . . . . . CS
Blink
. . . . . . . . . . . . . . . . . . . . . BL
Y
Nondisplay . . . . . . . . . . . . . . . . .
. . ND
Underline
. . . . . . . . . . . . . . . . . . . UL
F3=Exit
F12=Cancel
Border
Characters:
Select Border
Characters
Record . . . : WIN2
Keyword
. . : WDWBORDER
Keyword number
1 of 1
Type choices, press Enter.
Positions
CHARACTERS
Top-left-corner . . . . . . . . . . . . . . . . .
Top-border . . . . . . . . . . . . . . . . .
. . .
Top-right-corner . . . . . . . . . . . . . .
. . .
Left-border
. . . . . . . . . . . . . . . . . . :
Right-border . . . . . . . . . . . . . . . .
. . :
Bottom-left-corner . . . . . . . . . . . . .
. . :
Bottom-border . . . . . . . . . . . . . . . . . .
Bottom-right-corner . . . . . . . . . . . . . . :
F3=Exit
F12=Cancel
Record
Keywords:
Select Record Keywords
Record . . . : WIN2
Type choices, press Enter.
Y=Yes
General keywords . . . . . . . . Y
Indicator keywords . . . . . . . Y
Application help . . . . . . . . Y
Help keywords . . . . . . . . . . Y
Output keywords . . . . . . . . . Y
Input keywords . . . . . . . . . Y
Overlay keywords . . . . . . . . Y
Print keywords . . . . . . . . . Y
ALTNAME keyword . . . . . . . . .
TEXT keyword
. . . . . . . . . .
F3=Exit
F4=Display Selected Keywords
F12=Cancel
Record
General Keywords:
Select General
Keywords
Record . . . : WIN2
Type choices, press Enter. Keyword Y=Yes
Keep record on display . . . . . . . . . . .
. . . KEEP
Assume record is on display . . . . . . . . . . . ASSUME
Retain CLEAR HELP HOME and ROLL keys . . . .
. . . RETKEY
Retain command function (CFnn and CAnn) keys
. . . RETCMDKEY
Change input defaults . . . . . . . . . . . . . . CHGINPDFT
Select parameters . . . . . . . . . . . . . . .
Menu-Bar display . . . . . . . . . . . . . .
. . . MNUBARDSP
Select parameters . . . . . . . . . . . . . . .
Entry field attribute . . . . . . . . . . . . . . ENTFLDATR
Select parameters . . . . . . . . . . . . . . .
Return cursor location . . . . . . . . . . .
. . . RTNCSRLOC
Select parameters . . . . . . . . . . . . . . .
F3=Exit
F12=Cancel
Record
Indicator Keywords:
Define Indicator
Keywords
Record . . . : WIN2
Type keywords and parameters, press
Enter.
Conditioned keywords: CFnn CAnn CLEAR PAGEDOWN/ROLLUP
PAGEUP/ROLLDOWN
HOME HELP
HLPRTN
Unconditioned keywords: INDTXT VLDCMDKEY SETOF CHANGE
Keyword
Indicators/+ Resp Text
Bottom
F3=Exit
F12=Cancel
Record
Application Help:
Define Application
Help
Record
. . . : WIN2
Help number
. . . . . . . . :
1 of 1
Next help number . . . . . . Number
Type choices, press Enter. Keyword
Help text in record . . . .
HLPRCD
Y=Yes
-- OR --
Help text in document . . .
HLPDOC
Y=Yes
Indicators . . . . . . . .
Record or document . . . . Name
File . . . . . . . . . . . Name
Library
. . . . . . . . Name, *LIBL,
*CURLIB
HLPDOC label . . . . . . . Name
HLPDOC folder . . . . . .
Help boundary . . . . . . . HLPBDY Y=Yes
Indicators . . . . . . . .
Define help area . . . . . . HLPARA Y=Yes
F3=Exit F9=Select HLPPNLGRP keyword Bottom
F12=Cancel
HELP indicator keyword is required.
Record Help Keywords:
Define Help
Keywords
Record . . . : WIN2
Type choices, press Enter.
Keyword
Clear previous help text records . .
HLPCLR Y=Yes
Indicators
. . . . . . . . . . . .
Sequence of help text records: HLPSEQ
Help group name . . . . . . . . . . Name
Help sequence number . . . . . . . 0-99
Return command key from help . . . .
HLPCMDKEY Y=Yes
Define help title . . . . . . . . . . HLPTITLE Y=Yes
F3=Exit
F12=Cancel
Record Output
Keywords:
Select Output
Keywords
Record . . . : WIN2
Type choices, press Enter. Keyword Y=Yes
Indicators/+
Blink cursor
. . . . . . . . . . . BLINK
Sound the alarm . . . . . . . . . . ALARM
Sound alarm on messages . . . . . . MSGALARM
Do not unlock keyboard . . . . . .
LOCK
Write record to job log . . . . . . LOGOUT
Invite devices for later read . . . INVITE
Allow graphics . . . . . . . . . . ALWGPH
Put data before buffer is full . .
FRCDTA
Hidden fields with
cursor position for output: CSRLOC
Row number . . . . . . . . . . Name
Column number . . . . . . . . . Name
F3=Exit
F12=Cancel
Record Input
Keywords:
Select Input
Keywords
Record . . . : WIN2
Type choices, press Enter.
Keyword Y=Yes Indicators/+
Write record to job log . . . . . . . . .
. LOGINP
Unlock keyboard after input operation . .
. UNLOCK
Erase input capable fields . . . . . . . *ERASE
Reset all modified data tags . . . . . . *MDTOFF
If UNLOCK, retain data on display . . . .
. GETRETAIN
Retain LOCK status on next read . . . . .
. RETLCKSTS
Allow blanks in input fields . . . . . . . CHECK(AB)
Move cursor right to left . . . . . . . .
. CHECK(RL)
Return same input data on next read . . .
. RTNDTA
F3=Exit
F12=Cancel
Record Overlay Keywords:
Select Overlay
Keywords
Record . . . : WIN2
Type choices, press Enter.
Keyword Y=Yes Indicators/+
Roll
Overlay without erasing . . . . . .
OVERLAY Y
Retain data on re-display . . . . .
PUTRETAIN
Protect all input fields . . . . . . PROTECT
Activate OVRDTA and OVRATR . . . . . PUTOVR
Override Data . . . . . . . . . . . OVRDTA
Override Attribute . . . . . . . . . OVRATR
Initialize input fields . . . . . .
INZINP
Reset
all modified data tags . . . .
MDTOFF
MDTOFF parameter . . . . . . . . . *UNPR
*ALL
Erase all input fields . . . . . . . ERASEINP
ERASEINP parameter . . . . . . . . *MDTON
*ALL
Erase all records below . . . . . .
ERASE
F3=Exit
F12=Cancel
Print Keywords:
Define Print
Keywords
Record . . . : WIN2
Type choices, press Enter.
Keyword
Enable keyword . . . . . . . . . . PRINT Y=Yes
Indicators . . . . . . . . . . .
Program handles print:
Response indicator . . . . . . . 01-99
Text . . . . . . . . . . . . . .
System handles print:
Print file . . . . . . . . . . . Name, *PGM
Library
. . . . . . . . . . . Name,
*LIBL, *CURLIB
F3=Exit
F12=Cancel
General Keywords:
Define General
Keywords
Subfile control record . . . . . . . . .
: WIN2
Type choices, press Enter. Keyword
Related subfile record . . . . . . . SFLCTL
WIN1 Name
Subfile cursor relative record . . . SFLCSRRRN Name
Subfile mode . . . . . . . . . . . . SFLMODE Name
Y=Yes Indicators/+
Display subfile records . . . . . .
SFLDSP Y 50
Display control record . . . . . . . SFLDSPCTL
Y 51
Initialize subfile fields . . . . .
SFLINZ
Delete subfile area . . . . . . . . SFLDLT
Clear subfile records . . . . . . . SFLCLR 52
Indicate more records . . . . . . . SFLEND 53
SFLEND parameter . . . . . . . . *MORE
SFLEND parameter . . . . . . . . *SCRBAR *MORE ...
Record not active . . . . . . . . . SFLRNA
More...
F3=Exit
F12=Cancel
Display Layout:
Define Display Layout
Subfile control record . . . . . . . . .
: WIN2
Type values, press Enter.
Keyword
Number
Records in subfile . . . . . . . . . . SFLSIZ
10
Program-to-system field . . . . . .
Records per display . . . . . . . . . SFLPAG
4
Spaces between records . . . . . . . . SFLLIN
F3=Exit
F12=Cancel
Subfile Messages:
Define Subfile
Messages
Subfile control record . . . . . . . . .
: WIN2
Type values, press Enter.
Indicators/+ SFLMSG - Message Text More Ind
Bottom
Indicators/+ SFLMSGID
File Library Ind
Name
Bottom
F3=Exit
F12=Cancel
Work with Display Records:
Work with Display
Records
File .
. . . . . : MYRPG Member . . . . . . : WINDSP1
Library . . . . : PB01U01S Source type . . . :
DSPF
Type options, press Enter.
1=Add 2=Edit comments 3=Copy 4=Delete
7=Rename 8=Select keywords 12=Design image
Opt
Order Record Type Related Subfile Date
DDS Error
10
EMP1 RECORD 03/29/05
20
WIN1 SFL 03/29/05
12
30 WIN2 WINDOW WIN1 03/29/05
Bottom
F3=Exit F12=Cancel F14=File-level keywords
F15=File-level comments F17=Subset F24=More keys
Image updated for record WIN1.
Control
Record Format:
.......................................
: EMPLOYEE DETAILS :
: SELECT EMPLOYEE NUMBER :
:
Y
:
: :
: :
: :
: :
: :
: :
: :
: :
: :
: :
: :
: :
:.....................................:
Subfile
Record Format:
.......................................
: EMPLOYEE DETAILS :
: SELECT EMPLOYEE NUMBER :
: Y :
: :
: I 9999- :
: I 9999- :
: I 9999- :
: I 9999- :
: :
: :
: :
: :
: :
: :
: :
:.....................................:
DDS for
Display File:
Columns
. . . : 1 71
Edit
PB01U01S/MYRPGS
SEU==>
WINDSP1
FMT A* .....A*. 1 ...+... 2 ...+... 3 ...+...
4 ...+... 5 ...+... 6 ...+... 7
*************** Beginning of data
*************************************
0001.00 A*%%TS
SD 20050329 123137
PB01U01 REL-V5R2M0 5722-WDS
0002.00 A*%%EC
0003.00 A DSPSIZ(24
80 *DS3)
0004.00 A
R EMP1
0005.00 A*%%TS
SD 20050329 110732
PB01U01 REL-V5R2M0 5722-WDS
0006.00 A CA03(03
'EXIT')
0007.00 A CA01(01
'HELP')
0008.00 A 4 33'EMPLOYEE
DETAILS'
0009.00 A COLOR(BLU)
0010.00 A 10 15'EMPLOYEE
NAME =>'
0011.00 A
COLOR(RED)
0012.00 A 8 15'EMPLOYEE NUMBER =>'
0013.00 A
COLOR(RED)
0014.00 A 12 15'EMPLOYEE
ADDRESS =>'
0015.00 A COLOR(RED)
0016.00 A 14 15'EMPLOYEE
SALARY =>'
0017.00 A
COLOR(RED)
0018.00 A 24
11'F3=EXIT'
0019.00 A EMPNO1 R
B 8 38
0020.00 A EMPNAM R
B 10 38
0021.00 A EMPADD R
B 12 38
0022.00 A EMPSAL R
B 14 38
0023.00 A 24 23'F1=HELP'
0024.00 A 1 30'DUKESTAR
TECHNOLOGIES'
0025.00 A
COLOR(PNK)
0026.00 A
R WIN1
SFL
0027.00 A*%%TS
SD 20050329 123137
PB01U01 REL-V5R2M0 5722-WDS
0028.00 A OPT 1
I 5 5
0029.00 A EMPNO1 4
0B 5 23
0030.00 A
R WIN2
SFLCTL(WIN1)
0031.00 A*%%TS
SD 20050329 110732
PB01U01 REL-V5R2M0 5722-WDS
0032.00 A
OVERLAY
0033.00 A
50 SFLDSP
0034.00 A
51
SFLDSPCTL
0035.00 A
52
SFLCLR
0036.00 A
53
SFLEND
0037.00 A
SFLSIZ(0010)
0038.00 A
SFLPAG(0004)
0039.00 A WINDOW(4
40 15 35)
0040.00 A
WDWBORDER((*COLOR PNK) (*DS
PATR
BL)-
0041.00 A (*CHAR
'...:::.:'))
0042.00 A 1 10'EMPLOYEE
DETAILS'
0043.00 A
COLOR(RED)
0044.00 A 2 3'SELECT'
0045.00 A
COLOR(BLU)
0046.00 A 3 5'Y'
0047.00 A
COLOR(BLU)
0048.00 A 2 19'EMPLOYEE
NUMBER'
0049.00 A
COLOR(BLU) **************** End of data
****************************************
F3=Exit
F4=Prompt F5=Refresh F9=Retrieve
F10=Cursor F11=Toggle
F16=Repeat find F17=Repeat change F24=More keys
No comments:
Post a Comment