The IBM Application System/400 popularly known as AS/400 is a family of mid-range business computing systems, that supersedes IBM's highly successful System/3X family. The AS/400 is available in three different types the 9402, 9404, and the 9406.
Currently, here at Minnesota State University, Mankato, the Computer Services is supporting a dual processor IBM AS/400 9406 model D80, that contains 192 Megabytes of primary memory and 7.1 Gigabytes of mirrored secondary storage.
The AS/400 systems exclusively use the IBM Operating System/400 (OS/400). It is a multi-user operating system that works with the Licensed Internal Code (LIC) instructions to implement the functions that are basic to the AS/400 architecture. OS/400 can perform tasks under direct control of both the user and an application program.
The AS/400 system differs from the traditional systems in several ways. They offer more compatibility across the product line since only one operating system and architecture is used consistently across the entire family. The system offers very high performance compared to the earlier System/3X computers. This is achieved by a combination of faster processors, extended storage and improved fixed disk systems. The software architecture is different from that of more traditional systems. Implementing functions such as security, database and communications in microcode, and providing a one-piece operating system resulted in improved efficiency, consistency and simplicity.
The AS/400 marks a new beginning in the business computing world. This new generation of systems with advanced technology and advanced applications serve as a growth platform for the customer to expand in application, size and network complexity.
Sign On
System . . . . . : MKTAS400
Subsystem . . . . : QINTER
Display . . . . . : PCnnnnS1
User . . . . . . . . . . . . . . __________
Password . . . . . . . . . . . .
Program/procedure. . . . . . . . __________
Menu . . . . . . . . . . . . . . __________
Current library. . . . . . . . . __________
If for some reason you can not longer type, press the <Reset>key. On the Microterms or PC-VT this would be the <Esc>key then R. On PC Support/400 this would be the left <Ctrl>key.
If this is the first time you signed on continue with the Changing your password section of this manual.
For all displays, the following information is provided:
If the <Help>key is pressed when the cursor is in an area where specific on-line help information is available, the help text for that area of the display is shown.
If the <Help>key is pressed when the cursor is in an area for which no specific information is available, information for the entire display is shown. Then you can page forward or backward through the information for the entire display and for each area.
If the <Help>key is pressed while a help display is shown, a description of the types of help that are available on the displays, and how to get each type of help is shown.
The <Help>key on the PC Support stations is labeled <Scroll Lock>. On the VT-100 or PC-VT stations the key sequence for < Help>is <ESC>h.
If <F11>=Search index is shown at the bottom of the display, you can press <F11>to see the Search Help Index display. On that display, you can request information about any topic you specify.
Send Message (SNDMSG)
Type choices, press Enter.
Message text . . . . . . . . . . ________________________________________
__________________________________________________________________________
__________________________________________________________________________
__________________________________________________________________________
__________________________________
To user profile . . . . . . . . . __________ Name , *SYSOPR, *ALLACT...
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=cancel
F13=How to use this display F24=More keys
To execute the command, supply the required information for Message text and user profile and press <Enter>. Most of the parameters used on commands have default values that are used if no other value is specified. You may change the default values if you desire to do so.
If <F4>= Prompt is shown on the prompt display, you can press < F4>to request a list of predefined values (such as *SYSOPR and *ALLACT in the above display) that are permitted in the field where the cursor is currently positioned.
In relation to the SNDMSG command, you can use DSPMSG at any time to display messages in your message queue.
A physical file contains actual data stored on the system. It has a fixed-length record format. In this manual, we are primarily interested in two kinds of physical files:
A data physical file (*FILE PF-DTA) contains data that cannot be compiled, such as an input file to a program. In conventional terms, a data physical file is a data file, for example an employee master file. A data physical file normally has a record format. This record format is defined using Data Description Specifications (DDS is a language that is used to describe database files to the system). This description is then compiled to produce a *FILE object with attribute PF-DTA.
A source physical file (*FILE PF-SRC) contains source statements, for example the source statements of a Pascal or COBOL program. A source physical file has the attribute "PF-SRC". It is usually created using the "Create Source Physical File" (CRTSRCPF) command (more information about this command will be given later). A source physical file is actually a special type of data physical file. The CRTSRCPF command creates a physical file with attributes appropriate for source physical files. For example, the default record length is 92 (80 for the source data field, 6 for the sequence number field, and 6 for the date field. Refer to the section on the SEU editor for the meanings of these fields.)
The data records in a data physical file can be grouped into members. A data physical file may contain one or more members. These members are not objects themselves but subsets of an object. This implies that all members of an object share the same basic characteristics with the other members in the object such as ownership and security. In a PF-SRC file, each member contains source statements for a program or DDS source. Members have an attribute associated with them, which in the case of PF-SRC members, determines how the various systems programs (such as the editor and compilers) on the AS/400 treat the member. This attribute is specified when creating the member, and allows compilation to be totally automatic. Once, for example, a member has been specified as having an attribute of CBL (for COBOL program,) the AS/400 editor, SEU, will format the program as a COBOL program, and when PDM (Program Development Manager) is given the instruction to compile the file, it "knows" that it should invoke the COBOL compiler. An example of a PF-SRC file and its members is shown below (we will explain how to get to this screen in the section on PDM):
Work with Members Using PDM
File . . . . . . SRCFILE___
Library . . . . YOURLIB___ Position to . . . . __________
Type options, press Enter.
2=Edit 3=Copy 4=Delete 5=Display 6=Print
7=Rename 8=Display description 9=Save 13=Change text ...
Opt Member Type Text
__ NAMEEMP LF Sample DDS Source for a Logical File
__ CLPROG CLP Sample Control Language Source Program
__ RPGPROG RPG Sample RPG Source Program
__ EMPMAST PF Sample DDS Source for a Physical File
__ SCRNMBR DSPF Sample DDS Source for a Display File
Parameters or command
===> ___________________________________________________________
F3=Exit F4=Prompt F5=Refresh F6=Create
F9=Retrieve F10=Command entry F23=More options F24=More keys
The name of the source physical file is SRCFILE, and it is contained in the library YOURLIB. Although, in the above example, source members of different types are stored in the same source physical file, you will probably want to store source programs of the same type in a separate source physical file. For example, you may want to keep all your RPG source programs in a PF-SRC file called, for example, "RPGSRC" and DDS source in a PF-SRC file called, for example, "DDSSRC". You may also use the standard IBM-supplied names such as "QRPGSRC", "QDDSSRC", and "QCLSRC" for the various PF-SRC files. However, you may choose to include source members of different types belonging to the same application in the same PF-SRC file, as in the above example.
In a data physical file (PF-DTA), the member(s) contains data for use by programs. Normally, a PF-DTA file will only have one member (by default, the member's name is the same as the file name). However, it is possible to include multiple members in a single PF-DTA file. For example, you may want to group the records in a sales transactions file so that each member contains data for each month. In this way, each month's data can be processed separately by processing one member at a time. It is important to understand, at this point, the difference between "source" and "data" in regards to data physical files. In the "Work with Members using PDM" screen above, the "PF" member, "EMPMAST", contains DDS source that defines a physical file. When this source member is compiled (using CRTPF or option 14 in the "Work with Members using PDM" screen), it will produce a *FILE object with attribute PF-DTA. This compiled object is the actual file that is used to hold data records.
A data logical file (*FILE LF-DTA) is a data file that contains no actual data, but provides a different method of viewing the data of an accompyning data physical file(s) which it internally references. It is similar to the concept of a "view" in SQL. A data logical file is described to the system using DDS. When the DDS source is compiled, a *FILE object with the attribute LF-DTA is produced.
Another *FILE object type that you may encounter in your programming courses is the device file. A device file contains a description how data is to be presented to a program from a device or vice versa. Two common types of device files are printer files (*FILE PRTF) and display files (*FILE DSPF). A printer file describes the attributes that printed output will have, such as the length and width of a printed page. A printer file can be created using the "Create Printer File" (CRTPRTF) command. A display file describes what information is to be displayed and where it is to be displayed on the screen of a display station. One way of defining and creating a display file is with the Screen Design Aid (SDA) utility.
An important object type on the AS/400 is the output queue (*OUTQ). On the AS/400, whenever something is printed, the output goes to an output queue and it stays there as a spooled file. A spooled files, like a member, is not an object itself but a subset of an object. The spooled file stays in the output queue until it is directed to a printer or removed. An output queue has already been created for you with the creation of your user profile. The name of the output queue is normally the same as that of your user profile. Refer to the section "Printing Procedure" in this manual for more information on printing spooled files.
The relationships between the various objects that have been discussed in this section are as follows:
QSYS (*LIB)
[special library]
|
| contains
|
Library (*LIB)
|
| contains
|
.------------------+----^-----------------.--------.
| | | |
Programs (*PGM) Outqueues (*OUTQ) Files (*FILE) Other
[Executable] | | objects
| contains |
Spooled Files |
[Output intended for Printer] |
|
.----------------^--.
| |
Physical Data Logical
file file
(PF) (LF-DTA)
| ^ contains
.------^-----. Member(s)
| | [Reorginized data]
Source Data
Physical Physical
File File
(PF-SRC) (PF-DTA)
| |
contains | | contains
| |
Member(s) Member(s)
[Program source] [Actual Data]
To create a library, type the CRTLIB ("Create Library") on a command line and press <F4>to prompt on it. Type in the name of the library and enter a brief description for the library. Leave the library type as *PROD (a production library is one that is used for normal processing).
Create Library (CRTLIB)
Type choices, press Enter.
Library . . . . . . . . . . . . YOURLIB__ Name
Library type . . . . . . . . . . *PROD____ *PROD, *TEST
Text 'description' . . . . . . . Sample_Library__________________
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys
Press <Enter>. You should see a message at the bottom of the screen saying "Library ... created". If you see the message "Library ... already exists", it means that some other user already has a library by the same name. Note: All libraries are on the same "level" with only QSYS above them. If you get this message, try another name for the library. Other commands that operate on libraries are:
Create Source Physical File (CRTSRCPF)
Type choices, press Enter.
File . . . . . . . . . . . . . . SRCFILE___ Name
Library . . . . . . . . . . . YOURLIB___ Name, *CURLIB
Record length . . . . . . . . . 92_______ Number
Member, if desired . . . . . . . *NONE_____ Name, *NONE, *FILE
Text 'description' . . . . . . . Sample_Source_File___________________
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys
Display Library List
System: MKTAS400
Type options, press Enter.
5=Display objects in library
Opt Library Type Text
__ QSYS SYS System Library
__ QHLPSYS SYS
__ QUSRSYS SYS *IN USE
__ JOHNDOE CUR JOHN DOE's default library
__ QTEMP USR
__ QGDDM USR
__ QGPL USR GENERAL PURPOSE LIBRARY
__ QMSU USR MSU generated commands and programs
__ QPAS USR
__ MBNLQ USR Common Library for MBNLQ ..
__ ONLINE USR COLLECTION - created by SQL
F3=Exit F12=Cancel F17=Top F18=Bottom
If a user does not specify a library name when requesting an operation on an object, the libraries in the library list are searched for the object (starting with the system libraries, the current library, and the user libraries). For example, assume that the user "JOHNDOE" has an executable program (*PGM object) called "TESTPROG" in the library "YOURLIB". User "JOHNDOE" wants to run the program (using the CALL command) and issues the command CALL TESTPROG. A message will appear stating that the program is not found in the library list. This is because "YOURLIB" is currently not in the library list. If, however, "TESTPROG" is qualified by "YOURLIB" as CALL YOURLIB/TESTPROG then the program can be found and executed.
To add a library to the library list, type the "Add Library List Entry" (ADDLIBLE) command, followed by the library name (or prompt on the command) ADDLIBLE YOURLIB.
If "JOHNDOE" now issues the the unqualified CALL command, the program can now be located and executed since the library that contains the program is now in the library list. You can edit your library list using the EDTLIBL command and remove a library list entry using the RMVLIBLE command. "YOURLIB" can be made the current library by typing CHGCURLIB YOURLIB.
Some commands automatically default to the current library (*CURLIB), such as the CRTSRCPF command. Note, however, that both commands (ADDLIBLE and CHGCURLIB) are only effective for a particular session. Next time, when "JOHNDOE" signs on, "YOURLIB" will no longer be in their library list and hence, no longer the current library. In the section "Steps in Developing a Program", we will create an "initial program" that will automatically run these commands when a user signs on the system.
Work with Objects Using PDM (WRKOBJPDM)
Type choices, press Enter.
Library . . . . . . . . . . . . *PRV______ *PRV, name, *CURLIB
Object . . . . . . . . . . . . . *ALL______ *PRV, name, *generic...
Object type . . . . . . . . . . *ALL______ *PRV, *ALL, *ALRTBL, *AUTL..
Object attribute . . . . . . . . *ALL______ *PRV, attribute, *generic...
F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display
F24=More keys
The *PRV value on the "Library" field indicates that the default is to work on the library the user last worked with. These may be replaced with the name of a specific library. The "Object" and "Object type" options allow the user to limit which objects will be displayed. Type WRKOBJPDM and prompt with <F4>.
Work with Objects Using PDM (WRKOBJPDM)
Type choices, press Enter.
Library . . . . . . . . . . . . YOURLIB___ *PRV, name, *CURLIB
Object . . . . . . . . . . . . . *ALL______ *PRV, name, *generic*...
Object type . . . . . . . . . . *ALL______ *PRV, *ALL, *ALRTBL, *AUTL..
Object attribute . . . . . . . . *ALL______ *PRV, attribute, *generic...
F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display
F24=More keys
The screen resulting from command WRKOBJPDM, with the library specified as YOURLIB, and *ALL on the other options, is shown below.
Work with Objects Using PDM
Library . . . . . YOURLIB___ Position to . . . . . . __________
Position to type . . . . __________
Type options, press Enter.
2=Change 3=Copy 4=Delete 5=Display 7=Rename
8=Display description 9=Save 10=Restore 11=Move ...
Opt Object Type Attribute Text
__ SRCFILE *FILE PF-SRC Sample Source File
Bottom
Parameters or command
===> ________________________________________________________________
F3=Exit F4=Prompt F5=Refresh F6=Create
F9=Retrieve F10=Command entry F23=More options F24=More keys
Presently, there should be just one object in the library, the source physical file "SRCFILE" that you have just created.
There are two important special features which this method of specifying actions offers: First, the options support the prompting facility, and second, multiple objects may be operated on in succession. To use the prompting facility, simply press <F4> while an option number is on one of the "Opt" lines. PDM will present the prompt screen for the command associated with that option number. Multiple objects may be operated on sequentially by placing numbers on more than one Opt line. For example, assume we have two source files in "YOURLIB". You can type "5" (Display) against one and type "7" (Rename) against the other. Pressing <Enter> causes PDM to process each option in turn.
When this method of changing levels is used, pressing <Enter> or <F12> (cancel) with no options on the screen returns to the previous level.
Type "12" against "SRCFILE" to work with it. The following "Work with Members using PDM" screen appears:
Work with Members Using PDM
File . . . . . . SRCFILE___
Library . . . . YOURLIB___ Position to . . . . __________
Type options, press Enter.
2=Edit 3=Copy 4=Delete 5=Display 6=Print
7=Rename 8=Display description 9=Save 13=Change text ...
Opt Member Type Text
(No members in file)
Parameters or command
===> ________________________________________________________________
F3=Exit F4=Prompt F5=Refresh F6=Create
F9=Retrieve F10=Command entry F23=More options F24=More keys
Presently, there are no members in "SRCFILE". Let's create a member. To do that, press <F6> (Create). This will automatically invoke the SEU editor. Enter the name of the new source member and for its source type, enter "TXT" (i.e. the source member will contain only plain text). Press <Enter> .
Start Source Entry Utility (STRSEU)
Type choices, press Enter.
Source file . . . . . . . . . . > SRCFILE___ Name, *PRV
Library . . . . . . . . . . . > YOURLIB___ Name, *LIBL, *CURLIB, *PRV
Source member . . . . . . . . . SRCMBR____ Name, *PRV, *SELECT
Source type . . . . . . . . . . TXT_______ Name, *SAME, BAS, BASP, C...
Text 'description' . . . . . . . Sample_Source_Member____________________
Bottom
F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display
F24=More keys
You will now be inside the SEU editor. For now, press <F3> to quit and type "Y" in the "Change/Create member" field to save the source member. Later on, in the section on SEU we will use this source member. On return to the WRKMBRPDM screen, you will notice that "SRCMBR" is now in "SRCFILE".
The "Work with Members using PDM" screen can be accessed directly using the WRKMBRPDM command. Type this command and press <F4> to prompt on it. To work with the member that we have just created, enter the names of the library and file as shown below. If you have many members in your file, you can use the "Member" and/or "Member Type" fields to narrow down the number of members to work with.
Work with Members Using PDM (WRKMBRPDM)
Type choices, press Enter.
File . . . . . . . . . . . . . . SRCFILE___ *PRV, name
Library . . . . . . . . . . . YOURLIB___ *PRV, name, *LIBL, *CURLIB
Member . . . . . . . . . . . . . *ALL______ *PRV, name, *generic...
Member type . . . . . . . . . . *ALL______ *PRV, type, *generic...
F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display
F24=More keys
2: Change Modify an object or edit a source member 3: Copy Duplicate an object 4: Delete Remove an object from storage 5: Display Display the contents of an object 6: Print Copy a source member to an output queue 7: Rename Change an object's name 8: Display Descrip. Show summary information about an object 9: Save Save an object to offline storage 10: Restore Retrieve an object from offline storage 11: Move Move an object to another library 12: Work With Perform operations on the contents of an object 13: Change Text Change the text description line for an object 14: Compile Compile a source physical file member 15: Copy File Copy a *FILE object (has special options) 16: Run Run an object of type *PGM 17: Change Using SDA Change a screen design (in a PF-SRC) using SDA 18: Change Using DFU Use DFU to change a PF-DTA member 25: Find String Find a string of characters in an object
F1: Help Obtain help on an area of PDM F3: Exit Exit PDM or current operation F4: Prompt Display prompt screen for options on screen F5: Refresh Redraw the screen with updated information F6: Create Create a library, file, or member F9: Retrieve Recall a previous command to the command line F10: Command Entry Display an OS/400 command entry screen F11: Display Toggle Switch to/from brief display mode F12: Cancel Cancel an operation F13: Repeat Copy an option number to all lines F14: Source Type Toggle Switch between date and type display in PF-SRC F15: Sort Change member list sort criteria F16: User Options Specify user-defined commands to PDM F17: Subset Limit the list on the screen to certain types F18: Change Defaults Change PDM user settings F21: Print List Print the object list on the screen F23: More Options Display more PDM option numbers, if available F24: More Keys Display more function keys, if available
The subject component of the command specifies the item that the verb acts on. Some examples of verb/subject combinations are:
CL commands can be found in several ways. The command GO CMDxxx can be used to get a menu of commands related to xxx (where xxx can be a verb or subject). Another way of finding commands is to press <F4> on any command line. This will bring up the "Command Grouping Menu" where each option represents a group of related commands. The first option SLTCMD ("Select Command by Name") can be used to obtain a list of commands using a wildcard character (e.g. SLTCMD CR* will list all commands starting with CR).
So far in this manual, we have been using the <F4> prompt facility for specifying parameters. Another way of specifying parameters is the free format or command line method. You may want to use this method if you remember exactly what parameter information is needed for a command. Using this method, parameters can be specified in:
A parameter that is specified in keyword form will have a keyword followed immediately by a value (or list of values). For example, WRKOBJPDM LIB(YOURLIB) OBJ(SRCFILE) There must not be any blanks between the keyword and the left parenthesis. Parameters in keyword form can be specified in any order.
In the positional form, parameters are specified without keywords. The parameter values must be positionally matched with the keywords in the parameter set for that command. The above example can be specified in positional form as follows WRKOBJPDM YOURLIB SRCFILE.
Positional parameters are often limited to the first three or four parameters. If you do not want to specify a value for one of the parameters, the system-defined value, *N, can be entered in the position of that parameter. For example, the following command will display all objects of type *FILE in the library YOURLIB. WRKOBJPDM YOURLIB *N *FILE *N will map to the default value for that parameter, which in this case is *ALL. Note that when using the WRKMBRPDM command, the file name and library name fields are actually one parameter (a file name plus a library qualifier). If the reference is to a file in a specific library, the file name must be qualified with a slash, "/", character in both keyword and positional forms WRKMBRPDM YOURLIB/SRCFILE SRCMBR WRKMBRPDM FILE(YOURLIB/SRCFILE) MBR(SRCMBR)
If only the file name is specified, as in the following statement WRKMBRPDM SRCFILE the library qualifier will default to the library list (*LIBL).
A CL command can use a combination of both positional and keyword parameters, for example WRKMBRPDM YOURLIB/SRCFILE MBRTYPE(TXT). Note that the "Member" parameter, which is in between the second and third parameters in the parameter set, is omitted. One restriction of this mixed form of specifying parameters is that positional parameters cannot follow keyword parameters. For example, the following is invalid WRKOBJPDM LIB(YOURLIB) SRCFILE.
Another tool is the Source Entry Utility (SEU) that offers a full screen editor providing syntax checking of source statements. PDM is one tool that may be used to access the SEU.
In this SEU tutorial, we will use the source member we created in the previous section.
Type 2 on the "Opt" line to edit the source member "SRCMBR".
Press <Enter> . You are now in the full-screen EDIT mode.
Columns . . . .: 1 80 Edit
SEU==>_______________________________________________________ SRCMBR
FMT ** ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5...+... 6 ...+.
*************** Beginning of data ********************************
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
****************** End of data ***********************************
F3=Exit F4=Prompt F5=Refresh
F10=Top F11=Bottom F24=More keys
If you press <Enter> without typing anything, the screen readjusts as shown:
Columns . . . .: 1 80 Edit
SEU==> _______________________________________________________ SRCMBR
FMT ** ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5...+... 6 ...+.
*************** Beginning of data *********************************
****************** End of data ************************************
F3=Exit F4=Prompt F5=Refresh
F10=Top F11=Bottom F24=More keys
Columns . . . .: 1 80 Edit
SEU==> _______________________________________________________ SRCMBR
FMT ** ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5...+... 6 ...+. I
*************** Beginning of data *********************************
****************** End of data ************************************
Now, you may start typing in the desired text. Below, we show a sample TEXT document that will be used in the next section for illustrating the use of various SEU line commands.
Columns . . . .: 1 80 Edit
SEU==> _________________________________________________________ SRCMBR
FMT ** ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5...+... 6 ...+.
*************** Beginning of data *********************************
0001.00 THIS IS A TEXT DOCUMENT.
0002.00
0003.00 Begin First Block.
0004.00 Text for the first block ...
0005.00 End First Block.
0006.00
0007.00 Begin Second Block.
0008.00 Text for second block ...
0009.00 End Second Block.
0010.00
****************** End of data ************************************
Notice the sequence numbers of records at the extreme left. The sequence number field of a record is used to specify the line commands. For more information on line commands see 'Using SEU line commands'.
To save the current member and exit SEU follow the following procedure 'Exiting the Editor.'
Exit
Type choices, press Enter.
Change/create member . . . . . . . Y Y=Yes, N=No
Member . . . . . . . . . . . . . SRCMBR____ Name
File . . . . . . . . . . . . . . SRCFILE___ Name
Library . . . . . . . . . . . . YOURLIB___ Name
Text . . . . . . . . . . . . . . Description_for_the_member._____
Resequence member . . . . . . . . Y Y=Yes, N=No
Start . . . . . . . . . . . . . 0001.00___ 0000.01 - 9999.99
Increment . . . . . . . . . . . 01.00____ 00.01 - 99.99
Print member . . . . . . . . . . . N Y=Yes, N=No
Return to editing . . . . . . . . . N Y=Yes, N=No
Go to member list . . . . . . . . . N Y=Yes, N=No
F3=Exit F5=Refresh F12=Cancel
If you wish to save the changes you have made, you may simply press < Enter> .
The default values supplied for most of the options above are self-explanatory. However, note the following:
To edit a member that has already been created,
For example, to edit the member SRCMBR created before, type WRKMBRPDM YOURLIB/SRCFILE on any command line, and press < Enter> . From the "Work with members using PDM" display, type option 2 in front of member SRCMBR and press <Enter> . The edit display for this member is shown:
Columns . . . .: 1 71 Edit YOURLIB/SRCFILE
SEU==> _________________________________________________________ SRCMBR
FMT CB
......-A+++B++++++++++++++++++++++++++++++++++++++++++++++++++++++
*************** Beginning of data ********************************
0001.00 THIS IS A TEXT DOCUMENT.
0002.00
0003.00 Begin First Block.
0004.00 Text for the first block ...
0005.00 End First Block.
0006.00
0007.00 Begin Second Block.
0008.00 Text for second block ...
0009.00 End Second Block.
0010.00
****************** End of data ***********************************
F3=Exit F4=Prompt F5=Refresh
F10=Top F11=Bottom F24=More keys
*************** Beginning of data ********************************
I001.00 THIS IS A TEXT DOCUMENT.
0002.00
0003.00 Begin First Block.
0004.00 Text for the first block ...
0005.00 End First Block.
0006.00
0007.00 Begin Second Block.
0008.00 Text for second block ...
0009.00 End Second Block.
0010.00
****************** End of data ***********************************
F3=Exit F4=Prompt F5=Refresh
F10=Top F11=Bottom F24=More keys
The screen adjusts as shown below. Type in the line to be inserted and press <Enter> .
Columns . . . .: 1 71 Edit YOURLIB/SRCFILE
SEU==> ________________________________________________________ SRCMBR
FMT CB
......-A+++B+++++++++++++++++++++++++++++++++++++++++++++++++++++ +
*************** Beginning of data ********************************
0001.00 THIS IS A TEXT DOCUMENT.
''''''' PROGRAM-ID. SAMPLE.
0002.00
0003.00 Begin First Block.
0004.00 Text for the first block ...
0005.00 End First Block.
0006.00
0007.00 Begin Second Block.
0008.00 Text for second block ...
0009.00 End Second Block.
0010.00
****************** End of data ***********************************
F3=Exit F4=Prompt F5=Refresh
F10=Top F11=Bottom F24=More keys
Columns . . . .: 1 71 Edit YOURLIB/SRCFILE
SEU==> _________________________________________________________ SRCMBR
FMT CB
......-A+++B++++++++++++++++++++++++++++++++++++++++++++++++++++++
*************** Beginning of data ********************************
0001.00 THIS IS A TEXT DOCUMENT.
0001.01 It illustrates the use of SEU line commands.
0002.00
C Begin First Block.
0004.00 Text for the first block ...
0005.00 End First Block.
0006.00
0007.00 Begin Second Block.
0008.00 Text for second block ...
0009.00 End Second Block.
0010.00
****************** End of data ***********************************
Type A (after) on the last line as shown, and press Enter. This results in the pending line to be copied after the line you have indicated.
Columns . . . .: 1 71 Edit YOURLIB/SRCFILE
SEU==> __________________________________________________________ SRCMBR
FMT CB
......-A+++B++++++++++++++++++++++++++++++++++++++++++++++++++++++
*************** Beginning of data********************************
0001.00 THIS IS A TEXT DOCUMENT.
0001.01 It illustrates the use of SEU line commands.
0002.00
C Begin First Block.
0004.00 Text for the first block ...
0005.00 End First Block.
0006.00
0007.00 Begin Second Block.
0008.00 Text for second block ...
0009.00 End Second Block.
A010.00
****************** End of data ************************************
The program looks as shown below, after the copy. To move a single line, use the command M (move) and follow the procedure as explained above for copy.
*************** Beginning of data ********************************
0001.00 THIS IS A TEXT DOCUMENT.
0001.01 It illustrates the use of SEU line commands.
0002.00
0003.00 Begin First Block.
0004.00 Text for the first block ...
0005.00 End First Block.
0006.00
0007.00 Begin Second Block.
0008.00 Text for second block ...
0009.00 End Second Block.
0010.00
0011.00 Begin First Block.
****************** End of data ***********************************
*************** Beginning of data*****************************
0001.00 THIS IS A TEXT DOCUMENT.
0001.01 It illustrates the use of SEU line commands.
0002.00
0003.00 Begin First Block.
0004.00 Text for the first block ...
0005.00 End First Block.
0006.00
0007.00 Begin Second Block.
0008.00 Text for second block ...
0009.00 End Second Block.
0010.00
D011.00 Begin First Block.
****************** End of data ***********************************
*************** Beginning of data ********************************
0001.00 THIS IS A TEXT DOCUMENT.
0001.01 It illustrates the use of SEU line commands.
0002.00
MM Begin First Block.
0004.00 Text for the first block ...
0005.00 End First Block.
MM
0007.00 Begin Second Block.
0008.00 Text for second block ...
0009.00 End Second Block.
0010.00
****************** End of data ***********************************
Type A on the last line to move the block to the end of the program.
*************** Beginning of data ********************************
0001.00 THIS IS A TEXT DOCUMENT.
0001.01 It illustrates the use of SEU line commands.
0002.00
MM Begin First Block.
0004.00 Text for the first block ...
0005.00 End First Block.
MM
0007.00 Begin Second Block.
0008.00 Text for second block ...
0009.00 End Second Block.
A010.00
****************** End of data ***********************************
Here is the member after the move:
*************** Beginning of data ********************************
0001.00 THIS IS A TEXT DOCUMENT.
0001.01 It illustrates the use of SEU line commands.
0002.00
0007.00 Begin Second Block.
0008.00 Text for second block ...
0009.00 End Second Block.
0010.00
0011.00 Begin First Block.
0012.00 Text for the first block ...
0013.00 End First Block.
0014.00
****************** End of data ***********************************
*************** Beginning of data ********************************
0001.00 THIS IS A TEXT DOCUMENT.
0001.01 It illustrates the use of SEU line commands.
0002.00
CC Begin Second Block.
0008.00 Text for second block ...
0009.00 End Second Block.
CC
0011.00 Begin First Block.
0012.00 Text for the first block ...
0013.00 End First Block.
B
****************** End of data ***********************************
*************** Beginning of data ********************************
0001.00 THIS IS A TEXT DOCUMENT.
0001.01 It illustrates the use of SEU line commands.
0002.00
0007.00 Begin Second Block.
0008.00 Text for second block ...
0009.00 End Second Block.
0010.00
0011.00 Begin First Block.
0012.00 Text for the first block ...
0013.00 End First Block.
DD Begin Second Block.
0013.02 Text for second block ...
0013.03 End Second Block.
DD
0014.00
****************** End of data ***********************************
The source member looks as follows, after our experimentation with the above line commands:
*************** Beginning of data ********************************
0001.00 THIS IS A TEXT DOCUMENT.
0001.01 It illustrates the use of SEU line commands.
0002.00
0007.00 Begin Second Block.
0008.00 Text for second block ...
0009.00 End Second Block.
0010.00
0011.00 Begin First Block.
0012.00 Text for the first block ...
0013.00 End First Block.
0014.00
****************** End of data ***********************************
To get a complete list of commands for SEU place the cursor on the sequence number list and press the help key.
Use the F16 "Repeat Find" key to find the next occurrence of a string.
______________________________________________________________________________
Key Name Function
______________________________________________________________________________
F1 Help Press the help key for details about the display.
F3 Exit End the current task, returns to previous entry point.
F4 Prompt Provides assistance for the options selected
in the list or a command on a command line.
PDM will fill in the default values.
F5 Refresh Refresh the current display. Rebuilds display and
shows it again.
F10 Cursor Moves the cursor from the data area to the SEU
command line, and from the SEU command line to
the data area.
F11 Previous Record Places the previous record in the prompt.
F13 Change Session Go to the Change Session Defaults Defaults
display.
F14 Find/Change Options Go the Find/Change Options display.
F15 Browse/Copy Options Go the Browse/Copy Options display.
F16 Repeat Find Perform find or repeat current find.
F17 Repeat Change Perform change or repeat current change
function.
F18 DBCS Conversion Perform DBCS conversion.
F19 Left View the info. to the left of the current display.
F20 Right View the info. to the right of the current display.
F23 Select Prompt Go to the Select Prompt display. SEU returns
to the EDIT Session and displays the prompt
after you make a selection.
F24 More keys View the other function keys available for the
current display.
The following is a list of all the valid commands:
The CL program is very simple; all it does is make the library that you have created (in my case, YOURLIB) the current library while retaining the existing current library on the library list. First, let's create a source physical (PF-SRC) file called QCLSRC (the IBM-supplied name for a CL source physical file). The command line form of issuing CL commands will be used in this section (you may want to use the <F4>prompt facility to assist you if you are not familiar with the commands). The following creates a PF-SRC file in the library ALIBRARY. ALIBRARY represents the library that has the same name as your user profile or your other library, that is the one you created in an earlier section.
CRTSRCPF FILE(ALIBRARY/QCLSRC)
Once the PF-SRC file has been created, work with the file by typing:
WRKMBRPDM FILE(ALIBRARY/QCLSRC)
Then create a source member called TEST in QCLSRC by pressing <F6> . This will start the SEU editor. Enter TEST for the name of the source member, CLP for the source type (to see what source types are available, put the cursor on the "Source type" field and press <F4> ), and a brief description of the source member. Once you have entered all the necessary information, press <Enter> . You will enter a SEU editing session. Type in the following program:
*************** Beginning of data ********************************
0002.00 PGM
0003.00 DCL VAR(&OLDCURLIB) TYPE(*CHAR) LEN(10)
0004.00 RTVJOBA CURLIB(&OLDCURLIB)
0005.00 CHGCURLIB CURLIB(&YOURLIB) /* intentional error */
0006.00 ADDLIBLE LIB(&OLDCURLIB)
0007.00 ENDPGM
****************** End of data ***********************************
You can use the SEU line command, IP (insert line and prompt), to help you in selecting a CL command. Also, note that CL programs are "free format" in that components of CL statements do not have to be placed in particular columns on the screen (some source types, such as RPG, are "fixed-format"; the IP line command can help enormously in coding such programs).
A CL program begins with the PGM command, which is optional if the CL program does not receive any parameters. (Aside: If a CL program has a parameter named &MYVAR, the PGM statement is coded as: PGM PARM(&MYVAR). The ampersand symbol, "&", denotes that &MYVAR is a variable. In this case, &MYVAR will be used to hold the parameter's value. Moreover, the variable &MYVAR has to be declared using the DCL command.) For more information, the reader is referred to the IBM "CL Programmer's Guide" or the online education modules: "AS/400 Control Language Programming" in the "Tutorial Support System" course, and the modules "Creating a Control Language Program" and "How to Use Error Handling Facilities" in the "Facilities and Implementation" course.
The second statement declares a CL variable called &OLDCURLIB. This variable will be used to save the name of the existing current library. The variable will be used to hold a character string with a maximum length of 10. Note that SEU provides syntax checking for CL programs. Remove the parameters of DCL so that the statement contains only "DCL", and press <Enter> . SEU will highlight that statement, indicating that there is a syntax error. SEU will not let you exit an editing session that has syntax errors unless you explicitly specify that you want to exit in the exit screen. Put the parameters back on the DCL statement.
The RTVJOBA command, on the third statement, is used to retrieve the name of the job's existing current library, saving it in the variable &OLDCURLIB. The reason for this step will be explained shortly.
The CHGCURLIB command, on the fourth statement, is used to make YOURLIB the new current library (where "YOURLIB" is any existing library that you have access to). Notice that we have intentionally introduced an error in this statement. We have mistakenly prefixed YOURLIB with "&", that is we really want CHGCURLIB CURLIB(YOURLIB) instead of CHGCURLIB CURLIB(&YOURLIB).
A name with "&" as its prefix denotes that it is a CL variable. This is an error because if we intended &YOURLIB to be a variable, it must be declared in a DCL statement. Note that SEU cannot detect this kind of error. This error will be detected during compilation.
The ADDLIBLE command, on the fifth statement, adds the name of the former current library (which we saved in the variable &OLDCURLIB in the RTVJOBA statement) to the library list. This step is needed if we want this library to stay on the library list. This is because when the CHGCURLIB command is executed, the "old" current library will not be retained on the library list. Hence, the need to use RTVJOBA to save the name of that library, and to add it back on the library list using ADDLIBLE. The last statement, ENDPGM, indicates the end of the CL program. Now, exit and save the program as it is (i.e. with the error).
Create CL Program (CRTCLPGM)
Type choices, press Enter.
Program . . . . . . . . . . . . > TEST Name, *PGMID
Library . . . . . . . . . . . > ALIBRARY Name, *CURLIB
Source file . . . . . . . . . . > QCLSRC Name
Library . . . . . . . . . . . > ALIBRARY Name, *LIBL, *CURLIB
Source member . . . . . . . . . > TEST Name, *PGM
Generation severity level . . . 29 0-29
Text 'description' . . . . . . . *SRCMBRTXT
Additional Parameters
Replace program . . . . . . . . > *YES *NO, *YES
Bottom
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys
The "Program" field specifies the name of the *PGM object that will be created if the compilation is successful. This name defaults to name of the source member. The "Library" field specifies the library that will contain the *PGM object. The default is the library that contains the source member. You can change these default values. Unless you want to rename the *PGM object or put it in another library, accept the defaults.
On pressing <Enter> , you will see a message at the bottom of the screen saying that the compilation job has been submitted to QBATCH, which is the job queue for batch jobs. If there are no compilation errors, you will receive a message saying that the job completed normally. Since there is an error in the above program, a message will return saying that the job has ended abnormally, meaning there are compilation errors. Press <Enter>to continue.
200- PGM
300- DCL VAR(&OLDCURLIB) TYPE(*CHAR) LEN(10)
400- RTVJOBA CURLIB(&OLDCURLIB)
500- CHGCURLIB CURLIB(&YOURLIB)
* CPD0727 40 Variable '&YOURLIB ' is referred to but not declared.
600- ADDLIBLE LIB(&OLDCURLIB)
700- ENDPGM
* * * * * E N D O F S O U R C E * * * * *
5738SS1 V2R1M1 920306 Control Language YOURLIB/TEST
Cross Reference
Declared Variables
Name Defined Type Length References
&OLDCURLIB 300 *CHAR 10 400 600
* CPD0791 00 No labels used in program.
* * * * * E N D O F C R O S S R E F E R E N C E *
5738SS1 V2R1M1 920306 Control Language YOURLIB/TEST
Message Summary
Severity
Total 0-9 10-19 20-29 30-39 40-49 50-59 60-69 70-79 80-89 90-99
2 1 0 0 0 1 0 0 0 0 0
Program TEST not created in library YOURLIB. Maximum error severity 40.
There are two errors in the listing (errors are marked with "*" in column 1): the first with a severity of 40 and the second with severity of 0. The second error is only an information message; it is not the cause of the compilation failure. The meaning of first error is evident; it is the cause of the failure. You can use the DSPMSGD (Display Message Description) command to get more information about a compilation error. For example, to get more details about the error CPD0727 DSPMSGD RANGE(CPD0727) MSGF(QCPFMSG) where QCPFMSG is the system message file and CPD0727 is the message ID. Let's go back to the source member and fix the problem.
Using SEU, edit the source member to remove the ampersand, "&", from YOURLIB. The program should compile normally after this change. To make the situation more interesting, let's introduce another type of error. In the ADDLIBLE statement, specify some library name that you do not own or one that you are not authorized to use. In our example, we specify a nonexistent library called DOGNAP, that is ADDLIBLE DOGNAP. The rest of the source remain the same as before (except for removing the ampersand character). Compile the source member (you will probably be asked if you want to delete the existing *PGM object. Respond with a "Y"). The program should compile normally. The *PGM object will be created in the library that contains your source file unless you specified otherwise.
Display Program Messages
Job 287471/T03/DSP02 started on 07/20/92 at 13:48:44 in subsystem QINTER
CPF2110 received by TEST at 600. (C D I R)
Type reply, press Enter.
Reply . . . ________________________________________________________
F3=Exit F12=Cancel
To find out the cause of the error, place the cursor on the message id (in this case CPF2110) and press <F1>. You see a screen similar to the one below. The message text, in this case, indicated clearly what the problem is, i.e. the library DOGNAP was not found. Sometimes you can obtain additional messages by pressing <F10> to display messages in the job log.
Additional Message Information
Message ID . . . . . . : CPA0701 Severity . . . . . .: 99
Message type . . . . . : INQUIRY
Date sent . . . . . . . : 07/20/92 Time sent . . . . .: 14:00:05
From program . . . . . : QCLXERR Instruction . . . .: 0000
To program . . . . . . : *EXT Instruction . . . .: 0000
Message . . . . : CPF2110 received by TEST at 600. (C D I R)
Cause . . . . . : Control language (CL) program TEST inlibrary YOURLIB
detected an error at statement number 600. Message text for CPF2110 is:
Library DOGNAP not found.
Recovery . . . : This inquiry message can be avoided bychanging the
program. Monitor for the error (MONMSG command) and perform error
recovery within the program. To continue, choose a reply value.
Possible choices for replying to message . . . . . . . . . . . . . . . :
C -- Cancel the CL program.
D -- Dump the CL program variables and cancel the CL program.
I -- Ignore the failing command.
More...
Press Enter to continue.
F3=Exit F10=Display messages in job log F12=Cancel
Again, the DSPMSGD ("Display Message Description") command can be used to obtain more information about the error. For example, DSPMSGD RANGE(CPF2110) MSGF(QCPFMSG) where QCPFMSG is the system message file and CPF2110 is the message ID.
Press <Enter> to cancel the program. Go back to the source member, fix the error, and recompile. The next time you run the program, it should run without any problems. Type DSPLIBL to check whether the library has been added and whether it has been made the current library.
Edit Object Authority (EDTOBJAUT)
Type choices, press Enter.
Object . . . . . . . . . . . . . > YOURLIB Name
Library . . . . . . . . . . . *LIBL Name, *LIBL, *CURLIB
Object type . . . . . . . . . . > *LIB *ALRTBL, *AUTL, *CFGL...
To see the detail screen as shown below, press <F11>. Note that the owner of "YOURLIB" has *ALL authority on the object.
Edit Object Authority
Object . . . . . . . : YOURLIB Object type . . . . : *LIB
Library . . . . . : QSYS Owner . . . . . . . : JOHNDOE
Type changes to current authorities, press Enter.
Object secured by authorization list . . . . . . . . . . . .: *NONE
Object ----Object----- ----------Data-----------
User Authority Opr Mgt Exist Read Add Update Delete
JOHNDOE *ALL X X X X X X X
*PUBLIC *EXCLUDE _ _ _ _ _ _ _
F3=Exit F5=Refresh F6=Add new users F10=Grant with reference object
F11=Nondisplay detail F12=Cancel F17=Top F18=Bottom
Press <F6> to add a user to the list of users authorized to this object. Type in the name of the user and *USE for the object authority. Press <Enter> to return to the previous screen. Notice that *USE gives the user *OBJOPR and *READ authorities on "YOURLIB". (Note: If you want to edit a specific authority, type "X" in the position relating to that authority to grant authority or a space to delete that authority.)
Next, we need to allow the user access to the file "SRCFILE". Use EDTOBJAUT to edit the authority on the file "SRCFILE". Type EDTOBJAUT OBJ(YOURLIB/SRCFILE) OBJTYPE(*FILE) or use the prompt to fill in the parameters. Press <F6> to add the user to the authorization list with *USE authority. This will allow them to do perform various operations on "SRCFILE" including copying members from the file. To allow them to copy the entire file (i.e. "SRCFILE"), *OBJMGT must be granted. To do that, type "X" under "Mgt" in the detail screen for that user. Note that the object authority changes from *USE to USER DEF (meaning a customized authority).
Send Network File (SNDNETF)
Type choices, press Enter.
File . . . . . . . . . . . . . . > SNDFILE___ Name
Library . . . . . . . . . . . > SNDLIB____ Name, *LIBL, *CURLIB
User ID: _
User ID . . . . . . . . . . . > RCV_______ Character value
Address . . . . . . . . . . . > MKTAS400__ Character value
+ for more values _
Member . . . . . . . . . . . . . > SNDMBR____ Name, *FIRST
Additional Parameters
To file type . . . . . . . . . . *FROMFILE_ *FROMFILE, *DATA
VM/MVS class . . . . . . . . . . A A, B, C, D, E, F, G, H, I
Send priority . . . . . . . . . *NORMAL__ *NORMAL, *HIGH
F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display
F24=More keys
The receiver will have to run the "Work with Network Files" (WRKNETF) command to inspect their network files.
Work with Network Files (WRKNETF)
User . . . . . . . . . . . . : RCV_______
User ID/Address . . . . . . : RCV_______ MKTAS400
Type options, press Enter.
1=Receive network file 3=Submit job 4=Delete network file
5=Display physical file member
File -------From-------
----Arrival----
Opt File Member Number User ID Address Date Time
__ SNDFILE SNDMBR 1 SENDER MKTAS400 08/26/92 16:37
F3=Exit F4=Prompt F5=Refresh F9=Retrieve F11=Display type/records
F12=Cancel
Type 1 in the "Opt" blank in front of the network file to receive and press <F4>to prompt. The following screen will show up.
Receive Network File (RCVNETF)
Type choices, press Enter.
From file . . . . . . . . . . . > 'SNDFILE'__ Character value
To data base file . . . . . . . *FROMFILE__ Name, *FROMFILE
Library . . . . . . . . . . . *LIBL____ Name, *LIBL, *CURLIB
Member to be received . . . . . > 'SNDMBR'__ Character value, *ONLY
To member . . . . . . . . . . . *FROMMBR____ Name, *FROMMBR, *FIRST
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys
Fill in the "To data base file", "Library", and "To member" blanks with the appropriate receiving file, library and member names and press <Enter>. Note that the receiving file must already exist before trying to receive members.
There are several ways by which spooled files are generated. Here are some:
Note: If this is the first time that you are using the WRKSPLF command, you should change the "assistance level" for this screen. To do this press <F21>and change the assistance level from "basic" to intermediate". This will gives you more features on the screen. Try pressing the <F10>or <F11>keys to obtain different views of your spooled files.
Typing 2 in the option field of spooled file in the WRKSPLF screen will change the spooled file's attributes. The attributes that you will be interested in are the "Print device" and "Save file".
By changing the attribute "Print device" from "*OUTQ" to a valid printer (use the WRKWTR command to find out which printers are available), you will move your spooled file from your output queue to a printer writer. The printer writer names at MSU are:
Printer Name Width/Paper Printer Type Location PRT01 132 Col. 11" Line Printer Morris Hall VAXPRTS2 132 Col. 11" Line Printer MSU ACC PS/2 printers 132/80 8.5" Dot Matrix MSU ACC Lab Rooms
If "Save file" is changed from "*NO" to "*YES" the spooled file will not be deleted after the file has been printed.
Typing 3 in the option field of spooled file in the WRKSPLF screen will keep the spooled file from printing if placed on a printer writer and change the status to *HLD.
Typing 4 in the option field of spooled file in the WRKSPLF screen will delete the spooled file from your output queue. Spooled files should be deleted as soon as they are not needed to reduce clutter in your output queue.
Typing 5 in the option field of spooled file in the WRKSPLF screen will allow you to view your spooled file.
Typing 6 in the option field of spooled file in the WRKSPLF screen will will release a file that is held to become available to print and will change its status to *RDY.
If you printed to VAXPRTS2, your printouts can be picked up in the ACC printer area at any time. VAXPRTS2 is a printer that is connected to VAX1. The printer will never say it is started although it actually is. Normally you will not be authorized to print to writer PRT01. This printer is the system printer.
The first step is to to reach the 'Work with members using PDM' display. This can be done by typing WRKMBRPDM YOURLIB/SRCFILE on any command line.
To create a data file member, you have to start the Source Entry Utility. Press <F6> from the 'Work with members using PDM' display or type STRSEU on any command line and press <F4>. The following screen shows up:
Start Source Entry Utility (STRSEU)
Type choices, press Enter.
Source file . . . . . . . . . . *PRV______ Name, *PRV
Library . . . . . . . . . . . __________ Name, *LIBL, *CURLIB, *PRV
Source member . . . . . . . . . *PRV______ Name, *PRV, *SELECT
Source type . . . . . . . . . . *SAME_____ Name, *SAME, BAS, BASP, C...
Option . . . . . . . . . . . . . *BLANK____ *BLANK, ' ', 2, 5, 6
Text 'description' . . . . . . . *BLANK_________________________________
The Source type for a data file must be specified as PF, this type denotes aPhysical File. For example, to create a data file called TESTDATA in the source file SRCFILE in library YOURLIB, fill in the fields as shown:
Start Source Entry Utility (STRSEU)
Type choices, press Enter.
Source file . . . . . . . . . . SRCFILE___ Name, *PRV
Library . . . . . . . . . . . YOURLIB___ Name, *LIBL, *CURLIB, *PRV
Source member . . . . . . . . . TESTDATA__ Name, *PRV, *SELECT
Source type . . . . . . . . . . PF________ Name, *SAME, BAS, BASP, C...
Option . . . . . . . . . . . . . *BLANK____ *BLANK, ' ', 2, 5, 6
Text 'description' . . . . . . . Your_description_for_the_member_...______
The Edit display shows up. It is convenient to use the prompt facility for defining the DDS source. The prompter helps you to supply the source information in the correct format. Press <F4> to invoke the prompter and <F12>to cancel it.
When the prompter is invoked, the screen looks as shown:
Find . . . _____________________________________________________ TESTDATA
FMT PF .....A..........T.Name++++++RLen++TDpB......Functions++++++++++++++++++
*************** Beginning of data *************************************
0001.00
****************** End of data ****************************************
Prompt type . . . PF Sequence number . . . 0001.00
Name Data Decimal
Type Name Ref Length Type Positions Use
_ _____ _ ______ _ ___ _
Functions ___________________________
F3=Exit F4=Prompt F5=Refresh F10=Top
F11=Bottom F12=Cancel F24=More keys
An explanation of the different fields shown above follows: The fields marked with * are not commonly used, so for normal applications you may conveniently ignore them.
The DDS source for TESTDATA is shown below. RECFMT1 is the record format name. There are two fields in the data file, FIELD1 and FIELD2. FIELD1 is of character data type with length 10, and FIELD2 is a packed decimal of length 5 with 2 decimal positions. The last line of the member declares FIELD1 to be the key field.
Find . . . __________________________________________________________ TST1
FMT PF .....A..........T.Name++++++RLen++TDpB......Functions++++++++++++++++++
*************** Beginning of data *************************************
0000.01
0001.00 R RECFMT1
0002.00 FIELD1 10A
0003.00 FIELD2 5P 2
0004.00 K FIELD1
0005.00
****************** End of data ****************************************
F3=Exit F4=Prompt F5=Refresh
F10=Top F11=Bottom F24=More keys
Press <F3>and hit <Enter>to save the member TESTDATA. For more details about exiting SEU refer to the section 'How to exit SEU'.
The member TESTDATA that was just created contains only the definition of the data file and hence our the next step is to actually create the file. This can be done by compiling the member we have just created. From the 'Work with members using PDM' display, position the cursor at member TESTDATA, and choose option 14 (compile). If the compilation is successful, the file TESTDATA will be created in YOURLIB. Otherwise, look into your spooled file (WRKSPLF) and identify the problem.
Update Data with Temp Program (UPDDTA)
Type choices, press Enter.
Data base file . . . . . . . . . __________ Name
Library . . . . . . . . . . . *LIBL_____ Name, *LIBL, *CURLIB
Member . . . . . . . . . . . . . *FIRST______ Name, *FIRST
Bottom
F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display
F24=More keys
Supply the values for the data base file to be loaded and the library it is contained in, and press <Enter>. For example, to populate our file TESTDATA we would fill in the values as shown:
Update Data with Temp Program (UPDDTA)
Type choices, press Enter.
Data base file . . . . . . . . . TESTDATA__ Name
Library . . . . . . . . . . . YOURLIB__ Name, *LIBL, *CURLIB
Member . . . . . . . . . . . . . *FIRST____ Name, *FIRST
Bottom
F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display
Enter the values for different fields and press Enter>. To stop the process of loading the data file, press <F3>and press < Enter>.
This section will only cover those aspects of screen design not related to interfacing with applications. For information on this area, see the manual for the language of the application source.
To create the screen design member, issue the command STRSDA (for STaRt SDA) from a command line. A menu of options will appear which allow you to create a screen, create a menu, or test a design. Choosing the first option brings the following screen:
Design Screens
Type choices, press Enter.
Design option . . . . . . _ 1=Select file keywords
2=Select record keywords
3=Select subfile keywords
4=Select subfile control keywords
5=Define screen image (fields)
6=Save DDS source, create object
Record . . . . . . . . . __________ Name, F4 for Record list
Additional records . . . __________ Name
(to be displayed on Work Screen)
Source file . . . . . . . QDDSSRC___ Name
Library . . . . . . . . *LIBL_____ Name, *LIBL, *CURLIB
Member . . . . . . . . . __________ Name, F4 for Member list
Source type . . . . . . . __________ DSPF,
Blank for default
F3=Exit F4=Prompt F12=Cancel
Since no screen design exists yet, it is necessary to first create one using the "5" option on the "Design option line". Also, a source file must be provided, and a member specified. If the member does not yet exist, it will be created. Finally, a record name must be given. Since each member can have several records, a single screen design member could contain any number of screens, with each one given a distinct record name. Once the information is entered, the screen should look like this:
Design Screens
Type choices, press Enter.
Design option . . . . . . 5 1=Select file keywords
2=Select record keywords
3=Select subfile keywords
4=Select subfile control keywords
5=Define screen image (fields)
6=Save DDS source, create object
Record . . . . . . . . . SCREEN1___ Name, F4 for Record list
Additional records . . . __________ Name
(to be displayed
on Work Screen)
Source file . . . . . . . SRCFILE___ Name
Library . . . . . . . . YOURLIB___ Name, *LIBL, *CURLIB
Member . . . . . . . . . SCRNMBR___ Name, F4 for Member list
Source type . . . . . . . __________ DSPF,
Blank for default
F3=Exit F4=Prompt F12=Cancel
These options will start SDA on a screen named SCREEN1 in the member SCRNMBR of file SRCFILE in library YOURLIB. Pressing <Enter> will bring up the main SDA display. This is simply a blank "pasteboard" on which you may place text and fields.
The following examples illustrate user-defined fields:
The following examples illustrate constant fields:
Symbol
Single Field Multiple Field Field
Mode Mode Meaning
& &n Places field. Does not add column heading.
&L &nL Places field. Adds a column heading to the
left of the field.
&R &nR Places field. Adds a column heading to the
right of the field.
&C &nC Places field. Adds a column above the field.
Left-aligns column heading for an alphabetic
field and right-aligns column heading for a
numeric fields.
&P &nP Places the column heading only.
Command Command
Add Remove Attribute Add Remove Color
H -H High intensity CB -CB Blue
R -R Reverse image CG -CG Green
S -S Column CP -CP Pink
separators
B -B Blink CR -CR Red
N -N Nondisplay CT -CT Turquoise
U -U Underscore CW -CW White
-A Remove all -CA Remove all
attributes colors
You can carry out the above operations by typing * in the position preceding the field (the attribute byte of the field), pressing < Enter>, and working with the field keyword displays that appear.
Save DDS - Create Display File
Type choices, press Enter.
Save generated DDS source . . . . . . . Y Y=Yes
Source file . . . . . . . . . . . . . SRCFILE___ Name
Library . . . . . . . . . . . . . . YOURLIB___ Name, *LIBL ...
Member . . . . . . . . . . . . . . . . SCRNMBR___ F4 for list
Replace existing member . . . . . . . Y Y=Yes
Create display file . . . . . . . . . . Y Y=Yes
(CRTDSPF) F4 for prompt
Display file . . . . . . . . . . . . . SCRNFIL___ Name
Library . . . . . . . . . . . . . . YOURLIB___ Name, *LIBL ...
If create fails, display listing . . . Y Y=Yes
Replace existing file . . . . . . . . Y=Yes
Create file if DDS message severity
(GENLVL) is less than . . . . . . . 20 0, 10, 20, 30
Submit create job in batch . . . . . . . Y Y=Yes
Job description . . . . . . . . . . . QBATCH____ Name
Library . . . . . . . . . . . . . . QGPL______ Name, *LIBL ...
F3=Exit F12=Cancel
These options will compile all the screen records in member SCRNMBR of file SRCFILE in library YOURLIB to a *FILE object called SCRNFIL in YOURLIB. That file may then be used by user programs.
It may be advantageous to test screen designs before using them with programs. This can be accomplished using the "Test Display Files" option from the initial SDA menu. The screen test program will request the name of a screen and display file (created using the compilation procedure above,) followed by a prompt screen for values for the output fields. SDA displays the screen with the values supplied.
To specify these options at compilation time, first prompt on the compile option on the Work with Members Using PDM display (or on the CRT___PGM command for the language of the source file) by pressing < F4>(PROMPT) with the "14" (COMPILE) option on the options line of the file you wish to compile. This will show the initial options screen for the compiler. To enter the compiler options, it is necessary to prompt for more options by pressing <F10>, which reveals the following screen:
Create Pascal Program (CRTPASPGM)
Type choices, press Enter.
Program . . . . . . . . . . . . > TEST______ Name
Library . . . . . . . . . . . > YOURLIB___ Name, *CURLIB
Source file . . . . . . . . . . > SRCFILE___ Name
Library . . . . . . . . . . . > YOURLIB___ Name, *LIBL, *CURLIB
Source member . . . . . . . . . > TEST______ Name, *PGM
Text 'description' . . . . . . . *SRCMBRTXT_____________________________
Additional Parameters
Compiler options . . . . . . . . *DEBUG____ *LIST, *NOLIST, *CHECK...
+ for more values *SOURCE___
Language level . . . . . . . . . *EXTENDED__ *EXTENDED, *ANSI83, *SYSTEM
String temporary threshold . . . 2046____ 256-32767
F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display
F24=More keys
Placing the *DEBUG and *SOURCE options on the "Compiler options" lines will cause the compiler to produce a source listing and place it in the output queue and will include debugging information in the output program. Pressing <Enter>once all options are entered will submit the compilation. After the member has been compiled (assuming there are no errors in compilation,) the source listing should be printed and used with the next steps.
===> strdbg YOURLIB/TEST
where TEST is the program in library YOURLIB, that you intend to debug.
===> addbkp stmt(n1 n2 ... n10) where n1, n2 ... n10 are the statement numbers where the breakpoint is to occur. You may specify 1 to 10 statement numbers where the breakpoint should occur. For example, ' addbkp stmt(10 20 30) ' will set the breakpoints at statements 10, 20 and 30. The program breaks before processing a statement specified as a breakpoint.
===> call YOURLIB/TEST
You will notice that the program stops execution when the breakpoint is reached. From the 'Display Break Point' screen, you can check the values of the program variables as explained below:
===> dsppgmvar VARNAME
where VARNAME is the variable name you intend to display.
===> enddbg
Confirm that your copy of PC-VT is V9.0. This may be confirmed by starting PC-VT and noting the version number on the initial screen or by entering the setup A screen. Versions prior to V9.0 will not support the cursor keys during an AS/400 session.
Feature switch settings:
1 2101 2 0X11 3 0000 4 1110 5 0001 6 0110 7 1X10 8 000X 9 XXXX 0 XXXX
PS/2 Key Nam Micro-Term Key Sequence Typical use
<F1> <ESC>1 Help
<F2> <ESC>2 Switch View
<F3> <ESC>3 Exit
<F4> <ESC>4 Prompt
<F5> <ESC>5 Refresh Screen
<F6> <ESC>6
<F7> <ESC>7 Roll Down
<F8> <ESC>8 Roll Up
<F9> <ESC>9 Get Previous Cmd
<F10> <ESC>0 Move to top
<F11> <ESC>- List Toggle
<F12> <ESC>+ Cancel
<F13> <ESC>! or <ESC><SHIFT>1 User support
<F14> <ESC>@ or <ESC><SHIFT>2
<F15> <ESC># or <ESC><SHIFT>3
<F16> <ESC>$ or <ESC><SHIFT>4 Main menu
<F17> <ESC>% or <ESC><SHIFT>5
<F18> <ESC>+ or <ESC><SHIFT>6
<F19> <ESC>& or <ESC><SHIFT>7 Scroll left
<F20> <ESC>* or <ESC><SHIFT>8 Scroll right
<F21> <ESC>( or <ESC><SHIFT>9
<F22> <ESC>) or <ESC><SHIFT>0
<F23> <ESC>_ or <ESC><SHIFT>- Scrl Option
<F24> <ESC>= or <ESC><SHIFT>= Scrl Menu
<DEL> <DEL> Delete character
<Shift><Insert> <CTRL>d Duplicate
<Enter> <RETURN> Send screen
<Backspace> <ESC>i
<Right Ctrl> <LINEFEED> or <CTRL>j Field exit
<Home> <ESC>H
<Insert> <ESC><DEL> Insert mode
<Page up> <ESC>u
<Page down> <ESC>d
<Shift><Pt Scn> <CTRL>p Print Screen
<Tab> <TAB> Next field
<Shift><Tab> <ESC><TAB> Previous field
<ESC> <ESC>a or <CTRL>a Attention
<Alt><F7> <ESC>(grave accent) Ins. Special Char
<ESC><CTRL>w Indicator Toggle
<ESC><CTRL>a Refresh screen
<Left Ctrl> <ESC>r or <CTRL>r Reset term. err.
<Alt><Pt Scn> <ESC>s System Request
At the end of most modules, there is a quiz.
This can consist of questions from the module or examples that you walk through, or a combination of both. For the CS175 class, when you are finished with the quiz, obtain a screen print of the screen that tells you how many you answered correctly on the first try. If you forget to get a screen print, you need to go through the quiz again to get to that screen.
To Obtain a Screen Print Press the <SHIFT>and PRINT SCREEN key (towards the upper right hand corner of your keyboard) at the same time. When the screen has been captured you will see a message at the bottom of your screen, which tells you that it has been sent to the default printer device.
Press the <Reset>(at the bottom left hand corner of the keyboard), to clear this message and continue your session.
Exit online education by pressing a series of <F3>keys until you have reached a command line.
To check your screen print type WRKSPLF (work with your spool files). Your most recent screen print will be located at the bottom of the list and it will be titled QSYSPRT.
To assign it to a printer, type a 2, change, and press <Enter>. This will change the status from not assigned to a printer, to assigned to a printer.
At the Printer to use prompt, type the name of the printer you would like to send your printout to and press <Enter>. To see a list of all started printers, press <F4>on this line. This will give you a list of all started printers and from here you can select one by typing a 1 on the line before the desired printer. Press <Enter> to select this printer. You will return to the screen where you pressed <F4>. Press <Enter>again to accept this printer.
For more information on printing, see the section "Printing Procedure" in this manual.
Be sure to print your name and address below if you would like a reply. After you have completed this form send it in the campus mail to:
AS/400 Staff
Computer Services
Box 45
Today's Date:
Your Name:
Your Phone No.:
Your Address:
Your Comments:
Version 2.06
Copyright Minnesota State University, Mankato © 1992,1995
Last modified: Fri Feb 18 13:10:17 CST 2000 Jeffrey Hundstad