1 week # 7 - agenda dfu overview query/400 overview sda overview websphere development studio client...

148
1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

Upload: edmund-fitzgerald

Post on 20-Jan-2016

223 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

1

Week # 7 - Agenda

DFU Overview Query/400 Overview SDA Overview Websphere Development

Studio Client (WDSC) File Transfer using Client

Access & IFS

Page 2: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

2

DFU (Data File Utility) What is it? Temporary vs Permanent specification Access to both Physical & Logical files File must first exist Using STRDFU Using CHGDTA & UPDDTA Audit Log Generates DDS source code Walk-thru

Page 3: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

3

Query/400 What is it? Output methods Using STRQRY/WRKQRY/RUNQRY Access to both Physical & Logical files Query allows multiple file access File Dump vs comprehensive formatted

report Object type No Source code Walk-thru

Page 4: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

4

SDA Overview(Screen Design Aid)

What is it? Using STRSDA Display Files Menus Generates DDS source code Walk-thru

Page 5: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

5

Websphere Development Studio Client (WDSC)

What is it? Remote System Explorer Web Facing

Page 6: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

6

File Transfer using Client Access

Client Access allows a User to transfer data in a file from a PC drive to a file on the iSeries

or transfer data from a file on the iSeries to a file on a PC drive.

Page 7: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

7

File Transfer using IFS

IFS(Integrated File system) allows a user to transfer/move/exchange data between the native iSeries database and PC-based files such as directory/stream files for transfer to other systems such as UNIX.

Page 8: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

8

File Transfer using FTP

FTP (File Transfer Protocol) will allow a user to transfer data (in a file) from/to the iSeries to/from a PC platform.

Page 9: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

9

Week # 7Lesson Overview

Learn enough about Data File Utility (DFU) to be able to create permanent DFU programs and use them to enter data records into a database file.

Learn enough about Query/400 to be able to create various Query/400 reports.

Learn Enough about Screen Design Aid (SDA) to create menus.

Page 10: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

10

Week # 7 Data File Utility (Continued)

DFU (Data File Utility) provides a convenient, easy way to change records in and add records to a physical (or thru a logical) database file without the need to write an HLL data-entry program.

DFU is useful for entering and changing test data. DFU is a valuable tool for programmers -- it’s

another member of the Application Development ToolSet (ADTS) team and, with PDM and SEU, is available on any AS/400 on which program development or maintenance is done.

Page 11: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

11

Week # 7 Data File Utility (Continued)

Access DFU by using the STRDFU (Start DFU) command or choosing option 18, Change using DFU, on a database *FILE type object from the Work with Objects Using PDM screen.

If you enter STRDFU command on any command line, the DFU menu appears; DFU either:

a) Creates and executes a temporary entry/update program, or

b) Builds and stores a “permanent” update program that can be called and used again.

Page 12: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

12

Week # 7 Data File Utility (Continued)

If you execute the STRDFU command, you can select option 5 from the DFU menu to update data using a temporary program.

NOTE: Providing a temporary update program is also the approach the system takes when you select option 18 on a file from Work with Objects Using PDM.

Page 13: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

13

Week # 7 Data File Utility (Continued)

The advantage of a temporary DFU when working with externally described files is: You don’t need to specify a screen layout or field headers or edit and select fields.

DFU generates a default update program using the record-format field-level attributes and file information stored in the data-file object.

Page 14: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

14

Week # 7 Data File Utility (Continued)

The disadvantages of temporary DFU programs are:

1. Lack of flexibility2. The machine time required to recreate the program each time you need it.

Page 15: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

15

Week # 7 Using a Temporary DFU Program

Selecting option 5 from the DFU menu brings up an entry screen (DFU Update Data Using Temporary Program) that requests the name and member of the file to be updated.

DFU remembers the last time you used a temporary program and provides that data-file name as a default value when you start another temporary DFU program from the menu.

Page 16: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

16

Week # 7 Using a Temporary DFU Program (Continued)

You might need to type over the old name, replacing it with the name of the file you want to use.

Press Enter and DFU creates an update program using the field-level attributes from the file description of the file being maintained.

Meanwhile, the message “DFU is creating temporary program QDZTD00001 for you to run” is displayed on the message line.

Page 17: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

17

Week # 7 Starting DFU on an Empty File

When you start DFU, using an empty data file, DFU’s Entry mode is active and displayed in the update screen’s upper-right corner.

When you’re entering data, either the Field advance (Tab) or Field exit key moves the cursor to the next field.

Character data is stored exactly as entered into the field (if you key leading blanks, the data is stored that way).

Page 18: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

18

Week # 7 Starting DFU on an Empty File (Continued)

Numeric data is treated as right-aligned within the field.

A temporary DFU program doesn’t let you enter any editing characters (i.e., a decimal point or comma thousands separator) in a numeric field, and this restriction applies to dates and times stored as numbers.

Date and time data (data types L and T) must be entered using the proper format and separator characters.

Page 19: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

19

Week # 7 Starting DFU on an Empty File (Continued)

NOTE: When the last field typed in is numeric and you do not enter the maximum number of digits, you must press Field exit or the Tab key to exit the field before pressing Enter.

When you are ready to write the record to the file, press Enter key or F10 to save the record (Enter is easier to reach); the system stores the record and displays an empty entry screen for the next record.

If after the fact you realize there was an error in the data, get out of entry mode and into change mode.

Page 20: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

20

Week # 7 DFU Change Mode

Function key F11 takes you to DFU’s change mode; for our examples, when you first reach change mode, the only input field on the screen will be the one named *RECNBR.

All physical-file records are given a record number that indicates their order of entry; if you know the record number of the erroneous record, enter it in this field and DFU will retrieve it, if it exists, or use the Page up key to retrieve the last record entered.

Page 21: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

21

Week # 7 DFU Change Mode (Continued)

From any record currently displayed in change mode, pressing the Page up key takes you to the next lower record number and pressing Page down takes you to the next higher record number.

Once the record has been corrected, continue to enter new records by returning to entry mode -- press function key F10 from change mode.

To delete (vs. change) a bad record, display the record in change mode and then press F23, and then F23 again to confirm.

Page 22: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

22

Week # 7 DFU Change Mode (Continued)

CAUTION: DFU enables other function keys besides those shown at the bottom of the screen but does not show F24=More Keys; however, you can see the entire list of enabled function keys by using context-sensitive Help. To take advantage of this help, move the cursor to any part of the function-key area and press F1.

Page 23: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

23

Week # 7 Exiting DFU

Function key F3 takes you to the End Data Entry screen.

The End Data Entry screen reports the number of record adds, changes, and deletions and asks if you are finished.

NOTE: If you reach this screen by mistake, return to the DFU data-entry screen by typing N over the default value of Y for the screen’s End data entry prompt.

Page 24: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

24

Week # 7 Why DFU?

The AS/400’s Data File Utility (DFU) (continued):

Program code is generated as you respond to a series of DFU entry screens

Is a handy tool for programmers who need to build or change test data files

Can save time over HLL application development for end users with fairly straightforward data-entry or file-update needs

Page 25: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

25

Week # 7 Why DFU? (Continued)

If your application requires any of the following, you’ll need to write an HLL program or use a more powerful utility:

Creating derived (virtual) fields for display by performing calculations on other fields

Field validation that requires testing the value of another field in the same record (e.g., HIREDATE>BIRTHDATE

Page 26: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

26

Week # 7 Accessing DFU

Enter the STRDFU (Start DFU) command on any command line.

Option 5 on the initial menu (Update data using temporary program) creates a temporary DFU.

Option 2 (Create a DFU program) lets you create a permanent DFU.

Option 3 lets you change an existing DFU program.

Option 4 lets you delete a permanent DFU program.

Page 27: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

27

Week # 7 Creating a DFU Program

Option 2 from the DFU menu takes you to the “Create a DFU Program” screen.

Name the program you’ll create, the library in which the program will reside, and the data file the program will use.

NOTE: The Library value for the Program parameter defaults to *CURLIB the first time you useoption 2; after that, DFU uses the value from the previously created program.

Page 28: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

28

Week # 7 Creating a DFU Program (Continued)

The data file value will be blank (first time) or display previously used Data file name; if blank, the Library value defaults to *LIBL.

With Program and Data file fields, use function key F4 to prompt for a list of existing programs or for a list of all physical and logical files in the specified library.

Prompting requires a specific library reference (*LIBL won’t work).

Page 29: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

29

Week # 7 Creating a DFU Program (Continued)

NOTE: Attempting to select a Join file would result in an error because DFU does not permit the use of join logical files.

When you select a file from a prompt list, the list values – Data files and *CURLIB for Library -- are filled in on the Create a DFU Program screen.

Page 30: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

30

Week # 7 Defining General Information

When you press Enter from a completed Create a DFU Program screen, the next screen depends on the type of data file you named.

If the specified file is a nonindexed file, you get the Define General Information/Nonindexed File screen.

For an indexed file (a file with a keyed-sequence access path), the display differs.

Page 31: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

31

Week # 7 Defining General Information (Continued)

Available options common to nonindexed AND indexed files (please reference the table for brief descriptions of each option listed below):

Job title Display format Audit report S/36 style Suppress errors Edit numerics Allow updates on roll

Page 32: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

32

Week # 7 Defining General Information (Continued)

Options specific to nonindexed files are (refer to table for brief descriptions of each):

Generate (record numbers) Store in a field Heading Processing

If an indexed file were specified for use by our DFU program, we would see a Define General Information/Indexed File screen, which offers options for the indexed file’s keys.

Page 33: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

33

Week # 7 Defining General Information (Continued)

The two options are:Generate: Enter Y if you want DFU to

generate numeric keys in multiples of 10 for records added to the file; if the key field is a data field, take the default N.

Changes allowed: Y permits the value of a data key field to be changed when the DFU is in change mode; when keys should not be changed, use N.

Page 34: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

34

Week # 7 Defining General Information (Continued)

For a single-column format selected, if all fields fit into one column, the screen will be formatted as single column even if Multiple or Maximum had been the chosen format.

You can enter a Job title to clearly define the purpose and have chosen to print an audit report, selected edit numerics, allowed updates on a roll, and changed the record number heading -- the DFU program will process the file sequentially, with new records added to the end of the file.

Page 35: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

35

Week # 7 Defining Audit Control andChoosing Record Formats

After pressing Enter on the Define General Information/Nonindexed File screen, we get Define Audit Control screen because we chose to print an audit report.

You can use this screen to change report width, spacing, and even the types of transactions to be printed.

The Work with Record Formats screen is next.For a single record format, you can tell DFU to

select fields using that format by typing option 2 next to the format name.

Page 36: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

36

Week # 7 Selecting and Sequencing Fields

From the Select and Sequence Fields screen, choose which fields to include on the DFU Update display by assigning them a sequence number (those not given a number will not appear). The relative magnitude of the sequence numbers determines the ordering of fields on the DFU Update display screen, with the lowest-numbered field occupying the top (or leftmost position) of the field list.

Page 37: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

37

Week # 7 Selecting and Sequencing Fields (Continued)

Press F21 to select all fields.Decide whether to use extended

field definitions or special features, such as auto-duplicate, for any fields.

Press F17 (Fast path) to go directly to DFU exit screen if no special features are chosen.

Press Enter to use special features.

Page 38: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

38

Week # 7 Specifying Extended Field Definitions

Press Enter and the Work with Fields screen appears; this screen lists all the fields and lets you specify or delete extended definitions.

Value N or Y under the Extended Definition column tells you whether an active extended definition currently exists for a field.

Under Heading you can change the field identification that will appear on the DFU Change/Display screen.

Page 39: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

39

Week # 7 Specifying Extended Field Definitions (Continued)

Specify Extended Field Definition screen has these options for a numeric field:

Auto-duplicate Accumulate Extended field heading Initial value (to specify starting value) Auto-increment Validity checks

Page 40: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

40

Week # 7 Specifying Extended Field Definitions (Continued)

Second page of Specify Extended Field Definition screen:

First three options let you place the field at the beginning of a new line, require Field exit, and select a field that should be viewed only and not changed.

The Non-display option lets you hide a sensitive field.

Page 41: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

41

Week # 7 Specifying Extended Field Definitions (Continued)

Second page of Specify Extended Field Definition screen (continued):

You can specify spacing or use default spacing, and you can choose an edit code or edit word for numeric fields.

When Edit numerics has been set to Y on the Define General Information screen, these edit codes work in entry mode; otherwise, editing is not used.

Page 42: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

42

Week # 7 Specifying Extended Field Definitions (Continued)

Codes permit different combinations of four editing variables:

Whether commas are used to separate hundred thousands, thousands, etc.

Whether decimal points are printed for non-integer numbers

More...

Page 43: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

43

Week # 7 Specifying Extended Field Definitions (Continued)

How a negative value is shown: NS no sign R- minus sign to the right CR CR to the right -F minus sign to the left (floats

to first digit) Whether a zero value is displayed (0 for

integers or .00 for decimals) or is replaced with all spaces.

Page 44: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

44

Week # 7 Specifying Extended Field Definitions (Continued)

Predefined edit codes and values for variables: Decimal NegativeZero

Code Commas Point Value Value(blank) No No NS 0 all positions1 Yes Yes NS 02 Yes Yes NS3 No Yes NS 04 No Yes NSA Yes Yes CR 0B Yes Yes CRC No Yes CR 0D No Yes CRJ Yes Yes R– 0K Yes Yes R–L No Yes R– 0M No Yes R–N Yes Yes –F 0O Yes Yes –FP No Yes –F 0Q No Yes –FY No No NS 0/00/00

Page 45: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

45

Week # 7 Specifying Extended Field Definitions (Continued)

Predefined edit codes and values (continued):

The main difference among the groups of Codes 1-4, A-D, J-M and N-Q lies in how they handle negative values; otherwise, comma insertion and print zero value patterns repeat from group to group.

Y code is used to edit numeric integer fields whose values are dates -- it inserts slashes between month, day, and year values.

Page 46: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

46

Week # 7 Specifying Extended Field Definitions (Continued)

Specify Validity Checks screen offers several ways to check the validity of numeric fields.

Mandatory entry: A value must be entered when the DFU program is in entry or insert mode -- select this option for any field that requires a value.

Page 47: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

47

Week # 7 Specifying Extended Field Definitions (Continued)

Mandatory fill requires all positions of a field to be entered, and the next two options check for valid self-checking numbers using either of two popular self-checking number algorithms, Modulus 10 and Modulus 11.

Relational operator and List of values provide for comparing the contents of a field against a single value, a range of values, or a list of up to 20 values. (Any value entered in the field must test true for it to be accepted on input; if an invalid value is entered, DFU displays an error message and rejects the change or addition until a valid value is entered).

Page 48: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

48

Week # 7 Specifying Extended Field Definitions (Continued)

After completing the extended definition for fields, the changed Work with Fields screen appears.

You can always take option 2 again if necessary to change a field’s extended definition.

NOTE: There are differences between a screen for a numeric field and a screen for a character field. If the data entered for a field will contain lowercase characters, set the Allow lowercase option to Y.

Validity checks are permitted for non-numeric fields, but with some differences from numeric fields.

Page 49: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

49

Week # 7Specifying Extended Field Definitions (Continued)

Y for Name check means the field must contain a valid AS/400-style name. Extended name check option permits lowercase a-z, but converts characters to upper case in the record unless the user encloses the entire name within double quotation marks. Both options are mutually exclusive, and neither can be used with range or list-of-values checks.

Page 50: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

50

Week # 7 Specifying Extended Field Definitions (Continued)

After extended field definitions have been taken, select other fields from the Work with Fields screen for extended definitions.

Additional field definitions would be required for other fields, too.

Page 51: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

51

Week # 7 Editing DFU

After completing all Work with Fields specifications, save the DFU by pressing Enter. The Exit DFU Program Definition screen appears. Check to be sure you get what you wanted:

Save program…Y If you changed this value, all your work would be lost.

Page 52: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

52

Week # 7 Editing DFU (Continued)

Run program...Y You normally need to test your program to make sure it is working as you planned, or you may need it to update a data file right away.

Type of run…1 Run type 1 (Change) lets updates, deletions, and additions be made to the data file;

type 2 (Display) allows display only, requiring only data read authority to the file.

Page 53: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

53

Week # 7 Editing DFU (Continued)

Modify program…N This DFU is brand new; if you had just changed an existing DFU, you would specify Y.

Save DDS source…N If you planned to change the DFU screen layouts directly through the DDS, you would need to select Y here; otherwise, saving the DDS is unnecessary.

Additional parameters use the information supplied upon entry to name the new DFU program, including library name and specified text.

Page 54: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

54

Week # 7 Editing DFU (Continued)

When we take the defaults and press Enter, we see a message at the bottom of the screen telling us that the DFU program is being saved. Then the Change a Data File screen appears because the DFU program is about to be run.

A message at the bottom of this screen tells us that the DFU program was saved successfully.

Press Enter to get the DFU work screen, where we see that the job title appears in the upper-left corner and field headings reflect change made earlier in our example.

Page 55: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

55

Week # 7 Editing DFU (Continued)

If we enter a relative record number, press Field exit, and then Enter, the record will be displayed. It will show blanks for WORKPHONE, the field we added (in fact, it contains default value 0, placed there by the CPYF command, but with the edit word we chose for these fields, zero values are displayed as blanks).

Edit words and codes selected when the DFU was created are used to format the data when it is displayed or printed.

We do not need to type edit characters when we input or change data.

Page 56: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

56

Week # 7 Editing DFU (Continued)

To enter a new record using the DFU program, press F9 on the screen to get an entry screen in insert mode; when this is saved successfully, DFU displays the message “The record was added to the end of the file” at the bottom of the screen.

Press F3 (to exit) to get the normal DFU End Data Entry screen; press Enter again to see the Display Batch Accumulators screen; Press Enter to get the Display Total Accumulators screen.

Page 57: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

57

Week # 7 Editing DFU (Continued)

Summary: DFU is quick and flexible for creating

interactive update or file-maintenance programs for physical or logical files.

DFU generates its own program logic and creates display files using information supplied by the externally described file object and information you supply in extended field definitions.

DFU is most useful for simple applications that don’t require extensive data validation or special screen formatting.

Page 58: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

58

Week # 7 What Query/400 Does

Query/400 -- menu-driven, widely used, easy to learn -- is an IBM-licensed program product on the AS/400 that provides a data-base management feature called report generator, or query utility.

Use Query/400 to: Obtain information on the AS/400 from any externally

described database file, be it from DDS, IDDU, or SQL. Generate printed reports, screen displays, or new

database files using data from one file or joining data from up to 32 different files -- and select from one to all fields and organize them into a printed report, display, or new database file

Page 59: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

59

Week # 7 What Query/400 Does (Continued)

Selection and arrangement of records -- You can use simple relational expressions to select specific records from files and then order those records in ascending or descending sequence by using any field or combination of fields as sort keys. For example, you could sort all records in an employee file by employee name within department.

Page 60: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

60

Week # 7 What Query/400 Does (Continued)

Selection and placement of fields -- You can choose specific fields to display or print, and you can place the fields in any desired order. You can edit the fields -- for example, insert slashes (/) in a numeric date field for readability -- or perform arithmetic or string operations on the fields to create new result fields. In addition, you can easily adjust column widths and change column headings.

Page 61: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

61

Week # 7 What Query/400 Does (Continued)

Specification of report breaks -- You can print or display groups of records sorted by the values of designated sort-control fields. This feature, called control-break logic, lets you select control fields to be used on up to six levels of report breaks (e.g., department within section within division). You can also choose column functions for desired fields. These functions let you print automatic calculations, such as total and average, when the value of a sort-control field changes. For example, after listing all employees in the same department, you could print a count of employees and the total salary for the department if the employee file is sorted by department.

Page 62: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

62

Week # 7 What Query/400 Does (Continued)

Ability to examine a report layout and preview a report -- At any time while specifying a query, you can use function key F13 to display a layout of the query output as it might appear on a printer spacing chart. You can also test the query to see what the report will look like with actual data by using function key F5. You then can make any necessary changes to your query without having to exit Query/400.

Page 63: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

63

Week # 7 What Query/400 Does (Continued)

Execution of query programs -- Although a complete, saved query specification is not a program in the sense of object type -- a query’s object type is *QRYDFN, not *PGM -- you can run a query just as you would a program by using option 16 on a *QRYDFN object from the Work with Objects Using PDM screen or by entering the RUNQRY (Run Query) command on any command line. When a query is run, it uses the current data from the selected file (or files) in the same way a program written in a high-level language (e.g., Cobol, RPG) would when the program is executed.

Page 64: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

64

Week # 7 Getting into Query/400

STRQRY (Start Query) command takes you to the Query Utilities menu which provides a list of query functions. You can also reach it by using the GO command (GO QUERY).

From the Query Utilities menu, Option 1 takes you to the Work with Queries screen.

From the Programming Development Manager (PDM) environment, you can perform two options: Run an existing query and Delete a query, by taking option 16 or 4 on the appropriate *QRYDFN list item.

Page 65: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

65

Week # 7 Getting into Query/400 (Continued)

The Work with Queries screen can also be reached (and bypass the Query Utilities screen) by executing the WRKQRY (Work with Queries) command or by selecting PDM’s Work with option (12) for any *QRYDFN object.

Page 66: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

66

Week # 7 Working with Queries

From the Work with Queries screen, you can:

Create a query Change, copy, delete, or display an

existing query Print a query definition Run a query either as a batch job or

interactively

Page 67: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

67

Week # 7 Working with Queries (Continued)

Create a new query: Take option 1, Create Name the query: Name when you take

option 1 or wait until the query definition is completed

NOTE: Other options on the Work with Queries screen work only with existing queries.

To get name of an existing query: Place cursor on Query input field and press F4 to view a list of existing query definitions in the selected library.

Page 68: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

68

Week # 7 Working with Queries (Continued)

The first time you use Query/400, the library displayed is your current library; after that, WRKQRY returns you to the library you were using on the previous occasion.

You can move the cursor down the list and type the option you want next to the query to be used; if the query you want is not in the list, change the Library value specified at the top of the screen and press Enter to see a new list.

Page 69: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

69

Week # 7 Defining a Query

When you type 1 in the option field of the Work with Queries screen and press Enter, the main query specification screen, Define the Query, appears.

This screen presents available query features you can use to create a customized query.

Select one, and Query/400 will prompt you through a series of related lower-level screens to define how you want the feature to work for the report (most menu-driven, but some features require you to reorder list items or enter expressions or functions). Then, return to the Define the Query screen and select the next feature or Exit and save.

Page 70: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

70

Week # 7 Selecting Files

When the Define the Query screen appears, the Specify file selections option is selected automatically because, at the least, you must tell Query/400 which file to use.

Press Enter from the Define the Query screen to get the Specify File Selections screen.

From the Specify File Selection screen, you can prompt to see a list of physical and logical database files in your library (the initial default) or in another library to which you’re authorized.

Pressing F4 on the File name input field takes you to the Select File screen.

Page 71: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

71

Week # 7 Selecting Files (Continued)

When you press Enter on the Select File screen, Query/400:

fills in the File name field asks you to confirm the file name returns you to the Define the Query

screen

Page 72: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

72

Week # 7Selecting Files (Continued)

The Define the Query screen displays a greater-than symbol (>) to the right of the Option field (replacing the 1 on the Specify file selections line).

NOTE: You can always go back and change the values you specified for any feature by taking option 1 on it again.

Page 73: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

73

Week # 7 Previewing a Query Layout

You can see how the query is formatted by pressing F13 from the Define the Query screen.

To see additional columns of the report, press F20 to shift the view right.

NOTE: Field names are used as column headers, spaces are inserted between columns, and numeric fields are edited with commas to separate thousands.

Page 74: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

74

Week # 7 Previewing a Query Layout (Continued)

Should you wish to change the way the numeric fields were edited, you must first press Enter or F12 to return to the Define the Query screen. There, select the Specify report column formatting option.

Page 75: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

75

Week # 7 Formatting Report Columns

The Specify Report Column Formatting screen displays three fields at a time and lets you change:

Column spacingColumn headingsField length

Page 76: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

76

Week # 7 Formatting Report Columns (Continued)

CAUTION: If you make a field’s length on the Specify Report Column Formatting screen shorter than the actual database field, you could lose data in the report.

Page 77: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

77

Week # 7 Formatting Report Columns (Continued)

To edit a field, move the cursor to anywhere in the horizontal zone for a field and press F16.

Define Numeric Field Editing screen comes up, and it identifies the field; it displays its column headings, length, and sample of how the field would appear when printed.

Page 78: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

78

Week # 7 Editing Options

Note that commas are used as separators. To eliminate the commas, use the default Edit option 1, Numeric editing choices.

The Describe Numeric Field Editing screen comes up, and here you can change the Thousands separator value from a comma to None by typing a 5 over the 2 (the default).

NOTE: Other options have to do with the display of the negative sign, currency symbol, and leading zeros.

Page 79: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

79

Week # 7 Editing Options (Continued)

When you change a value on an entry screen such as the Describe Numeric Field Editing screen, press the Enter key to save changes rather than F12 (F12 does not save your changes).

NOTE: F3 saves changes, but it takes you to the query exit screen -- so use F3 if this is what you need.

Pressing Enter on the Describe Numeric Field Editing screen returns you to the Specify Report Column Formatting screen.

Page 80: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

80

Week # 7 Editing Options (Continued)

On the Specify Report Column Formatting screen, note that an asterisk (*) appears under the Edit column for the field which is to remind you that the field has been edited.

Should you wish to change a field to separate the parts of the number with blanks (spaces), press F16 again with the cursor in the field’s horizontal zone to return to the Define Numeric Field Editing screen.

Page 81: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

81

Week # 7 Editing Options (Continued)

To use blanks as separators, create an edit word by using option 4 -- only one edit choice, code, or word can be active for a field at any time. NOTE: By creating an edit word for a field, you will override the numeric edit choice (remove comma thousands separator) that you made previously.

The Specify Edit Word screen appears.

Page 82: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

82

Week # 7 Editing Options (Continued)

The apostrophes (‘) delimit the edit word, and initially the number of blanks (spaces) within the apostrophes is equal to the number of digits in the field

As the display indicates, each digit is represented by a blank -- to insert an actual blank (spacebar) into the edited field, use the ampersand character (&)

If you wanted to use other edit characters (hyphens or slashes), you would insert those characters into the edit word where you need them to appear in the edited field

Page 83: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

83

Week # 7 Editing Options (Continued)

Specify Edit Word with Edit Characters Entered:

If the number of spaces within the apostrophes differs from the specified length, Query/400 considers it an error and puts the quoted string in reverse image until you fix it AND Query/400 displays an error message.

Page 84: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

84

Week # 7 Editing Options (Continued)

Pressing Enter returns you to the Specify Report Column Formatting screen.

Try the Layout function again and see the effect your edit word had.

The Display Report Layout screen sample indicates the blank insertion was successful.

Using another edit word, you could format a field to eliminate the comma thousands separator and insert a hyphen.

Page 85: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

85

Week # 7 Editing Options (Continued)

When you use an edit word, it is not necessary to first change numeric editing choices because all default editing options are turned off automatically if you select an edit code or create an edit word.

Page 86: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

86

Week # 7 Editing Numeric Date and Time Fields

Query/400 edits older database files’ date or time data as numeric zoned or packed-decimal fields.

An easy way to insert slashes, hyphens, or colons (:) in date and time fields is to use another option on the Define Numeric Field Editing screen: option 2, Date or time editing choice, which takes you to the Describe Date/Time Field Editing screen.

Page 87: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

87

Week # 7 Editing Numeric Date and Time Fields (Continued)

NOTE:When a date field is defined as data type L, insertion characters determined by the date format (*ISO uses hyphens) are already part of the field, so no further editing is needed. Query/400 does not permit editing of L-type fields.

Page 88: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

88

Week # 7 Selecting Sort Fields

Press Enter from the Define the Query Screen and get the Selected Sort Fields screen.

You can select up to 32 different sort-key fields (though it’s uncommon to use more than three or four).

To specify a sort key, assign a number to the field in the Sort Prty (sort priority) column.Lower numbers have higher priority.

Page 89: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

89

Week # 7 Selecting Sort Fields (Continued)

To list names, for example, starting with Z instead of A, enter a D for Descending in the A/D column.

Press Enter and Query/400 will ask you to confirm your choices.

You could make adjustments from this Confirm Request for Select Sort Fields screen.

Page 90: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

90

Week # 7 Defining Report Breaks

Because we selected Define report

breaks in our sample, Query/400

takes us to that screen.

Sort fields and control breaks are

directly related.

Page 91: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

91

Week # 7 Defining Report Breaks (Continued)

Query/400 automatically assigns break level 0 to final totals -- you could assign up to six more break levels. Remember: the lower the number, the more inclusive the break level.

NOTE: Sort priority is provided for your information only and is not an input-enabled field on the Define Report breaks screen.

Press enter to get the Format Report Break screen.

Page 92: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

92

Week # 7 Defining Report Breaks (Continued)

At the Format Report Break -- Level 1 screen, leave the first two input fields, and leave the default values of N for Skip to a new page and Suppress summaries.

To include the break-control-field value on the subtotal line, ask Query/400 to substitute the actual field value by using the field name prefixed with an ampersand as part of the break text.

Press Enter to return you to the Define the Query screen.

Page 93: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

93

Week # 7 Selecting and Sequencing Fields

On the Select and Sequence Fields screen, select fields to include in the query by giving them a number.

The left-to-right order of the fields across the report depends on the relative magnitude of the number, with the leftmost being the lowest.

Page 94: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

94

Week # 7 Selecting and Sequencing Fields (Continued)

Ordering Fields for a Query Report:Assign numbers in any increment as long as they are in the relative order corresponding to their desired position.

A field not needed in the report is left without a number (but such a field can be included later by giving it a number).

Press Enter and you will be asked to confirm the sequenced list of fields; pressing Enter again does that and returns you to the Define the Query screen.

But, to verify accuracy of the report, run the query to show how the report will look at this point.

Page 95: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

95

Week # 7 Selecting and Sequencing Fields (Continued)

To preview Query Report Format:Check to see that all selected fields are present and in the correct order. If a report line is too wide for all fields to be displayed at once, press F20 to shift the view to the right side.

Page 96: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

96

Week # 7 More Report Column Formatting

You can return to any feature as often as necessary by typing 1 on its option field and pressing Enter. The option is used to return to the Specify Report Column Formatting screen again.

Now you can display more meaningful column headers.

Page 97: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

97

Week # 7 More Report Column Formatting (Continued)

To change column headings: type over or blank out the default field name column heading that is displayed.

To change column spacing from defaults of 0 for the first field and 2 for each subsequent field, simply type a different value over the default.

Page 98: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

98

Week # 7 More Report Column Formatting (Continued)

If a column heading is wider than the associated data field, Query/400 adjusts the column width to avoid truncating any part of the heading, so consider stacking headings on the three lines provided on the Specify Report Column Formatting screen rather than using all 20 print positions allowed per column

Page 99: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

99

Week # 7 More Report Column Formatting (Continued)

If a character report column is narrower than the actual number of characters stored in a record, the excess rightmost characters are truncated in the query output -- but the query can still be run.

When you change numeric specifications, it is convenient to tab or field-advance to the desired field, type in the new value, and then use the Field exit key to erase the old value.

To see your changes, press F13 or F5 -- and always remember to press Enter to save changes.

Page 100: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

100

Week # 7 Report Summary Functions

Select report summary functions from the Define the Query screen .

From this screen, you can add summary information to the control-break total lines by selecting up to five different functions per field.

Page 101: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

101

Week # 7 Report Summary Functions (Continued)

Report Summary Functions defined by Options:

1 and 2 (Total and Average) -- with numeric fields only

3 -- Minimum 4 -- Maximum 5 -- CountNOTE: It does not matter which of the five option

input fields you use for a report field or in which order you enter multiple options.

Page 102: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

102

Week # 7 Defining Result Fields

Result fields (derived columns) are created by performing certain operations on data already contained in one or more fields of each record.

Operation types: String operations (concatenate and

substring) can be performed on alphanumeric (character) fields.

Page 103: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

103

Week # 7 Defining Result Fields (Continued)

Operation types (continued): Concatenate ( ) puts two

character fields (or subfields) together to form a new field with a new name

Substring creates a new field from part of an existing field,

Page 104: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

104

Week # 7 Defining Result Fields (Continued)

For numeric fields, you can use an almost infinite combination of numeric expressions to create new columns; these expressions consist of numeric field names and/or constants combined with the arithmetic operators for addition, subtraction, multiplication, and division (+, -, *, /, respectively).

Page 105: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

105

Week # 7 Defining Result Fields (Continued)

Take the option on the Define the Query screen to get the Define Result Fields screen.

In this screen’s Field column, you name the new field being defined, then key the expression used to derive the new field’s value.

Page 106: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

106

Week # 7 Defining Result Fields (Continued)

You can provide a column heading if you do not want the field name used as a heading.

Length (Len) and decimal-position (Dec) entries are often used to shorten the size of a calculated numeric result, including date and time duration.

NOTE: Query/400 determines the length of any string (alphanumeric) expression.

Page 107: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

107

Week # 7 Defining Result Fields (Continued)

To understand how date arithmetic works, think of the numeric value of any date field as the number of days since the beginning of the calendar, January 1 of 1 AD, or 0001-01-01 in *ISO format.

When the year function converts into years, no rounding is done and no fraction of a year is calculated.

NOTE: For available functions for creating expressions and some examples, request extended Help from the Define Results Fields screen.

Page 108: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

108

Week # 7 Finishing the Report

When you create a result field and have already selected report fields, return to the Select and Sequence Fields screen to add the new field to the report.

To calculate a result field return to the Select Report Summary Functions screen and select Average function for the new field.

Page 109: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

109

Week # 7 Exiting Query

Save and exit. Notice that when a query sends its output to a display device, it adds line numbers as a leftmost column, and these line numbers are not included in printed output or database-file output.

From Define the Query screen, press F3 to get to the Exit this Query screen.

Page 110: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

110

Week # 7 Exiting Query (Continued)

Exit this Query screen (continued):For a new query, the Save definition

option is set to Y and the Run option is set to 1.

When you save a query definition, give it a name if it has not been given one already and add some descriptive text.

Last, press Enter to save the definition and run the query (this returns you to the Work with Queries screen).

Page 111: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

111

Week # 7 What SDA Does

For filling in options from screens or entering data into input fields to change or add database records, end users would work with a display screen created as a display file. Display files are objects whose type is *FILE and whose attribute is DSPF.

The main difference between a menu and a non-menu display file is that a menu always has a numbered list of actions to be taken, and behind each action is a single CL command or program to implement the action.

Page 112: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

112

Week # 7 What SDA Does (Continued)

These actions and their associated commands are created together, most conveniently using Screen Design Aid (SDA).

Once a menu exists, you can make it work by using the GO command -- you don’t need a CL or high-level language (HLL) program.

Page 113: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

113

Week # 7 What SDA Does (Continued)

A non-menu display file is only a screen image and pathway for moving data and indicators between the screen and the program that controls it; a non-menu display file requires a CL or HLL program to make it appear on the display device and to control and monitor the movement of data between it and the program.

Page 114: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

114

Week # 7 What SDA Does (Continued)

Both menus and display files are created by compiling the Data Description Specifications (DDS) source members that describe them, a process similar to creating database files from physical- and logical-file DDS source members.

The DDS syntax for DSPF type members is different and often more involved than for database physical-file and logical-file member types.

Page 115: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

115

Week # 7 What SDA Does (Continued)

SDA facilitates the creation of menus and display files by providing a combination of fill-in-the-prompt and blank-screen work environments. By taking different combinations of options from the prompts and arranging constants and input/output fields on the blank screen, you define what the menu or display-file screen will look like and how it will be used.

With SDA, you can create sophisticated screen designs and menus without dealing directly with DDS; SDA generates the DDS source code as you design the screen or menu.

Page 116: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

116

Week # 7 What SDA Does (Continued)

Throughout this menu/screen-design process, SDA constantly checks for, and discourages, entries that would result in DDS syntax errors.

NOTE: Whether you are using SDA to design a menu or a display-file screen, the successful completion of the process results in DDS specifications that are stored as a member of a source physical file -- by convention, QDDSSRC.

Page 117: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

117

Week # 7 What SDA Does (Continued)

Source members for menus and display-file screens are similar to source members for physical and logical database-file descriptions in the sense that all types are coded in DDS and stored in a source physical file (QDDSSRC).

Page 118: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

118

Week # 7 Getting Started with SDA

You invoke SDA when you enter the STRSDA (Start Screen Design Aid) command on any command line.

If you need to change an existing menu or non-menu display file using SDA, use option 17 from the Work with Members Using PDM screen for a shortcut.

Page 119: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

119

Week # 7 Getting Started with SDA (Continued)

The initial SDA screen displays the choices for designing screens, designing menus, and testing display files.

The screens referred to under option 1 on this menu are non-menu display files.

SDA also lets you create online Help information for screens or menus and, because you create the online Help during the screen- or menu-design process, creating online Help is not provided as a separate menu option.

Page 120: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

120

Week # 7 Getting Started with SDA (Continued)

SDA’s four distinct functions are:

Design screensDesign menusTest display filesAdd online Help to screens/menus

Page 121: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

121

Week # 7Menus

With SDA, you can create menus that look and act like the system menus.

SDA provides a menu template you can modify.Associate a single CL command with each menu

selection; the command is executed when the user makes the selection -- it could be a CALL command to execute a program written in CL or an HLL, and that program could consist of thousands of other commands.

Page 122: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

122

Week # 7 Menus (Continued)

When you use SDA to design a menu, five different entities are created automatically

Save the menu source members -- SDA cannot create the objects without them.

If you ever need to change/expand the original menu design, the source members must be available for SDA to use.

Page 123: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

123

Week # 7 Designing the Menu

After you take option 2, Design menus, from the initial SDA screen, the Design Menus screen appears, and then information from the most recently created menu will be filled in or the screen will be mostly blank if you have not created a menu before. The Library value defaults to *LIBL.

If changing an existing menu, SDA would locate the source members using the menu name we provide and then retrieve them.

Page 124: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

124

Week # 7 Designing the Menu (Continued)

Type the menu name and press Enter to get the Specify Menu Functions screen, and from this screen choose to work with the menu image (screen layout) and commands or to work with online Help for the menu.

Keep the defaults Y for Work with menu image and commands and N for Work with menu help and press Enter. You’ll get SDA’s Menu template screen.

Page 125: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

125

Week # 7 Designing the Menu (Continued)

Work with Menu Image screen lets you:

Add descriptions for menu selections

Change the header Use function keys to access a

screen to enter menu commands

Page 126: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

126

Week # 7 Designing the Menu (Continued)

Work with Menu Image screen (continued):Important points:

Lines 1 through 20, the body of the menu, identify the menu and also label and explain its selections.

The words and numbers used to do so are called constants -- constants are one type of field that SDA uses, and they are the main type used with menus.

Each constant may consist of a single word or number or of several words together (e.g., a menu selection title).

Page 127: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

127

Week # 7 Designing the Menu (Continued)

Work with Menu Image screen (continued):Important points (continued):

You type constants on the screen enclosed in apostrophes ('), but when you press Enter to save the constants, the apostrophes disappear.

On the starting menu template, the numbers for the selections are provided, but you need to enter the title of each selection as a constant. (From this point on, any general reference to fields includes constants.)

Page 128: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

128

Week # 7 Designing the Menu (Continued)

Work with Menu Image screen (continued):Important points (continued):

Another special type of field that can be used in menus is a system function that lets you display system values.

Of these special fields, the most commonly used are *DATE and *TIME.

You can also use the fields *USER and *SYSNAME to display user ID and system name, respectively.

Page 129: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

129

Week # 7 Designing the Menu (Continued)

Work with Menu Image screen (continued):

Important points (continued):Once you’ve entered fields, you can shift them

right or left on a line, move them to a different line, or delete them.

An attribute byte immediately precedes each field; the attribute byte is the single-character blank position to the left of a field’s leftmost character. This byte is always reserved for controlling the field to which it is prefixed. You cannot see the attribute byte, but you can use it to perform operations on the field.

Page 130: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

130

Week # 7 Designing the Menu (Continued)

Work with Menu Image screen (continued):

Important points (continued):

You can use operations, or attribute commands, to:

Change the appearance of a field Move a field on the work screen Call up a list of different attributes for a

field Delete a field

Page 131: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

131

Week # 7 Designing the Menu (Continued)

Work with Menu Image screen (continued):

Important points (continued):Enter an attribute command starting on the

attribute byte.

If the command is longer than one character (most are), type over the constant or data field -- it will return as soon as the command is run.

You can key attribute commands for several different fields and then process them at the same time, when you press the Enter key.

Page 132: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

132

Week # 7 Specifying Attributes

Here are several commonly used attribute commands that control positioning:

AttributeCommand Function

AC Centers the field on the line- Moves the field when you use the

target =- Copies the field when you use the

target== (two equal signs)

Page 133: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

133

Week # 7 Specifying Attributes (Continued)

When you reposition a field, be careful not to overlap another field or SDA will refuse to cooperate.

Attribute commands that determine appearance:

AttributeCommand Function

B Makes the field blinkH Displays the field in high intensityR Displays the field in reverse imageU Underlines the field

Page 134: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

134

Week # 7 Specifying Attributes (Continued)

Attribute commands that determine color:

AttributeCommand Function

CB Displays in blueCG Displays in greenCP Displays in pinkCR Displays in redCT Displays in turquoiseCW Displays in whiteCY Displays in yellow

Page 135: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

135

Week # 7 Specifying Attributes (Continued)

To turn off any of the appearance or color attributes, you type a minus or hyphen (-) in the attribute byte, followed by the same command used to turn on the attribute.

Remember, the leftmost character of the attribute command must start in the attribute byte of the constant or field; if part of the constant or field is erased by the rest of the command, it will be restored after the command is entered.

Page 136: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

136

Week # 7 Specifying Attributes (Continued)

You can shift fields left or right by stringing together the < (shift left) or > (shift right) symbols. To shift a field left, you would type the first < on the column where the leftmost character of the field is to be repositioned and then type additional < characters up to and including the attribute byte. For example, the command

<<<<<STUMNU Menu

would move the title five positions to the left.

Page 137: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

137

Week # 7 Specifying Attributes (Continued)

To shift a field right, you would start in the first position immediately following the constant or field. For example, the command

STUMNU Menu>>>>>

would move the title five positions to the right. As for the existence of a field, the attribute

command D deletes the field. You can also delete a field by starting on the attribute byte and using the spacebar to erase the field.

Page 138: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

138

Week # 7 Specifying Attributes (Continued)

Warning: Do not use the Insert and/or Delete key on the keyboard to change the contents of a constant, either while entering the constant or once it is entered.

You can delete (using attribute command D) the constant and rekey it if it has already been entered.

You can type over a constant to make changes before it is entered. If you forget and make a mistake, function key F5 undoes most errors.

Page 139: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

139

Week # 7 Setting Field Attributes

You can access an entire screen of display options for a field by entering an asterisk (*) in the attribute byte. (The exact content of the screen depends on the type of field and whether you are working with a menu or display file.)

A menu title is automatically displayed in high intensity, which translates to the color white on color monitors.

Page 140: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

140

Week # 7 Using Attribute Commands

In the SDA Menu screen template notice how by default the date and time fields have been formatted with editing characters added.

When the completed menu is used by a GO command, the current date and time system values will be displayed using the format indicated.

Page 141: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

141

Week # 7 Defining Menu Commands

To enter commands that will be executed for each menu selection, use Function key F10, listed at the bottom of the menu template screen.

Press F10 to get the Define Menu Commands screen.

On this screen, use the prompter (F4) for commands entered on the blank lines following the selection numbers.

Page 142: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

142

Week # 7 Defining Menu Commands

Initially the Define Menu Commands display includes all options from 01 to 99 and entry fields for each command to be typed in. You can view the higher-numbered options by paging down; to immediately position a certain option at the top of the display, type its number in the “Position to menu option” field.

Page 143: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

143

Week # 7 Defining Menu Commands (Continued)

Use F11 to display only those options for which we have entered a command.

Page 144: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

144

Week # 7 Defining Menu Commands (Continued)

The view in Define Menu Commands “Defined only options” Display in our example eliminates option numbers that have no commands and makes it much easier to see and change commands for each of the options that will be allowed on the menu.

F11 acts as a toggle switch between one view and another, as usual.

Press F3 to return to the Design Menus screen and then F3 again to exit to get back to the Specify Menu Functions display.

Press F3 to go to the Exit SDA Menus screen.

Page 145: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

145

Week # 7 Exiting SDA Menus

The Exit SDA Menus screen first asks whether you want to keep the results of your work session (Save new or updated menu source).

If you were not finished with the menu and planned to work on it more in a later session, or if you were done and wanted SDA to create (compile) an executable menu, you would choose Y here.

You would choose N only if you did not want to keep any changes or new entries you had made.

Page 146: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

146

Week # 7 Exiting SDA Menus (Continued)

Notice that two source members will be

saved:

The DDS member

The Commands member

Page 147: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

147

Week # 7 Exiting SDA Menus (Continued)

The values for Source file and Library name came from the entries we made on the Design Menus screen. For our example, we would take the rest of the defaults because we do want to save the source (in QDDSSRC) and we do want to create menu objects. We could change the value of Object library and put the compiled objects in any library we were authorized to use.

Page 148: 1 Week # 7 - Agenda DFU Overview Query/400 Overview SDA Overview Websphere Development Studio Client (WDSC) File Transfer using Client Access & IFS

148

Week # 7 Exiting SDA Menus (Continued)

After we press Enter from the Exit SDA Menus screen, the message “SDA is compiling menu xxxxxx” appears briefly at the bottom of the display and then we are returned to the Design Menus screen.

When we return to the Work with Objects Using PDM screen, we would find three new objects in our current library list.