Re: Request for testing of Reltive File status



Has anyone been able to run this test yet? I haven't gotten any answers on-list
or off-list.

I am particularly interested in what results come from CURRENT versions of
- IBM Enterprise COBOL
- IBM ILE COBOL (or whatever the iSeries compiler is called now)
- Micro Focus (with and without .NET)
- Alchemy (formerly Fujitsu)

--
Bill Klein
wmklein <at> ix.netcom.com
"William M. Klein" <wmklein@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:GJ_Ol.55293$iW4.23123@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I may have asked for this a while ago, but I am trying to find out what as many
compilers/run-times do with this program as possible. I am particularly
interested in which compilers do NOT return a FS=24 when you try and write a
relative record with a key of zero. As I recall, some compilers yield other 2x
values.

You can respond on the list or to me privately. (As far as I can guess, I
don't think that compiler directives/options should make a difference,
however, if you want to try various options, please do so). This will probably
NOT work with pre-85 Standard compilers - not only is it "mixed case" but I
don't think they supported variable length relative files.

Depending on your environment, you will probably have to modify the "ASSIGN
TO" clause and *may* need to "pre-allocate" the relative file.

Sample code follows:

Identification Division.
Program-Id. relfs.
Environment Division.
Input-Output Section.
File-Control.
Select RelFile Assign RelName
Access Dynamic
Organization Relative
Status Rel-FS
Relative Key RelKey .
Data Division.
File Section.
FD RelFile
Record Varying in Size
From 1 to 999
Depending on RelLen.
01 RelRec.
05 RR-Elem occurs 1 to 999 times
Depending on RelLen
Pic X(01).
Working-Storage Section.
01 RF-Stuff.
05 RelName Pic X(08) Value "relftest".
05 Rel-FS Pic X(02).
88 RFS-OK Value "00".
88 RFS-24 Value "24".
05 RelKey Pic 9(03).
05 RelLen Pic 9(03).
Procedure Division.
Mainline.
Perform Create-File
Stop Run
.
Create-File.
Open Output RelFile
If RFS-OK
Move Zero to RelKey
Move 123 to RelLen
Move all "x" to RelRec
Write RelRec
Invalid Key
If RFS-24
Display "Test Passes, FS=24"
Else
Display "Invalid FS:" Rel-FS
End-If
End-Write
Close RelFile
Else
Display "Bad FS on OPEN:" Rel-FS
End-IF
.


--
Bill Klein
wmklein <at> ix.netcom.com



.



Relevant Pages

  • Request for testing of Reltive File status
    ... some compilers yield other 2x ... Depending on your environment, you will probably have to modify the "ASSIGN TO" ... Select RelFile Assign RelName ... Relative Key RelKey. ...
    (comp.lang.cobol)
  • Re: Benefit of not defining the order of execution
    ... the contents of the log can vary depending on the evaluation order, ... execution is that the course of execution is not well defined. ... It can vary from environment to environment, from compiler to ... we need an additional suite of coding standards. ...
    (comp.lang.c)
  • Re: In-Out Parameters for functions
    ... > Why should buggy code work? ... As Ada stands now, it is perfectly ... the compiler cannot know whether particular ... then depending on the order of evaluation within an ...
    (comp.lang.ada)
  • RE: Keeping a handle on your transitions in a mixed assembly
    ... Then I could put something like this at the top of my perf ... Do you mean you would like the compiler could automatically define some ... Get Secure! ...
    (microsoft.public.dotnet.languages.vc)
  • Re: CL implementation
    ... Clisp may fit the requirements, depending on importance of a native ... compiler and your definition of completeness. ...
    (comp.lang.lisp)