Newsletters Subscriptions Media Kit About Us Contact Search Home

Stuff
OS/400 Edition
Volume 2, Number 16 -- August 14, 2003

CODE/400 Command Shell


by Kevin Vandever

In my last article, "Debug iSeries Programs with the iSeries Distributed Debugger," I introduced you to the iSeries Distributed Debugger and briefly showed you how to interactively debug a program displayed in CODE/400. Before I move on to more advanced interactive debugging features, I want to get you more acquainted with the Command Shell feature that comes with CODE/400. This feature is associated with CODE/400 overall, not just the debugger, but it will certainly come in handy during the debugging process.

What Is the Command Shell

The Command Shell is a feature within CODE/400 that allows you to enter and run OS/400 commands. In fact, it is more than that. It is also a place that allows you to run PC commands, all from the comfort of one window. I'll talk about PC commands in a bit, but as for OS/400 commands, you can enter them right from this window, just as you would from a 5250 green screen. That includes running commands in batch, interactively, as well as the prompt (F4) and help (F1) functions. Well, you might be thinking, "That's great, but I can just spark up a 5250 session to do all that," and that's true, to a point, but look a little deeper and think of the command shell as the same thing as pressing function key 21 (F21) from inside source entry utility (SEU). That's right; it's job related, so if you need to perform an activity that is necessary for your interactive CODE/400 session, such as adding a library to your library list, you can do so from the comfort of the command shell. You cannot do this by sparking up another 5250 session.

Say you are in CODE/400 editing a source member and you realize your library list isn't correct. What do you do? That's where the command shell comes in. From within your CODE/400 source member you can click one of many buttons in the CODE/400 toolbar, at the top of your window. The first button you can use is the one that contains four small rectangles in it. When you hover the mouse over this button, the tool bar hint should read "Ring Manager." If you click this button, you will be presented with a ring manager screen. The ring manager allows you to toggle among all the active source members you have open, as well as get to the command shell. A ring is an open CODE/400 session and is not the same as an active session in OS/400 terms. For example, if you have four source members open in CODE/400, you essentially have five rings; that is, one ring for each source member, plus the command shell. However, you still only have one OS/400 session. That means anything you do in the command shell applies to all of your open rings. Got it?

A second way to get to the command shell is to click the button that contains a blue arrow. There is a button with an arrow pointing to the left and another with an arrow pointing to the right. These buttons allow you to go to the next or previous ring--depending on which one you click--that is open inside of CODE/400. How many rings you have open determines how many clicks it takes to get to the command shell.

The last and probably most effective way to get to the command shell is to press the F9 key from inside your CODE/400 editor. That will take you right to the command shell screen.

How Do I Use Command Shell?

I have to back up a little at this point. In order to use the command shell to run OS/400 commands you must run the start code (STRCODE) command from a 5250 session. This allows the command shell to communicate with OS/400 via TCP/IP in the same way the distributed debugger does. Once you run STRCODE, you can toggle back to the command shell screen. Now you are ready to enter OS/400 commands. If they are interactive commands, or you prompt a command, you will see the results on the 5250 green-screen session where you ran the STRCODE command. If you enter a command that doesn't require a display, or enter a command in error, the messages will display in the command shell. There's not much else to talk about here, because entering commands in the command shell is just like entering them on a green-screen, and we all know how to do that. Oh, yeah, one downside is that pressing the F9 key won't bring back the last command. Not sure how to do that, yet.

If you need to switch over and enter PC-related commands, you can do so by right-clicking the mouse and selecting LOCAL from the resulting menu. Then you can enter DOS-like commands that will run on your PC. To get back to OS/400, right-click again and select OS/400, which is the managing OS/400 server for your CODE/400 session.

Come Out from Under the Shell

Now you should have a basic understanding of CODE/400 (from previous articles), the distributed debugger (from my last article), and now the command shell. From here, we can venture together into more advanced features, but before you do that, I invite you to mess around with the command shell and see how it can make your programming and debugging lives easier.


Sponsored By
WORKSRIGHT SOFTWARE

600 Billion

That's how much a recent independent study estimated U.S. businesses spend on dirty data. How much of that 600 billion is spent by your company? Cleanse your dirty ZIP Codes and mailing addresses with our software and save big bucks.

WorksRight Software, Inc.
Phone: 601-856-8337
E-mail: software@worksright.com
Web site: www.worksright.com


THIS ISSUE
SPONSORED BY:

Profound Logic Software
WorksRight Software


BACK ISSUES

TABLE OF
CONTENTS
Improved XML Validation with Schemas

CODE/400 Command Shell


Editors
Shannon O'Donnell
Kevin Vandever

Managing Editor
Shannon Pastore

Contributing Editors:
Howard Arner
Raymond Everhart
Joe Hertvik
Ted Holt
Marc Logemann
David Morris

Publisher and
Advertising Director:

Jenny Thomas

Advertising Sales Representative
Kim Reed

Contact the Editors
Do you have a gripe, inside dope or an opinion?
Email the editors:
editors@itjungle.com


Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.