$34.99
Objectives:
• To familiarize you with signing on to the IBM i and the IBM i keyboard.
• Library Lists
• System Values
• Introduction to the traditional IBM i development environment and source editor.
• Introduction to printing.
• Download required software
Requirements to pass the lab:
Demo the CL programs that are created in this lab
Show the compiler listing from creating the CL program Answer the questions on this handout
Using AppsAnywhere, type IBM in the upper right search box
We will be using IBM ACS and IBM RDI 9.6 this semester
Launch IBM ACS (IBMi Access Client Solutions)
We are going to start a 5250 display session to interact with our power system running the IBM i operating system.
Select and click on 5250 Emulator
The next screen you get will be a green screen where you can sign on to the system.
BEFORE you log in, look at the Sign-on Screen. What are the 3 identification values in the top right corner?
System: ____________ Subsystem: _____________ Display: ______________
The basic IBM i interface is a block mode terminal. No, it is not GUI — we will see the GUI interface later. Note that a block mode terminal is not a dumb character mode green screen. The TAB key should be used to move from one input field to the next. Press Enter when you are ready to return the screen to the system for processing. It's conceptually similar to using web forms.
OK, let's sign on
Key in your user id (Dx433snn), press TAB, type the password, then press Enter to sign-on.
Note the 'X' on bottom of screen which indicates that your request is being processed. If you get stuck for some reason, press the Esc key, and use the Tab key to move to the text input fields. Press Enter only when you want the system to process the whole screen.
The first time you sign on, you will see a series of screens advising you of acceptable use policies and requesting your name, etc. to associate with your UserID ... please read the screens and enter the required information.
The next screen will be the Program Menu (the default starting point when you sign on next time). Look at the top left corner of the screen. What does it say?
_____________________________________ (it's the name of the menu) Run a program
Run a program to help familiarize you with the keyboard.
On the command line, enter the command CALL BCI433LIB/INTROLAB and press Enter. Follow the instructions on the screen. Practice with this program until you are comfortable with the various keys.
Change your password
On the command line at the bottom of the screen, key in GO MAIN and press Enter. This takes you to the top level menu used to navigate the operating system. Note the name of this menu in the top left corner.
On the command line, type the number of the menu option to select User Tasks and press Enter. On the next menu, select the option to change your password. (Once you get to know the command structure, you can run commands directly by name.)
The next part is a little tricky because you will be keying into non-displayed fields. Just watch where the cursor is.
This can be frustrating if you don’t read the following information.
the password is not case sensitive
Passwords can not start with a number
The password limit is 10 characters, so don’t type in a long password
Type the current password, press the tab key and type the new password and press the tab key and retype the new password – then press enter.
Run an application
Run a program to demonstrate a simple user application.
On the command line, enter the command CALL BCI433LIB/EDITCODES and press Enter. At the prompt enter ten twos 2222222222 and press the plus sign on the numeric keypad to right justify your numbers. This is mapped to the field exit key.
Press Enter.
ACS also allows you to use a popup keypad.
File Edit View Communication Actions Window Help
On the top menu, click on Actions. Select Popup Keypad On the keypad, select pad 2
If the top menu is not showing, there is a mouse shortcut to this popup. With the focus on your screen, right click.
Click on FldExit.
That was a lot of work, it is easier to just press the + sign on the numeric keypad if that is supported on your machine.
Fortunately you can find an easier way if you do not have the numeric keypad.
Click on Help on the top menu and select information center.
You need to find information on how the field exit key – what key combination is it mapped to?
______________________
Try it out.
(now back to the running program)
This screen informs us about edit codes. The information on this screen will be useful later in the subject. Don’t worry about understanding how edit codes are used.
For now we are learning about the field exit key, the field negative key and the F3 key which are all commonly used in Green screen applications. You should be able to locate the following on your screen: Enter value: 2222222222 No edit code used: 002222222222
N 22,222,222.22
What function key is available to exit this running program? ________________ Do not press this key. Press enter instead to place you at the screen allowing you to enter a number.
Try Pressing F3. Since it is not enabled for this screen your screen should freeze with an “X” showing at the bottom and a message should show saying “Function key not allowed”.
Press either the Ctrl or Esc key to reset your session.
Try entering a “W” in the entry field. What happened?
__________________________________________________________________________________ How do you recover from this problem?
__________________________________________________________________________________
Do it.
If you wanted to enter a negative value, you would not press the negative key on the numeric keypad first. You would press it last and your numbers would be right justified (moved to the right) and a negative sign would be included. Type ten twos 2222222222 and press the field negative key. (the minus sign on the numeric keypad) What was the result in your field and the other prompts showing on your screen
______________________
No edit code used: ______________________
N ______________________ A ______________________
Press the F3 Key to exit this program.
Press the F9 key to retrieve your previous command and add a “2” to the end. So it reads as:
“Call BCI433LIB/EditCodes2”
Run the command. This screen indicates you can stop the program by entering –99. Try it and if that doesn’t work try using F3 on any of the two screen records made available to you.
This is a never ending program. The programmer is not supporting the entry of –99 properly. It is an innocuous problem program because system resources are not being chewed up while the program waits for a response to the screen record. A more troublesome program would be one that is in an infinite loop not allowing any user interaction. Both programs can be ended a number of ways. One simple way is to hold down the shift key and press the escape key. Your cursor goes from the entry prompt to a line at the bottom of the screen. You can enter a 2 at this time. What appears on the message line?
_______________________________________________________________________________________
This technique does not always work with some never ending loops. The program you were running was in a loop but it was paused. Some programs are in a never ending loop and are not paused waiting for input.
For these programs, you need to sign in again.
At the top of your screen, you should see a plus sign below the File, Edit, View top horizontal menu. Click on that to start another session.
Sign in and run the WRKACTJOB command.
The worst thing you can do is sign on again and rerun the program. What you have to do is use this technique and use option 4 to end the program. Then you need to look at your program code and determine why it is in an endless loop. Running the program in debug mode is one way to do this.
Our simulation was harmless because the never ending program was using 0% of the CPU. Finally, note that you do not use option 4 for your other sign on where the function shows as
CMD-WRKACTJOB.
Try this to end your program.
For many people new to the IBM i, all the screens look the same at first. This is because they employ common layout standards with similar navigation elements, e.g. F3 to stop working and exit this command or program. (Windows employs similar standards for title bars and menus.) Please give careful attention to the title of every screen when it is first displayed.
Library Lists
Library lists are critical to the IBM i. There are over 5000 libraries on Zeus. You don’t want search each library every time you want to execute a command or run a program. Library Lists are built when you signon and are deleted when you signoff.
Let’s try a CL command. Type DSPLIBL (display library list) => DSPLIBL
What libraries do you see?
1._______________ 2._______________ 3._______________ 4._______________
5._______________ 6._______________ 7._______________ 8._______________
The order is important. These are the libraries that are checked for any object reference that does not include the library name. For example, if you wanted to refer to the PAYROLL program object you could say CALL PAYROLL. This command does not indicate where PAYROLL is located. The list of libraries is checked in the order you saw and wrote them. If PAYROLL is in the first library checked, then that will be the program that is invoked. If PAYROLL is in both the first library and the second library, then the first library’s PAYROLL will be run and the second library’s PAYROLL would be ignored. If PAYROLL is only in the 8th library, then libraries 1,2 .. 7 would be checked first and finally PAYROLL in library 8 would be located and executed.
Enter the command that refers to a program called PAYROLL at the command line.
=> CALL PAYROLL
What message appears on the message line?
________________________________________________________________________
If you want to run the payroll program you would need to know where it is located in order to make a qualified reference to it. You would type in a library name “/” and then the object name.
Enter the following qualified name for the payroll program:
==>CALL BCI433LIB/PAYROLL
BCI433LIB is our course library. It’s not on your library list, so in order to call the payroll program inside it, we had to specify BCI433LIB.
The library list consists of system libraries, user libraries and your own current library. These are system wide settings for all users. If you want to see the system portion of the library list, you can see how a system administrator made this setting by displaying a system value setting.
Type DSPSYSVAL QSYSLIBL and run the command.
=> DSPSYSVAL QSYSLIBL
What are system libraries?
1._______________ 2._______________ 3._______________ 4._______________
5._______________
Type DSPSYSVAL QUSRLIBL and run the command
What are the user libraries?
1._______________ 2._______________
Type the DSPLIBL command again
===> DSPLIBL
What is the name of the other library that is included on your library list? ______________________
This is not a SYS library or a USR library, it is a _______ library.
Most command have parameters. Pressing enter after you’ve typed a command assumes that you’re using the default values for the parameters.
Type DSPLIBL and press F4. What are/is the parameter(s) for this command?
_______________________________________________________________________
What are the default values for the parameter(s)?
What does * mean? Instead of guessing, move the cursor to the * and press F1 for help!
System Values
Type DSPSYSVAL and press F4.
How many parameters are used with this command? ________
Use the F1 key on each parameter.
Which parameter(s) are required? ____________________
Try pressing F4 on the System value parameter
System value . . . . . . . . . . F4 Here QABNORMSW, QACGLVL...
We want to find out the IBM i model. Once you get passed the idea that IBM starts a lot of their names with Q to distinguish them from your names, you should be able to find the appropriate system value.
What is the system model number? ____________
Writing CL programs
The last thing we want to do is to put all of this into an ILE CLLE program. Your program will review the commands you have just run and include a new library list command that allows you to determine libraries that you can add or remove from the user portion of your individual session’s library list.
Before you start coding, run a program to ensure that your name shows at the bottom of your printouts.
=> CALL STRJOB
__________________________
This program will make sure that all reports that you generate from this point on will have your name at the bottom of each page.
The program that we are about to write is called SYSVALPRG and the program type will be CLLE.
A. We need an object to store our source code for the program. Source code is stored in a source physical file and we will use the CRTSRCPF command (means create source physical file).
CRTSRCPF QCLLESRC (press F4)
On the prompted screen change the record length from 92 to 112 and then press enter.
B. Now lets work with that object.
WRKMBRPDM QCLLESRC (work with members using PDM)
Each source program is a member of a source physical file
C. This object called QCLLESRC should be empty the first time we look in it. What function key is associated with creating something? _____________ (Look at the bottom of the screen.)
D. Press F6 to enter your first member into QCLLESRC with the appropriate program or source member name and the appropriate program or source type. (a screenshot shows on the next page)
The code that you are entering is:
Note the following:
The title of the program and a description shows as a comment.
Your actual name is used in the spot that says “Your Name Here”
Anytime you hand in a listing you will sign it authenticating that the submitted work is your own work and not an electronic copy of someone else’s work
F. After you finish entering the above lines, press F3 to save your new member.
You have used Access Client Solutions and a product called PDM (Program Development Manager) to code your first programs. The modern way to develop code is done using a product called IBM Rational Developer for i.
Note we are Changing/Creating a member and where it is being stored. Press enter to save the new member
G. Option 14 can be used to compile your first program.
The output of the compile processes are:
A message - type the command to display a message at the command line
==> DSPMSG
A compile listing - this is where you'll see compile errors. User the Work With Spooled File command to see it
==> WRKSPLF
Hopefully a *PGM object. Exit PDM and then use the Work With Objects using PDM command.
==> WRKOBJPDM
H. If you have no compile errors, you can run your program at the command line by typing in the following.
=>CALL SYSVALPRG.
The student that had a library called DB433A01 would not have to type in a qualified name (includes the library name) when invoking the SYSVALPRG because the successfully compiled program would be placed in their current library.
If they did require a library name, they would have typed the following:
=> CALL DB433A01/SYSVALPRG
Printing control
When you ask to print something on the IBM i, it doesn't go immediately to the printer. As on Windows and Unix systems, the output first goes through a spooling system that intercepts the output and takes care of sending it to a printer while you do other things. What is different on the IBM i, is that you have control of this output after it is created but before the system generates a box of paper for the recycling bin.
The print output, known as a spooled file, goes to a holding area known as an output queue so you can look at it and decide if this is really what you wanted. It's a great way to save on paper! Each user on our IBM i has their own output queue so your output remains safe and secure.
What is the option that will allow you to view your compiled code? ___________ Try it.
Make sure your name shows at the bottom of the page. A fast way to get to the bottom of your listing to view messages that indicate if your program was successfully created is to type a B in the Control field.
Control _______ (try typing a B here to read your messages and name at the bottom of the listing)
You can also type a T in the Control field to get to the top of your listing.
After checking the output, return to the Work With Spooled Files screen by pressing F3
What option will allow you to remove the compiled code spooled file that does not require the use of paper? ______ (Don’t delete your spooled file)
We used to use option 2 that changed the spool file attributes to an output queue that had a printer writer program active causing your spool file to be printed by the system printer. Our new way of getting printouts will be using a PC printer.
If you hover with your mouse over the 8th icon at the top (counting from the left) you will see View spool files in output queue. When you have access to a PC printer, you will use this to get printouts.
Here is what I see
By clicking on the spooled file, I will see the contents and have the option to print. If you ran the CALL STRJOB command, your name will also automatically print at the bottom of the listing along with your user id.
Ensure that your student id shows in the header page and that your name shows at the bottom of the page.
Let us see if you can remember the steps to code a second CLLE program.
Write a program that will do the following:
1. Let you see all the objects in your library
2. Show messages from system related activities (like compiling)
3. Look at all your spooled files.
Sign off by entering SIGNOFF on any command line.
BCI433 – Lab 1 Summary
Access Client Solutions
IBM i Access Client Solutions provides a Java based, platform-independent interface that runs on most operating systems that support Java, including Linux, Mac, and Windows™. IBM i Access Client Solutions consolidates the most commonly used tasks for managing your IBM i into one simplified location.
We used it in lab 1 to interact with system menus, type in CLLE commands at the command line and run application programs on the IBM i system.
The basic system i interface is a block mode terminal
The Keyboard
The Tab key allows you to go to the next prompt.
The Field exit key (usually mapped to the plus key in the numeric keypad) allows you to remove any characters to the right of the cursor position on the current prompt and go to the next prompt. It also allows you to right justify a numeric entry in a numeric field.
Function Keys
F1 is frequently used as a help key
F3 is an exit key
F4 is used for prompting a command presenting a screen that shows you how to use the command.
F5 is a refresh key. If you do not see what you expect to see try the refresh option
F9 can retrieve your previous command at the command line.
F12 is used to cancel a command (similar to F3 sometimes).
F13 – F24 are accessible by pressing the shift key and the corresponding F1 – F12 key.
Running programs
CALL BCI433LIB/INTROLAB
Also be aware that you can run a program found in one of the libraries of your library list without having to refer to the library name. CALL INTROLAB.
Referring to both the library and the object name is using a QUALIFIED NAME.
Edit Codes
Edit Codes are used to provide extra meaningful punctuation for a number. The use of commas, a decimal point, a positive or negative sign, the suppression of leading zeroes are all possibilities when showing a number that uses an edit code.
Never Ending Programs.
There are two techniques to stop a never ending program.
1. Press Shift and Esc at the same time.
2. Type a “2” in the lower left line where your cursor is located
1. Press Shift and Esc at the same time.
2. Type a ‘1’ in the lower left line where your cursor is located.
3. Sign in again.
4. Type WRKACTJOB and look for your id with the never ending program.
5. Use option 4 to stop the job. (Don’t do this with the WRKACTJOB session)
Library Lists
Everybody sees the same library list when logging on to the system. The only differently named one is the current library – which is your own personal library. To see what it is you can type DSPLIBL.
QALTSYS SYS
QSYS SYS System Library
QSYS2 SYS System Library for CPI's
QHLPSYS SYS
QUSRSYS SYS System Library for Users
PANGBORN CUR
QGPL USR General Purpose Library
QTEMP USR
The library list can be changed after you log in.
ADDLIBLE BCI433LIB
DSPLIBL
QALTSYS SYS
QSYS SYS System Library
QSYS2 SYS System Library for CPI's
QHLPSYS SYS
QUSRSYS SYS System Library for Users
PANGBORN CUR
BCI433LIB USR BCI433 iSeries Business Computing course
QGPL USR General Purpose Library
QTEMP USR
Whenever you do not specify where something is to be found (use an unqualified name) the library list is searched to locate the object.
CALL NOTINLIST
An object that is not in any of the libraries in the library list will not be run because it will not be found.
CALL INLSTTWICE
An object that is in two of the libraries in the library list will be run from the library that is encountered first according to the way the list has been set up and how it displays with DSPLIBL
CALL BCI433LIB/INLSTTWICE
Although INLSTTWICE is in QSYS and BCI433LIB, since the qualified name is used, the version that is in BCI433LIB will be run.
System Values
QSYSLIBL is a system value that allows you to see the system libraries placed in everyone’s library list
DSPSYSVAL allows you to see this.
CHGSYSVAL allows system administrators to adjust this.
Writing programs in Client Access
=> CALL STRJOB
CRTSRCPF QCLLESRC Once the source physical file has been created, this step can be skipped
WRKMBRPDM QCLLESRC used to work with the program members that contain source code
Either press F6 to create a new member or use option 2 beside an existing member to edit it
If you are creating a new member, you need to supply a name and a source type. Source types for this semester are
CLLE – a command language program
RPGLE- an RPG program (usually a business application)
PF- a physical file (a table or data file)
LF- a logical file (a view or index to a data file or table) CMD- a user created CLLE command
Enter or change your code and then exit (F3) and save it Compile it with option 14.
Check for errors
==> DSPMSG
A compile listing - this is where you'll see compile errors. User the Work With Spooled File command to see it
==> WRKSPLF
Hopefully a *PGM object. Exit PDM and then use the Work With Objects using PDM command.
==> WRKOBJPDM YOURLIBNAME (DA433A40 for me)
You should see a new program object with a successful compile
.
Run your program =>CALL PROGNAME
Printing control
WRKSPLF (Work with Spooled Files).
Option 5 will allow you to view your printout. You can confirm that your name is at the bottom of the printout.
Option 2 will allow you to change the spooled file attributes. CHGSPLFA
Output Queue PRT01
Library QGPL
Access Client Solutions gives us an icon to click on to manage our printouts
Sign off by entering SIGNOFF on any command line.
If you want to install Access Client Solutions on your own PC:
Click on: http://inside.senecacollege.ca/its/software/
Click on Software Downloads
Sign on and click on iSeries Tab
Download IBM I Access Client Solutions
RDi V9.6 – Install 1
RDi V9.6 – Install 2
RDi V9.6 - Activation