04
Mon, Nov
6 New Articles

TechTalk

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

Use Windows Help Files for Documentation

I collect various RPG IV procedures and functions and have found that it can be hard to remember what some of them do and with what service program or binding directory each is associated, so I created a Microsoft HTML help file to keep all this straight. Anytime I write or find a new procedure, I just add it to the help file, add any index keywords I might use to search for it, and recompile the help file.

Compiled help, or CHM, files are like selfcontained mini Web sites because they are HTML-driven. Almost anything that you can do within a Web site—such as JavaScript, style sheets, images, image maps, and hyperlinks—can be done within the help file. I use style sheets to help maintain font and layout consistency, and I use very simple JavaScript to call the Windows help API to create pop-ups and Related Topics buttons. HTML Help also has a full-text search option that can be activated without any coding on your part; you need only select it during the setup.

I have placed a sample help file called Procedures.CHM on the Midrange Computing Web site at www.midrangecomputing. com/mc. You can download it, place it on a PC, and launch it by clicking the file name from Windows Explorer. This gives you an idea of how you can use Windows help in your environment.

My real documentation is contained in several help files, not just one. I take advantage of a feature of the help compiler by linking multiple help files into one. For example, I have a driver help file, called as400.chm, linked to additional help files, such as ftp.chm, uim.chm, and ILE.chm. Each file can be used independently or from the driver as400.chm.

To create the help files, I use Microsoft’s HTML Help compiler. It’s free, and there’s not much of a learning curve if you have basic knowledge of HTML. To learn more about the HTML Help compiler and download it, you can visit http://msdn.microsoft. com/library/default.asp?URL=/library/tools/htmlhelp/chm/hh1start.htm&RLD=77 or http://msdn.microsoft.com/library/periodic/period98/htmlhelp.htm. I also recommend that you check out Official Microsoft HTML Help Authoring Kit by Steve Wexler and Building Enhanced HTML Help with DHTML and CSS by Jeannine Klein.


We have not yet used this technique for user documentation, but there’s no reason why it shouldn’t work. HTML Help is easy to maintain and provides an easy way to group information by topic. Once the file is updated, you can put it on a server and give everyone a shortcut to it. I think this is a good vehicle to use for, say, a department standards manual. Because of its ability to display images, it’s also good for program documentation. Just get a screen capture and insert it into the help file.

— Jeff Kinzer

Track the Growth of Physical Files

IBM has provided a number of commands for looking at the size of objects, but no way to track an object’s size over time, so I wrote a utility that uses the Display Object Description (DSPOBJD), Display File Description (DSPFD), and Open Query File (OPNQRYF) OS/400 commands, along with some homegrown CL and RPG programs for tracking the growth of physical files.

CL Program CHK001CL uses DSPOBJD to build a database file of all the files on your system; OPNQRYF selects physical files and sorts the file in descending order by size. RPG IV program CHK001R reads the sorted list of physical files and loads information about the 200 largest files into a database file called FILSTAT. Then, program CHK003R runs three times, producing a report of disk file usage in three different sequences. Figure 1 shows what the report looks like.

To load and run this utility, follow these steps:

• Download the source code from the Midrange Computing Web site at www. midrangecomputing.com/mc.

• Place the source members into one source physical file. (I call mine QDASDSRC.)

Figure 2 lists the source members.

• Edit the CHKINSTALL member. Change the values of the first three DCL commands: variables &SRCLIB, &OBJLIB, and &SRCF. Use the names of the source library, the object library (where the compiled code will go), and the source physical file.

• Compile and call OPM CL program CHKINSTALL. If all goes well, you will see a completion message telling you that the utility has been installed.

• Use your job-scheduling software to run the utility once a week. In our shop, it runs on Sunday afternoons. The CL command that it should execute is SBMJOB ... CMD (CALLCHK001CL).

— Bill Barnes

12/11/2000 Object Size Change Report CHK003R

9:56:47 By Size CHK003RP

Obj Name Library Owner Cur 1 Wk Nbr Nbr

Size Ago Ago Ago Ago Ago Ago Records Deleted Mbrs

12/03/00 11/26/00 11/19/00 11/12/00 11/05/00 10/29/00 10/22/00

TLTRAN00 PKMANH18 QPGMR 3,381 3,315 3,270 3,225 3,181 3,142 3,106 6,508,822 283 1
JPWKHST JPTSFIL JPTS 3,360 3,344 3,324 3,303 3,286 3,267 3,251 29,411,986 1
TLTRAN30 PENANHTS QPGMR 3,248 3,248 3,248 6,255,932 278 1
JPWKHST NONELIB JPTS 3,230 3,230 3,230 3,230 3,230 3,230 3,230 28,075,986 1
PDPICK PENANH18 QPGMR 2,510 2,466 2,432 2,401 2,371 2,341 2,310 3,149,580 46 1

X.SHIP QS36F QDFTOWN 76 76 76 76 76 76 76 164,797 1

QRPGSRC JPT QSECOFR 76 76 76 76 76 76 76 674,420 1,030

REPORT TOTALS 68,368 70,541 69,819 55,431 54,903 54,506 53,917 285,835,878 5,436

CHANGE AMOUNT -3.18% 1.02% 20.61% .95% .72% 1.08%

SYSTEM ASP 403.7GB PERCENT USED 36.2620% TOP 200 PERCENTAGE OF TOTAL USED 46.7026%

Page 4

Figure 1: CHK001CL tracks database growth over time.


Member Type Description

CHKINSTALL CLP Creates DASD utilization objects CHK001CL CLLE Loads FILSTAT with current file statistics and prints reports CHK001R RPGLE Loads FILSTAT with current file statistics
CHK002CL CLLE Obtains members to determine deleted record ratio CHK003CL CLLE Prints file size change report
CHK003R RPGLE Prints file size change report
CHK003RP PRTF File size change report
FILSTAT PF Archive of file statistics
NUM002RG RPGLE Extracts a number from a string

Figure 2: CHKINSTALL creates the other objects.

SBMJOB Parameter Length Limitation

Q: I have an application in which one program calls another program, passing it 10,000 bytes of data, and I need to change the application so the first program submits the CALL to batch. However, the Submit Job (SBMJOB) command can’t pass that much data. Is there any other way to accomplish this?

A: Upgrade to V4R5. In V4R5, the size of the SBMJOB command string is increased from 3,000 bytes to 20,000 bytes.

— Bruce Vining

More Cool Query Techniques

I searched high and low for a method of developing cross-tab queries, queries that would turn single sales records into meaningful monthly buckets, but to no avail. A recent article about the power of Query/400, Bob Ellsworth’s “The Hidden Power of Query, Part 1” in the October 2000 issue of MC, ignited my interest again after it had waned for many months. The article showed me how to use an array of 1s and 0s, indexed by a month number, to perform the cross-tab calculation.

Figure 3 shows how I use this technique. First, I pull out the month by doing the proper division and subtraction on the invoice date. Then, I set up 12 arrays of 12 multipliers in which only one of the 12 is 1 and the rest are 0, depending on the month they represent. The microsecond function turns the alpha 1 or 0 into a numeric multiplication factor for the period. Presto! The amount is multiplied into the proper bucket. The microsecond function was what I needed all this time, and it was right under my nose!

As a bonus to this newfound friend, I could determine debit or credit entries based on a credit memo code that our software uses. Amounts are kept as positive numbers in the sales file. The credit memo code can be 0, 1, 2, or 3. Values 0 and 3 represent debits (positive numbers), whereas values 1 and 2 represent customer credits and returns (negative numbers). Figure 4 shows how I convert a positive number into either a positive or a negative number, depending on the credit memo code field IHCRMM. Using the CC array in the query and subtracting the converted value from 1 gives me +1 or -1 as my multiplication factor, which I multiply by the positive amount. Once you know how to do this, it works very well.

Thanks again for that query article. If anybody has any solutions to “IF” functions on strings or calculations at the subtotal level, I would love to see them.

— Michael Calderon


Field Definition Length Decimals

YEAR (ihivdt/10000) 4 0 YR YEAR+1900
MONTH (ihivdt-(year*10000))/100 4 0 P1 ‘100000000000’

P2 ‘010000000000’ P3 ‘001000000000’

(Fields P4 through P11 defined in a similar manner.) P12 ‘000000000001’

PER1 microsecond(‘1988-12-25-17.30.00.00000’|| substr(p1,month,1))*IVSALT”

PER2 microsecond(‘1988-12-25-17.30.00.00000’|| substr(p2,month,1))*IVSALT”

PER3 microsecond(‘1988-12-25-17.30.00.00000’|| substr(p3,month,1))*IVSALT” (Fields PER4 through PER11 defined in a similar manner.) PER12 microsecond(‘1988-12-25-17.30.00.00000’|| substr(p12,month,1))*IVSALT

Figure 3: Query moves field IVSALT into one of 12 monthly buckets.

Field Definition

CC ‘0220’ AMT (1-(microsecond(

‘1988-12-25-17.30.00.00000’|| substr(cc,ihcrmm+1,1))))*TAMT

Figure 4: Query converts a positive number into either a debit or a credit.


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: