Home   Contact   Convert COBOL   Convert RPG   Convert CPG/CICS   Consulting   Training   Demo   About Us   Privacy   FAQ  
      info­@­jcmigrations.­com­     +1-617-916-5114     566 Centre Street, Newton, MA 02458-2325     info­@­jcmigrations­.com­
 

Sample Training Materials

--------------------------------------------------------------------------------------------------------------------

Securing Personal Computers

Criminals (and network adventurers) expend significant effort breaking into personal computers, because that is where the money (or power) is.  

Efforts to protect PCs from malware, spyware, and spam are often ineffective because they are reactive (anti-virus) or restrict users too much.

Your PC is not lost in the crowd even though it is one in many millions of PCs on the Internet.   One popular methods by which criminal hackers ("Black Hats", "Crackers") attack government and corporate computers is by gaining control of thousands of personal computers, and launching
Denial Of Service attacks.

Protecting your PC is not rocket science.   Even the minimum will go a long way to secure yourself and others from criminals.   You do not need complex training in system security in order to prevent criminals from installing a Root Kit on your computer, and owning it from under you.

Here are several simple ways in which you can protect a PC from most attacks and viruses, without significantly diminishing usability:

Separate Administrator and User Accounts. When you set up your new computer, use the Administrator account to create a Restricted User account.   From then on, use your PC by logging in as the User.   This way malware cannot be installed on the PC without your knowledge, because software installation requires Administrator privileges.   The biggest advantage of this separation is that it is a one-time configuration, and will not affect your regular PC access and use.

Passwords. Many people don't use them because they are so very easy to forget.   On the other hand, some corporations enforce difficult requirements so that employees find themselves writing their passwords down an easy distance from their PCs.   The solution: use easy to remember passwords, making sure the Administrator password is secure.   Here are examples of easy to remember secure passwords: Adm!n!strator (constructed using exclamation marks as upside-down lower case i), 0nlyM3 (constructed with zero for uppercase o and 3 for e, spelling OnlyMe), JaueAnsteu (JaneAusten with u and n swapped).  

Power. Turning your computer off at the end of the day is a surprisingly effective way to protect it.   Not only does it protect it from access during a third of each day, but it also renders it less attractive to criminals, because it is a less reliable resource for their nefarious uses.   Finally, it will also reduce your energy consumption, the environmentalist thing to do.

--------------------------------------------------------------------------------------------------------------------

Increase IT Productivity through Standardization

© Copyright 2004, Jonathan Beit-Aharon

When you read the word "databases" you think DB2, Oracle, MySQL, DLI, All-in-1, MS-Access. You may also realize that Spreadsheets, E-mail, and other documents stored on individual PCs are in fact part of the corporate database.

Modern database systems have four common components:

  1. Data Definitions (or "Schema"), which includes not only the storage and display attributes, but also relationships, such as foreign keys and value constraints.
  2. Data Access Programs (or "Scripts"), which range from complex APIs usable only by sophisticated IT departments, to the program behind a simple icon on any desktop.
  3. Data
  4. Productivity Tools

The separation of data definitions from program code into data-dictionaries, or "schema repositories", occurred as an evolutionary "best practice". A related evolution formalized data access programs as Abstract Data Types (ADTs) and Access Program Interfaces (APIs). Data descriptors together with their APIs are now called Object Classes, and the data itself, together with its class-association, is called Object Instances.

In older ("legacy") applications the data-definitions, and in particular, data relationships are often hidden in program code, and not formalized in a data dictionary. In other words, for the IT organization the source code includes both schema and data. These are typically core applications that are irreplaceable. When managing their maintenance and development, you need to gather information about your schema and access programs. The quality of this information and the speed of the response to your query are critical to your management success.

An organization with older applications can evolve their management, and improve productivity. One key approach is to modernize this "IT database". You need Access Programs and Productivity Tools such as Source Version Control and maybe Business Rule Extractors, but you need another critical ingredient.

A major key to the performance of databases is the consistency of data definitions and the normalization of data. In the case of legacy code, however, the definitions include hundreds of different Computer Languages (multiple COBOL dialects, Java, C/C++, FTP Scripts, VB, a myriad configuration files, and components in older languages). They also include the services encoded by System Service APIs, that obviously vary radically from the Mainframe to UNIX, to VMS, to Wang VS, etc.

There are good evolutionary reasons for the diversity and complexity, which were created by a competitive effort to solve real business needs through innovation. There are also management costs and risks to this complexity, including higher skill-set requirements, and reduced IT throughput. This is the reason that as technologies mature, there is a strong market push towards standardization.

Third generation computer languages are a mature technology. True, certain ones have specific strengths over others, but for the vast majority of applications, there are no better options than COBOL and C/C++, which are not only the most common languages and skills, but also come with the best of breed development tools, and the best support on platforms, from Mainframes, to UNIX, to PCs.

How does one justify source code standardization? The best way is as part of other standardizations. If your IT Department is converting applications to a UNIX or an MS Windows network-based platform, older core applications that must make this transition will either use emulation or be converted. Conversion, particularly automated conversion using mature and proven cross-compiler technology, can be as low-risk as emulation, and is much more likely to have the added benefits of simplifying future maintenance, facilitating the next transition, and enabling those tools that will allow you to better manage your IT database.

--------------------------------------------------------------------------------------------------------------------

Source Code Version Control Systems

Source code management ("SCM") is a requirement of all modern software maintenance and development efforts. This article identifies the requirements of the diverse functional stake holders. Several references are then given to free source code version control facilities.

Interested groups and their needs

The groups that have direct interest in the coordination and control of computer program maintenance and development, and their Program Source Code are the Business Users (Accounting, Sales, Production Control, etc.), Information Technology ("IT") Directors, IT Auditors, IT Installers ("Release Engineers"), Quality Assurance groups, IT Development Managers, and IT Individual Developers.

Production code is the fully tested executable programs serving day to day operations. The business users need to prevent unauthorized changes to production code.

IT Directors and Auditors need controlled Transparent processes and audit trails, as well as information for process improvement efforts.

Development managers need to coordinate staff to avoid conflicts and duplication of effort, manage resources and reassign tasks, log assigned staff and development start and progress dates for each module, and enforce consistent development directory names, shop-standards, and change submittal procedures.

Individual developers need a facilitated development submittal process, and archived versions for rollback and roll-forward. They may also need to lock sources that are needed for maintenance or development (or to identify who locked a requested source module).

QA groups need execute access to QA-ready programs, which are distinct from both Production programs and from programs under development. They also need facilities for rejecting programs found to be defective, and/or forward tested programs for release engineering.

Installers / release engineers need to enforce submittal procedures, archive change management data, and archive new modules or module changes, as appropriate. They also verify that all sub-components are available for rebuilds.

To summarize, source version controls need to prevent unauthorized Production Code changes, coordinate developers to avoid conflicts and effort duplication, log required change documentation for auditing and process improvement, and log source changes for rollback and roll-forward of changes.

Source Maintenance Cycle

This cycle historically starts with the development of new application programs, proceeds with their testing and QA, and concludes with their placement into Production use. However, once code is placed in Production use, the cycle becomes maintenance centered, and organizations with mature applications are mostly concerned with controls of the repair and enhancement of their existing code base.

Source Code Version Control facilities were developed to provide for all of the above requirements, and to enable IT groups that are charged with repair and enhancement tasks.

The basic steps of the maintenance and development cycle are:

  • Check-out from the Source Repository to Development
  • Submit from Development to QA
  • Promote from QA to the Source Repository
Each basic step has a corresponding undo function:
  • Cancel a check-out
  • Reject from QA back to Development
  • Roll-back to prior Source Repository version
Additional refinements may record transfer of responsibilities between individual developers and/or QA personnel, and a release engineering group between QA and Production. Some facilities validate forward movement eligibility by executing and/or requiring a clean compile/build of a promoted source module as a pre-condition for the promotion.

Summary

The primary reason to automate the Source Code Version Control process is the desire to improve on both the consistency and the correctness of the IT Development results. The control facilities ensure correct operation by testing and handling a very large number of error conditions.

On UNIX and Linux systems there are four tiers of access controls and three levels of permissions, which protect directories (folders) and files. The control tiers are user-ownership, group-association, public access, and Access-Control-Lists (ACLs). The permissions for a directory are Read, Write, and Search. The permissions for a file are Read, Write, and Execute. In addition, a variety of tools are available to further control access, including Set User/Group ID bits, and access control utilities such as sudo and Power-Broker. These allow user and/or group-based controls to the Source Code Version Control facilities.

Here is more information on a few widely used Version Control facilities:

--------------------------------------------------------------------------------------------------------------------

Korn Shell Tips

Parameter Validation

In some environments (e.g., WISP v4) the passage of parameters from COBOL programs may include leading and embedded spaces. Here is an annotated Korn Shell script header that eliminates such spaces. The script expects 2 parameters. Lines beginning with the pound/hash symbol (#) are comments.

set $* NoDump
if [ $# -ne 3 ]; then
  print -u2 "Usage: $0 FirstParm SecondParm"
  exit 1
fi

The first line re-establishes the incoming parameter list ($*), and adds one parameter (NoDump) to it. Any string of contiguous white-space in the incoming parameters is interpreted as a single separator space. This applies to leading, trailing, and embedded spaces.

A new parameter 'NoDump' is added to make sure that if no parameters are passed, or if the parameters passed are reduced to separator spaces, that the "set" command will not respond by listing the Environment.

The term '$#' is a count of the (reset) number of parameters. We added one, so comparison is to the expected number plus 1.

The 'print -u2' command directs its output to STDERR.

The term '$0' is a reference to this script.

The UNIX convention is RETURN-CODE 0 means SUCCESS. We use 'exit 1' to return an error condition.

How To Find Who Is Using A File

Some times you want to verify that no one is using your file before running a major update program. The lsof (List Open Files) command is Shareware/Freeware available for AIX, HPUX, Linux, and other environments. Two common ways it is used are:

    lsof $FILEPATH
    lsof -p $PID

The first line lists all the processes that access the file at $FILEPATH (e.g., ../execs/jjupdate.int or /client17/data/armaster). The second lists all files open by the Process ID '$PID' (e.g., 1776).

--------------------------------------------------------------------------------------------------------------------

COBOL Tips

Flattening Data

The term "Flat Data" refers to data that can be read and interpreted by any computer, and is readable by any person. Most legacy computer data is stored in proprietary formats, so if you need to transfer it from one environment to another, you must flatten the data, or "Externalize" it. For example, MS-Word documents can be flattened or externalized into HTML, and simple MS-Excel spreadsheets can be made flat by conversion into Comma Separated Value (CSV) or Tab Separated Value (TSV) files.

Common data files that contain Binary, Packed, and/or Sign-Overpunch fields, also need to be flattened in order for the data to be correctly interpreted on the receiving computer, because Binary representation and packed and overpunch signs are machine-specific. The index structures of Indexed files are also proprietary.

Below is a template of a simple COBOL program that flattens a data file. Please note that this program does not do any data validation ("scrubbing"). Data validation is of great importance, and data conversions for such inter-system transfers are particularly good opportunities for it.

ENVIRONMENT DIVISION.
FILE-CONTROL.
    SELECT PROPRIETARY-FORM ASSIGN TO PROPRIET
    COPY $SELECTED$ REPLACING
          ==OF-CLAUSE== BY ==OF PROPRIETARY-RECORD==.
    SELECT EXTERNAL-FORM ASSIGN TO XTERNAL.
DATA DIVISION.
FILE SECTION.
FD PROPRIETARY-FORM.
01 PROPRIETARY-RECORD.
        COPY $O1RECORD$.
FD EXTERNAL-FORM.
01 EXTERNAL-RECORD USAGE DISPLAY SIGN SEPARATE TRAILING.
        COPY $O1RECORD$ REPLACING
          ==USAGE COMP==   BY == ==
          ==USAGE COMP-3== BY == ==
          ==COMP==         BY == ==
          ==COMP-3==       BY == == .
PROCEDURE DIVISION.
START-HERE.
        OPEN INPUT PROPRIETARY-FORM
        OPEN OUTPUT EXTERNAL-FORM
LOOP-TOP.
        READ PROPRIETARY-FORM NEXT RECORD AT END GO TO THE-END
        MOVE CORR PROPRIETARY-RECORD TO EXTERNAL-RECORD
        WRITE EXTERNAL-RECORD
        GO TO LOOP-TOP.
THE-END.
        CLOSE PROPRIETARY-FORM
        CLOSE EXTERNAL-FORM
        STOP RUN .
REDEFINES Elimination

Programmers are often slowed down by record structures that are hard to understand because they contain a large number of overlays. Some overlays are necessary because different layouts correspond to distinct sub-record types. Some overlays were needed in COBOL 1985 in order to initialize arrays, a need that has been eliminated in the 2002 COBOL Standard. Here are examples of REDEFINES that can be eliminated:

From To
15 FLD1 PIC S9(8) BINARY.
15 FILLER REDEFINES FLD1.
  20 FLD2 PIC X(4).
15 FLD2.
  20 FLD1 PIC S9(8) BINARY.

15 FLD1 PIC X(35).
15 FILLER REDEFINES FLD1.
  20 FLD2 PIC X(20).
  20 FLD3 PIC X(15).
15 FLD1.
  20 FLD2 PIC X(20).
  20 FLD3 PIC X(15).

--------------------------------------------------------------------------------------------------------------------

3 Tiers: Data, Schema, and Scripts

Three (and Multi) Tier Architecture is a popular way for organizing residual applications using current technologies. This architecture separates applications into these layers: the physical data; a data description (schema) and access layer; and the "scripts" or programs that operate on the data. Most often, the schema layer is associated with a database management system middleware.

The data may reside today in flat files, and tomorrow in a commercial Database such as DB2, Oracle, MySQL, et cetera. For the purpose of the tiered architecture, where and how it is stored and organized is separated from its schema-guided structured access, and its program script use.

One advantage of this organization is the ability to separate the development of new applications from the storage and organization of the data. This allows you to move data from flat files to an RDBMS or an OODB, and then re-configure the database or Middleware access, with the change being noticed by the application programs and users. This also lets you port applications to faster cheaper computers by merely simulating the data access services of the Middleware.

Other advantages usually come from various packages that come with, or can easily be integrated with the middleware. Examples include packages such as Crystal Reports and Oracle Financials. Finally, the encapsulation of data is a step towards Object Orientation, with its promises of flexibility and reuse.

To make use of middleware packages, you may need J & C Migrations to decipher the data definitions hidden in RPGII applications, and format them into record descriptions that can be loaded directly to middleware data dictionaries and schema repositories.


Click here for the Schema Capture expert!

--------------------------------------------------------------------------------------------------------------------

Portable COBOL is a subset of Standard COBOL

The COBOL Standard requires Vendor organizations to compete on performance, price, and added value features. The freedom of vendors to innovate with certain features is formalized in the COBOL Standard under the term "Implementor Defined". As COBOL is now over 40 years old, certain common features that used to be Implementor Defined extensions have became Standard Defined features in recent COBOL Standards.

One example of an Implementor Defined feature of COBOL, superceded by a Standard Defined feature, is USAGE COMPUTATIONAL. The Standard-compliant definition:
    03 MY-FIELD PICTURE S9(4) COMPUTATIONAL VALUE 0.
which in COBOL for MVS and VM it is Standard-Defined:
    03 MY-FIELD PICTURE S9(4) BINARY VALUE 0.
in COBOL for Wang VS it is Standard-Defined:
    03 MY-FIELD PICTURE S9(4) PACKED-DECIMAL VALUE 0.
and in other COBOL offerings it is Standard-Defined:
    03 MY-FIELD PICTURE S9(4) DISPLAY VALUE 0.

Today's COBOL extensions relate to Database, GUI, and Internet interfaces, but the principles of creating code that is at the same time Feature Rich, Standard Compliant, and Highly Portable, remain the same. The generation and teaching of COBOL that is both Standard Compliant, Current, and Portable are the art and science of J & C Migrations.


Click here for the COBOL Portability expert!

--------------------------------------------------------------------------------------------------------------------

COBOL for RPGII programmers

1. A brief history of COBOL

Inspired by Rear Admiral Grace Hopper, and with significant backing by the US Navy, COBOL was developed in the early 1960s as an Industry (rather than proprietary) COmmon Business Oriented Language. To this day COBOL is the most common 3GL in the world. Commercial quality COBOL facilities are available for Mainframes, Minicomputers, UNIX servers and workstations, and PC systems.

COBOL has had De Jure standards, including the 1968, 1974, and 1985 ANSI standards adapted by ISO and IEC. The 1985 standard had two amendments, the Intrinsic Functions amendment in 1989, and corrections and clarifications in 1992. The next standard, currently being developed jointly by ANSI and ISO, is expected to be approved in 2002.

COBOL also has certain De Facto extensions. For example, while the De Jure standards identify the double quote (") as the quote literal, practically all commercial compilers on the market allow the use of the apostrophe (') as a quoting literal.

The organizations that have participated in the COBOL development and standardization, have included CODASYL, ANSI, and ISO/IEC. COBOL has also benefited from the activities of consortia, such as the X/Open organization.

2. COBOL language concepts

COBOL is a structured language. Programs, divisions, sections, and paragraphs, specify (in this order), identification, the operating environment, data descriptions, interfaces, and operational procedures.

Programs allow encapsulation, or interface based programming. Modularity allows component substitution with minimal disruption, and is considered just as desirable for Software, as it is for hardware.

Divisions, sections, and paragraphs, organize the program into logical elements of interface and internal definitions, data descriptions and procedural code.

COBOL is mostly a Free Form language, with very minimal column sensitivity. COBOL allows long and descriptive names. This allows COBOL source to be written in a self documenting fashion, which was an intended design goal. However, its verbosity has led to multiple abbreviations a person needs to master in order to become fluent.

3. COBOL source structures

Each COBOL program is composed of divisions. The identification division identifies the program (like columns 75-80 of the H-spec). The environment division has a configuration section which provides for the other facilities of the H-spec. The input-output section of the environment division defines the program files. The data division starts with the File section, which completes the definition of files and their records or I-O buffers, and proceeds with a Working-storage section for the definition of program variables, arrays, and data structures. A linkage section concludes the data division with the description of received parameters. These definitional sections are followed by a Procedure Division, whose sections are not predefined.

Your comments are key to improved service!

--------------------------------------------------------------------------------------------------------------------

RPGII for COBOL programmers

1. A brief history of RPGII

RPGII is a 3rd Generation Language (3GL) that evolved out of a popular Report Program Generator (RPG) Mainframe utility. The language has inherited its column-sensitive form and many strengths from the utility.

IBM used RPGII as the primary language on its minicomputers, extending it along with its System 3, System 32, System 34, and System 36 series. In competition and complementation to IBM, many other vendors have provided dialects of RPGII that were adapted to their environments.

Beginning with the System 38, and continuing with the AS/400, IBM have extended the RPG language with 4GL features that support these platforms' Database environment.

2. RPGII Language Concepts

Unlike most other 3GL, RPGII is programmed in fixed templates, and is neither Free Format, nor structured into Definitional and Procedural sections. Data items and complex procedures are defined together, often on the same source line.

Most columns of an RPGII source template are interpreted in a way similar to the Indicator Area in a COBOL program, which may contain a space ( ), the letter D, an asterisk (*), a dash (-), or a forward slash (/), with each having very well defined implications for the interpretation of the source line.

As a result of the above, RPGII tends to be extremely concise and cryptic. Cryptic code does not lend itself to long term maintenance by people other than its authors. While it is possible to write an RPGII program which sorts and reads a consecutive transaction file, and updates an indexed master file with its transactions, in 10 source lines, deciphering such a program and repairing it can be a challenge.

Each RPGII specification can be seen as having three elements: A precondition, a primary purpose, and a postcondition. The conditions have been associated with Condition Indicators, or simply Indicators. The indicators have two character symbols, and predefined locations on each specification type.

Unlike other 3GL, RPGII program control flow is predefined. This predefined program execution order is called the RPGII Cycle. File input is either controlled from the calculations, or directly by the Cycle. For Cycle controlled files, Input Extraction and Output Formatting from and to the I-O buffers are executed as subroutines of the Cycle. Calculations are also executed as subroutines of the Cycle.

The source code defines the files, input-output areas, and data structures that the program uses as well as Data Item Contents Triggers ("Level breaks" and "Matching fields") associated with Input fields.

RPGII is largely a Batch language, although IBM and the seven dwarves have extended it with a different Interactive facility for each platform.

The J & C Migrations translation of RPGII to COBOL has a unique solution for the management of Cycle files without pointers. This solution allows the COBOL code to execute as a single unit, without need for a separate Runtime.

3. RPGII Specifications (column 6 when column 7 isn't * or /)

H - Identification Division, Special-Names paragraph, and more.
F - Input-Output and File sections' information, and more.
E - Arrays, Tables, and Extended file processing options.
L - Linage information.
I - Record and Field Input, Change & Match fields, and more.
C - Calculations, and other Procedure Division subroutines.
O - Record and Field Output formatting, WRITE, REWRITE, and DELETE.

These are augmented with initialization data for tables and arrays, which have a separate and different identification scheme.

In addition to these, specifications have been added for a variety of Interactive and auxiliary facilities, and templates range from A to Z, and have different uses on different platforms. Examples include the U (autoreport) and S (sort and selection) specifications on the IBM Mainframe, S & D screen definitions on IBM S/36, Wang's A (alternate index path), and W (workstation screen) specifications, and others.

We'll be glad to receive your comments!

--------------------------------------------------------------------------------------------------------------------