Professional Documents
Culture Documents
Rev Chapter 14 - Screen Design Aid
Rev Chapter 14 - Screen Design Aid
Objectives
Explain the relationship between display files and DDS source members Show the advantages of using SDA over DDS to define and test screens Define a screen using SDA
Why screens?
Eliminate the need to pass parameters on the CALL command Easier for the user to specify parameters Less coding in the CL program:
No
PARM statement No DCLs needed to define program variables to hold the passed data
SDA generates screen definitions (I.e. File objects with att = DSPF) DDS source code definitions can also be created Source definitions are stored in members with type = DSPF
Type = *FILE Att = DSPF Machine Language Screen definition User SDA DDS Screen Definition
Type = DSPF
Starting SDA
STRSDA
Option 17 from the Work with Members screen
SDA Menu
AS/400 Screen Design Aid (SDA) Select one of the following: 1. Design screens 2. Design menus 3. Test display files
Selection or command ===> ________________________________________________________________________ _____________________________________________________________________________ F1= Help F3=Exit F4=Prompt F9=Retrieve F12=Cancel
7
Bottom F3=Exit F15=File-level comments F12=Cancel F17=Subset F14=File-level keywords F24=More keys
8
Add a Record
Add New Record File . . . . . . : Library . . . . : DDSSRC YOURLIBXX Member . . . . . . : Source type . . . : EXAMPLE DSPF Type choices, press Enter. New record Type . . . . . . . . . . . . . . . RECEX RECORD Name RECORD, SFL, WINDOW, PULDWN, MNUBAR USRDFN SFLMSG WDWSFL PDNSFL
. . . . . . . . . . . . . . . . . .
F3=Exit
F5=Refresh
F12=Cancel
9
Work screen for record RECEX: Press Help for function keys.
10
Defining a Screen
text fields
variable fields
fields
11
Move the cursor to the texts screen position Type the text
Enclose the text in single quotes (if text not enclosed in quotes, SDA will create a separate field for each word)
12
System variable fields are output only Define by typing reserved words that begin with an asterisk
*TIME *DATE *USER *SYSNAME
13
14
Database Fields
- marks the start of the field The field number identifies the field Header position character defines where field text is positioned
e.g.
&1L
15
F3=Exit
F4=Prompt
F12=Cancel
16
Select Fields
Select Database Fields Record . . . : CRTFMT __8 ___________ Type information, press Enter. Number of fields to roll . . . . . . . . . . . . . . . . . . Name of field to search for . . . . . . . . . . . . . . . . .
Type options, press Enter. 1=Display extended field description 2=Select for input (I), 3=Select for output (O), 4=Select for both (B) Option _ _ _ _ Field CRTNUM AMOUNT STORE BCHNUM Length 8 12 7 4 Type A A A A Column Heading CARTON NUMBER CARTON SIZE STORE CODE BATCH NUMBER
L R C P
&2R
&3C &4P
CARTON SIZE
1:BCHNUM
21
Attribute character (+) marks the start of the field (I.e. the attribute field) Display characters - define the field type and length:
IIII OOOOO BBBBBB 3333 66666 999999 +I(4) 4 character input only field 5 character output only field 6 character input/output field 4digit numeric input only field 5 digit numeric output only field 6 digit numeric input/output field Or use shorthand: +O(5) +B(6) +3(4) +6(5) +9(6)
22
SDA Ruler
1 2 3 4 5 6 7 8 9 10 11 12 13 ... ... 1 ... ... 2 ... ... 3 ... ... 4 ... ... 5 ... ... 6 ... ... 7 ... ... 8 15 16 17 18 19 20 21 22 23 24 23
action and display attribute codes in the attribute field the field definition menu by entering an asterisk (*) in the attribute field
Invoke
24
Display attributes Colors Keying options Validity check Input keywords General keywords Editing keywords Database reference Error messages and Message ID
26
Type choices, press Enter. Keyword Colors: Blue . . . Green . . Pink . . . Red . . . Turquoise White . . Yellow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . COLOR BLU GRN PNK RED TRQ WHT YLW Order (1-7) _ _ _ _ _ _ _ Indicators/+ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___
F3=Exit
F12=Cancel
28
Delete fields
D
in the attribute field blank out field using the space bar
or <<<
a hyphen/minus sign (-) in the attribute field of the field to be moved/copied type an equal sign in a field location to Move the field to that location type two equal signs to Copy the field to the first equal signs location 29
Record . . . :
Type information, press Enter. Number of fields to roll . . . . . . . . . . . . . . . . . . Type options, change values, press Enter. 1=Select keywords 4=Delete field Option _ _ _ _ _ _ Add Add Add F3=Exit Order 10 20 30 40 50 60 _____ _____ _____ Field CARTON NUM CRTNUM CARTON SIZ AMOUNT STORE CODE __________ __________ __________ Type Use C A B C A I C C H M P Length 14 8 11 12 5 4 ______ ______ ______ Row/Col 07 002 07 018 11 032 11 018 14 018 15 018
Ref Condition Y Y
Overlap
F6=Sort by row/column
F12=Cancel
Select one of the following: 1. Save work since last Enter and exit work screen 2. Exit without saving any work done on the work screen 3. Resume work screen session
Selection 1 F12=Cancel
31
Make sure the Save DDS source & Create Display File fields have Ys
Save DDS - Create Display File
Type choices, press Enter. Save DDS source Source file . Library . . Member . . . . Text . . . . . _______________ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y Y=Yes DDSSRC F4 for list YOURLIBXX Name, *LIBL ... EXAMPLE F4 for list ____________________________ Y _ EXAMPLE YOURLIBXX _ Y _ Y=Yes Y=Yes F4 for list Name, *CURLIB Y=Yes Y=Yes Y=Yes
Create display file . . Prompt for parameters Display file . . . . . Library . . . . . . Replace existing file
Submit create job in batch . . . . . . . Specify additional save or create options . . . . . . . . F3=Exit F4=Prompt F12=Cancel
32
To change some screen attributes it may be easier to edit the generated DDS source and recompile I.e. to change a field length you could:
Edit
the length in the fields DDS definition OR Delete the field (using SDA) and then redefine it
34
But sometimes its easier to work with SDA To change a field name its easier to bring up the Work with Fields screen (F4) and type in a new name Rather than:
Exiting
The screen definition is identified with a DCLF statement and incorporated into the program object during compiling
Library
Screen Definition
Type = CLP Program Source Code COMPILE
36
When displaying, the program sends and receives the screen using the record name not the file name
*************** Beginning of data ********************** 0001.00 PGM 0002.00 DCLF FILE(YOURLIBXX/EXAMPLE) RCDFMT(RECEX) 0003.00 SNDRCV RCDFMT(RECEX)
The program can manipulate screen fields just like any other program variable
37
Function Keys
Identified in the screen definition Action to perform defined in the application program Programmer must check function key status and code the desired function
38
Function Keys
CA## identifies the function key and (##) indicates the program variable that holds the function key status (I.e. &IN## is created) When a user presses the function key, &IN## is set to 1
39
Member . . . :
Type keywords and parameters, press Enter. Conditioned keywords: CFnn CAnn CLEAR PAGEDOWN/ROLLUP PAGEUP/ROLLDOWN HOME HELP HLPRTN Unconditioned keywords: INDTXT VLDCMDKEY Keyword CA03 _________ _________ _________ _________ _________ _________ _________ _________ _________ Indicators/+ Resp Text ___ ___ ___ 03 __________________________________________________ ___ ___ ___ __________________________________________________ ___ ___ ___ __________________________________________________ ___ ___ ___ __________________________________________________ ___ ___ ___ __________________________________________________ ___ ___ ___ __________________________________________________ ___ ___ ___ __________________________________________________ ___ ___ ___ __________________________________________________ ___ ___ ___ __________________________________________________ ___ ___ ___ __________________________________________________ ___ ___ ___ __________________________________________________
Function Key
Program checks the indicator value (after receiving the screen) and performs the desired function
Beginning of data ********************** FILE(YOURLIBXX/EXAMPLE) RCDFMT(RECEX) RCDFMT(RECEX) COND(&IN03 = 1) THEN(GOTO END)
41
Testing Screens
42
45
Creating Menus
Option 2 from the SDA menu Enter the menu screen text Press F10 to bring up the Define Menu Command screen Enter the associated CL commands
47
Creating Menus
MENUEX Select one of the following: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. MENUEX Menu
Creating Menus
Define Menu Commands Menu . . . . . . : MENUEX Position to menu option . . . . . __ Type commands, press Enter. Option Command 01 _____________________________________________________________________ ________________________________________________ 02 _____________________________________________________________________ ________________________________________________ 03 _____________________________________________________________________ ________________________________________________ 04 _____________________________________________________________________ ________________________________________________ 05 _____________________________________________________________________ ________________________________________________ 06 _____________________________________________________________________ ________________________________________________ 07 _____________________________________________________________________ ________________________________________________ F3=Exit F11=Defined only options F12=Cancel More... F24=More keys
49
Creating Menus
Library
Type = *MSGF
Att=MNUCMD
User SDA
Att=MNUDDS
50
Points to Remember
SDA allows you to define and create screens SDA creates DDS specifications and display file objects Display files can be tested Menus can be defined using SDA
51