Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COBOL "real estate" 2

Status
Not open for further replies.

WMK

Programmer
Jun 2, 2003
325
US
I thought I would start a new thread - as a follow-up to some discussions in another thread (and some confusion in that thread).

The 2002 ISO Standard introduces "free form reference format". So let's talk about "fixed format reference format" first - which is the ONLY *standard* definitiion before 2002.

In that format there were 4 "things" of interest:

1) Columns 1 - 6
- up until the '85 Standard this was for sequence numbers and needed to be numeric (in ascending order). In the '85 Standard this was expanded to allow any alphanumeric character.

2) Column 7
- this was the "indicator" area and allowed
- space (doing nothing special)
- * (for a comment)
- D (for a debugging line)
- / (for a listing page break)
- - (for a continuation line)

3) Columns 8-11
- This was for the A-Area. In a STANDARD CONFORMING compiler certain "structures" must start in this column (e.g. paragraph names, 01 levels, etc) - while other items must NOT start in this area (e.g. procedure division statements, 02-49 levels, etc)

4) Column 12 - ANYWHERE THE IMPLEMENT SAID
NOTE WELL: the end of this area was NOT specified to be column 72 - and at least some compilers supported column 80 - and there was no restriciton on where it was.
- This is the B-AREA. The "position specifing the ending" was called the "R-Margin". Any "syntax" (unless required to be in the A-area) could be in this area.

NOTE WELL:
There was some confusion whether "conforming" implementations could or could not allow "comments" between the R-margin and the "end-of-line". IBM's mainframe compiler (for example) allowed "comments" in columns 73-80.

NOTE WELL 2:
For implementations with "line sequential" type source code, allowing the "end-of-line" indicator in the middle of alphanumeric literals was a "real problem". Most (all?) conforming compilers had SOME "option" to allow this, but it was rarely the default. The '85 (and earlier) Standards *assumed* a "record sequential" type source code - which caused some problems for non-COBOL oriented (source code) text editors.

***

Various "'85 Standard compilers" (and earlier) allowed:
- data in columns 1-7
- A-/B-area "confusion"

but this was always an EXTENSION and when "standard conformance flagging" was turned on, a message needed to be issued. There was NO consistancy in implementations with these extensions - especially when it came to comments and continuations.

***

In the 2002 Standard, the "free form reference format" introduces

A) the ability to have up to 255 CHARACTERS (not columns) per line.

B) New "indicators" and "directives" to handle what used to be dealt with in column 7, i.e.
>>PAGE
*> comment lines
>>D debugging lines
new types of literal continuations

NOTE WELL:
These new indicators/directives are ALSO allowed in fixed form reference format.

C) removal of all A-/B-area restrictions. (For implementations - such as IBM's mainframe compiler - that used to allow the period at the end of paragraphs to be optional, this will now need to be removed.)

D) A directive to "switch" between fixed and free form reference format in the middle of a source program.

Bill Klein
 

I've used CTC’s stuff, starting with SPF/PC since about ’84. Now it’s SPF/GUI, which comes with a separate “legacy” version called SPF/3270. I’ve tried a few others over the years; in my “book” SPF’s still the best.
 
TLogan -

Regarding your challenge: for some years I had a couple of programs that compiled and ran in production with no changes on both HP/MPE and IBM VSE systems. In a mixed-vendor environment, you learn to pay attention to what's in the the standard and what's not.

Regards.

Glenn
 
You're right, Crox. The next best thing to edit macros is to string cmds together in pf keys. I save the more usefull, generic strings in a PDS and cut & paste them into the keys.

Here's a few I use:

Positions the cursor at the last non-blank pos on the line. position the cursor anywhere on the line before pos 72 and press the PF key.

f 71 p'=';f '^' prev

This one duplicates your's, Crox, but generalizes it. Just enter the string you want to find on the cmd line and press the PF key.

x all;f all

With this one create a member in the same PDS you're editing and fill it with the data you want to insert into the member you're editing, then press the PF key.

f whatever;:a;copy insrtmbr

Regards, Jack.
 
3gm -

GREAT!

I think you illustrate my point, though. As long as you stick to the "standards" and don't ask the language to do things it wasn't meant to do (ie, extensions and enhancments), you save yourself a LOT of headaches.

Regards,
TLogan
The Man Without an Interesting Moniker
 
Crox, although this is the wrong forum, thanks for bringing up that despicable practice of untouchability to light.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top