29
Fri, Nov
0 New Articles

Programmer's Toolbox

General
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

SEU Line Commands Revisited

This article reviews the commonly used SEU line commands and provides a refresher course on those commands that are not used as often.

Most AS/400 programmers know the basic SEU line commands, like C for Copy, M for Move, and D for Delete. Some programmers even know the less frequently used commands like X for Exclude, O for Overlay, or LP for Printing a Line. The purpose of this article is to cover the basic and sometimes forgotten SEU line commands.

Fundamental Editing Commands

There is a core of commands that are frequently used by the beginning programmer and the most experienced programmer alike. These commands are, in no particular order, Copy (C), Delete (D), Move (M), After (A), Before (B), and Insert (I). The A and B commands cannot be used by themselves. They are target commands used in conjunction with the M and C commands.

Some commands can be used in a block form. That is, you can copy, move, or delete lines of code that are blocked together. If you want to copy a block of code, you can place CC on the first line of code you want to copy and CC on the last line you want to copy. You will, of course, need to use the A or B target command to place the code where you want it. Block commands can also be used for Delete and Move functions. Use DD on the first line of the block of code you want to delete and DD on the last line of the block of code. Use MM on the first line of the block of code you want to move and MM on the last line of the block of code. (Don’t forget to use the A or B target command to place the code where you want it to go.)

Some commands allow you to specify a number of lines to work with. Say you want to copy seven lines of code. You can place a C7 on the first line of code you want to copy. SEU will copy that line and the following six lines of code. Once again, you would need to use the A or B target command to place the code where you want it. This method can also be used with the Delete and Move functions.

Advanced Editing Commands

There is another set of commands that are not used as frequently as those previously mentioned. They are as follows:

• Copy a Line and Retain (CR)
• Insert a Line with a Format (IF)
• Insert a Line with a Prompt (IP)
• Print a Line (LP)
• Overlay (O)
• Repeat a Line (RP)
• Shift a Line Left (L)
• Shift a Line Right (R)
• Shift a Line Left and Truncate (LT)
• Shift a Line Right and Truncate (RT)
• Exclude a Line (X)
• Show the First Excluded Line (SF)
• Show the Last Excluded Line (SL)
• Skeleton (S) These are the commands that have somehow slipped through the cracks and become forgotten. But, by refreshing our memories, we can use these commands to help make our jobs a little easier and more productive. Following is a brief description of how these commands are used.

The CR command allows you to copy a line over and over again without typing in C (Copy a Line) after pressing Enter. In other words, this line (or these lines) of code can be added to various areas of the program by using the target commands, A or B, over and over again without retyping the C or CC commands before each copy. The CR will remain on the line until you press F5. You can specify CCR to copy a block of code, or CRn (where n represents a number) to copy n lines of code.

The IF command allows you to insert a line with the format chosen by determining what line you typed the IF on. For example, if you type in the IF on a D-spec, it will prompt you with the D-spec format. If you type in the IF on a line that it doesn’t recognize, the system will display a line with numbers on it, giving you the column lineup. In other words, it will not give you a particular format line, only a line that resembles a ruler. The IF? command lets you choose from a list of formats before inserting.

The IP command is similar to IF except that it gives more definition for the fields and lines the fields up for you. Figure 1 shows the IP command being typed in an SEU editing session. Figure 2 shows how the system responds. The bottom part of the display has been overlaid with a prompt for a D-spec.

IP will prompt you for the specification that is used by the line where you typed IP. In Figure 2, IP was typed on the D-spec, so it prompted for the D-spec. If you want to specify a type of line, add the letter of the specification you want. For example, if you want the O-spec, type in IPO; the prompt for the Output specification will appear.

The LP command in and of itself is not that useful (who would want to print just one line of code from a program?), but when you use it in block form, LLP, it becomes very useful. If you want to print out a subroutine without printing the entire program, LLP becomes a nice little command to have. (It also allows us to save a few trees.)

The O command allows you to overlay one line of code with another, blending them together. In Figure 3, I have keyed the letter C over the first digit of the sequence number of line 58.00. I have also keyed the letter O over the first digit of line 61.01. Figure 4 shows the same source code after I press the Enter key. Notice that characters from line
58.00 overlaid only blanks in line 61.01. No nonblank characters were overwritten. The RP command copies the line of code and places it immediately under the copied line of code. It does not use the target commands A or B.

The next set of commands (L, R, LT, and RT) all work in a similar fashion. They all shift the line to the left or to the right. However, using LT or RT will truncate the code that doesn’t fall within column positions of the source line. These commands are useful

when you’re copying lines of code from RPG III into RPG IV and they don’t line up in the correct columns.

The X command is good to use when you want to remove some lines of code that you don’t want to look at. For example, suppose that you’re looking at a program that has been worked on quite a bit and there are comments all around the code that you’re trying to decipher. Use the X command to remove these lines of code from the screen. Using this command does not delete the lines of code from the program; it only removes them from the screen. Once you press F5 or F3, the code will return.

The SF and SL commands work only with lines hidden by the X command. Instead of pressing F5 to return all of the code you excluded, you can type SF to show the first line of excluded code, and SL to show the last line of excluded code. You can also use SFn or SLn, where n represents a number, to show the number of lines excluded.

The S command allows you to use another line of code as an example. The Insert a Skeleton Line (IS) command is used along with the S command. It does not use the A and B target commands. For example, if you want to use one line of code as the skeleton, you would type S on that line and then press Enter. You would then type IS on the line right before the insertion point. The system will then insert the skeleton line and allow you to retype whatever you want to keep from the skeleton line. If you want to insert the skeleton line but do not want to make any changes to it, type over any character with the same character.

More to Come!

So, there you have it: A list of SEU line commands that you may have forgotten or seldom used. You’ll find a summary of these commands in Figure 5.

If this list doesn’t have what you’re looking for and you’re running V4R2, you can create your own SEU line commands. For more information, see Chapter 8 of the SEU reference manual—and look for an article about this in an upcoming issue of Midrange Computing.

Reference

Source Entry Utility User’s Guide and Reference (SC09-2605, CD-ROM QB3AGX00)

Columns . . . : 6 76 Edit C031Y99TST/QSRC

SEU==> TIERCONV

FMT * *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+.
0023.00 F*** Formatted WYATT Calculations File ***
0024.00 FFWI113 IF E K DISK
0025.00 F*** Formatted WYATT Weekly Elections File ***
0026.00 FFWI115 UF E K DISK
IPD7.00
0027.01 C*-------------------------------------------------------------------*
0027.02 C* TRANSLATE ENTIRE WEEKLY ELECTION FILE (FWI115) *
0027.03 C*-------------------------------------------------------------------*
0027.04

0027.05 C EXSR @CONVRT
0027.06

0028.00 C*-------------------------------------------------------------------*
0029.00 C* READ ENTIRE WYATT EMPLOYEE FILE (FWI111) *
0030.00 C*-------------------------------------------------------------------*
0031.00

0032.00 C READ FWI111 90
0033.00

F3=Exit F4=Prompt F5=Refresh F9=Retrieve F10=Cursor F11=Toggle

F16=Repeat find F17=Repeat change F24=More keys

Figure 1: The user has entered the IP command to insert a new line with prompting

Columns . . . : 6 76 Edit C031Y99TST/QSRC

SEU==> TIERCONV

FMT * *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+.
0023.00 F*** Formatted WYATT Calculations File ***
0024.00 FFWI113 IF E K DISK
0025.00 F*** Formatted WYATT Weekly Elections File ***
0026.00 FFWI115 UF E K DISK
0027.00

'''''''

0027.01 C*-------------------------------------------------------------------*

Prompt type . . . D Sequence number . . . '''''''

Declaration To /

Name E S/U Type From Length

_______________ _ _ __ ______ ______

Internal Decimal

Data Type Positions Keywords

_ ___ _____________________________________

Comment

______________________

F3=Exit F4=Prompt F5=Refresh F11=Previous record

F12=Cancel F23=Select prompt F24=More keys

Figure 2: The system places the prompt at the bottom of the display

Columns . . . : 6 76 Edit C031Y99TST/QSRC

SEU==> TIERCONV

FMT * *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+.
0055.00

0056.00 C IF *IN85 = *OFF
0057.00

C058.00 C IF (BCREGCD = '8') OR (BCREGCD = '9')
0059.01 C EXSR @WEEKLY
0060.00 C ENDIF
0061.00

0061.01 C IF (BCREGCD = 'M')
0061.02 C EXSR @WEEKLY
0061.03 C ENDIF
0061.04

0062.00 C ENDIF
0063.00

0064.00 C ENDSR
0065.00

0066.00 C*-------------------------------------------------------------------*
0067.00 C* DETERMINE IF IT IS DAILY OR WEEKLY ELECTIONS *

F3=Exit F4=Prompt F5=Refresh F9=Retrieve F10=Cursor F11=Toggle

F16=Repeat find F17=Repeat change F24=More keys

Figure 3: Use the Overlay command to blend two lines together

Columns . . . : 6 76 Edit C031Y99TST/QSRC

SEU==> TIERCONV

FMT * *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+.
0055.00

0056.00 C IF *IN85 = *OFF
0057.00

0058.00 C IF (BCREGCD = '8') OR (BCREGCD = '9')
0059.01 C EXSR @WEEKLY
0060.00 C ENDIF
0061.00

0061.01 C IF (BCREGCD = 'M') OR (BCREGCD = '9')
0061.02 C EXSR @WEEKLY
0061.03 C ENDIF
0061.04

0062.00 C ENDIF
0063.00

0064.00 C ENDSR
0065.00

0066.00 C*-------------------------------------------------------------------*
0067.00 C* DETERMINE IF IT IS DAILY OR WEEKLY ELECTIONS *

F3=Exit F4=Prompt F5=Refresh F9=Retrieve F10=Cursor F11=Toggle

F16=Repeat find F17=Repeat change F24=More keys

Figure 4: Characters from line 146 have been used to fill portions of line 147

Command Block form Function Meaning of n

An Insertion point is after line Number of lines to insert Bn Insertion point is before line Number of lines to insert Cn CC Copy Number of lines to copy CRn CCR Retain copy Number of lines to copy Dn DD Delete Number of lines to delete Fxx Format line
In Insert new line Number of lines to insert Ifxxn Insert new line with format Number of lines to insert Ipxx Insert new line with prompting
ISn Insert skeleton line Number of skeleton lines to insert Ln LL Shift text left Number of positions to shift
LTn LLTn Shift text left, truncating Number of positions to shift nonblank characters if necessary
LPn LLP Print Number of lines to print
Mn MM Move Number of lines to move
On OO Overlay with copied or moved lines Number of lines to overlay
Pxx Prompt
Rn RRn Shift text right Number of positions to shift
RPn RPPn Repeat Number of lines to repeat
RTn RRTn Shift text right, truncating Number of positions to shift nonblank characters if necessary
S Define skeleton line
SFn Show excluded lines Number of lines to show
SLn Show excluded lines Number of lines to show
TABS Set tab stops
Wn Window Column at which window begins Xn XX Exclude lines from view Number of lines to exclude Note: The
n suffix on some commands is optional and always defaults to 1.

Figure 5: Summary of SEU line commands

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: