From: Graham Hobbs on
Hello,

Today I downloaded the COBDATA COBOL source code and compiled it on my
Windows XP machine using the IBM compiler that is part of Rational
Developer for System z. I had to make many cosmetic changes, split the
text of several lines, do one logic change because of EXIT PERFORM,
and changed the input file to cobdatai.

It ran to conclusion but didn't seem to work too well:-(.

-----------------------
My input CMD file was:
-----------------------
set cobdatai=c:\copylibg\w06403.cbl
cobdata

----------------------
Where the copybook w06403 contains:
---------------------
01 WS-F06403-REC.
05 WS-CSTMR-NBR PIC X(8).
05 WS-CSTMR-MOP14-INFO.
10 WS-CSTMR-NAME PIC X(30).
10 WS-CSTMR-ADR1 PIC X(32).
etc

----------------------
and the output was:
----------------------
LVL NAME POS LEN TYP OC
1 01 - 1
2 05 - 1
3 05 - 1
4 10 - 1
5 10 - 1
etc

-------------------------
and the logic change (091128's) I made was:
-------------------------
PERFORM VARYING N FROM 1 BY 1 UNTIL N GREATER THAN
LINE-LIMIT
IF LINE-BYTE (N) EQUAL TO '*' AND
N LESS THAN LINE-LENGTH AND
LINE-BYTE (N + 1) EQUAL TO '>'
091128* EXIT PERFORM
091128 COMPUTE N = LINE-LIMIT + 1
END-IF
091128 IF N NOT > LINE-LIMIT
IF LINE-BYTE (N) NOT EQUAL TO SPACE
MOVE N TO LINE-LENGTH
END-IF
091128 END-IF
END-PERFORM
------------------------------

Is there something obvious I've missed or must I do a complete desk
check of all the cometic changes I made (not because I enjoyed it, but
because I got so many errors with my compiler that it seemed like the
thing to do).
Is there anybody else who has changed COBDATA to run with an IBM
compiler?
Please, thanks,
Graham Hobbs
From: William M. Klein on
"IBM COBOL for Windows" (the compiler that comes with RDz is totally
compatible with IBM Enterprise COBOL (on IBM mainframes). It has many, MANY
differences from Micro Focus and Fujitsu (aka Alchamy) COBOL compilers
common in Windows environments.

I would think that a "conversion" of the COBDATA source code would be medium
error pronte and likely to hit several features that are different or
missing in the RDz compiler.

"Graham Hobbs" <ghobbs(a)cdpwise.net> wrote in message
news:g6m3h5deqg28t44ksc1f11eah41eh4cc9u(a)4ax.com...
> Hello,
>
> Today I downloaded the COBDATA COBOL source code and compiled it on my
> Windows XP machine using the IBM compiler that is part of Rational
> Developer for System z. I had to make many cosmetic changes, split the
> text of several lines, do one logic change because of EXIT PERFORM,
> and changed the input file to cobdatai.
>
> It ran to conclusion but didn't seem to work too well:-(.
>
> -----------------------
> My input CMD file was:
> -----------------------
> set cobdatai=c:\copylibg\w06403.cbl
> cobdata
>
> ----------------------
> Where the copybook w06403 contains:
> ---------------------
> 01 WS-F06403-REC.
> 05 WS-CSTMR-NBR PIC X(8).
> 05 WS-CSTMR-MOP14-INFO.
> 10 WS-CSTMR-NAME PIC X(30).
> 10 WS-CSTMR-ADR1 PIC X(32).
> etc
>
> ----------------------
> and the output was:
> ----------------------
> LVL NAME POS LEN TYP OC
> 1 01 - 1
> 2 05 - 1
> 3 05 - 1
> 4 10 - 1
> 5 10 - 1
> etc
>
> -------------------------
> and the logic change (091128's) I made was:
> -------------------------
> PERFORM VARYING N FROM 1 BY 1 UNTIL N GREATER THAN
> LINE-LIMIT
> IF LINE-BYTE (N) EQUAL TO '*' AND
> N LESS THAN LINE-LENGTH AND
> LINE-BYTE (N + 1) EQUAL TO '>'
> 091128* EXIT PERFORM
> 091128 COMPUTE N = LINE-LIMIT + 1
> END-IF
> 091128 IF N NOT > LINE-LIMIT
> IF LINE-BYTE (N) NOT EQUAL TO SPACE
> MOVE N TO LINE-LENGTH
> END-IF
> 091128 END-IF
> END-PERFORM
> ------------------------------
>
> Is there something obvious I've missed or must I do a complete desk
> check of all the cometic changes I made (not because I enjoyed it, but
> because I got so many errors with my compiler that it seemed like the
> thing to do).
> Is there anybody else who has changed COBDATA to run with an IBM
> compiler?
> Please, thanks,
> Graham Hobbs


From: Pete Dashwood on
Graham Hobbs wrote:
> Hello,
>
> Today I downloaded the COBDATA COBOL source code and compiled it on my
> Windows XP machine using the IBM compiler that is part of Rational
> Developer for System z. I had to make many cosmetic changes, split the
> text of several lines, do one logic change because of EXIT PERFORM,
> and changed the input file to cobdatai.
>
> It ran to conclusion but didn't seem to work too well:-(.
>
> -----------------------
> My input CMD file was:
> -----------------------
> set cobdatai=c:\copylibg\w06403.cbl
> cobdata
>
> ----------------------
> Where the copybook w06403 contains:
> ---------------------
> 01 WS-F06403-REC.
> 05 WS-CSTMR-NBR PIC X(8).
> 05 WS-CSTMR-MOP14-INFO.
> 10 WS-CSTMR-NAME PIC X(30).
> 10 WS-CSTMR-ADR1 PIC X(32).
> etc
>
> ----------------------
> and the output was:
> ----------------------
> LVL NAME POS LEN TYP OC
> 1 01 - 1
> 2 05 - 1
> 3 05 - 1
> 4 10 - 1
> 5 10 - 1
> etc
>
> -------------------------
> and the logic change (091128's) I made was:
> -------------------------
> PERFORM VARYING N FROM 1 BY 1 UNTIL N GREATER THAN
> LINE-LIMIT
> IF LINE-BYTE (N) EQUAL TO '*' AND
> N LESS THAN LINE-LENGTH AND
> LINE-BYTE (N + 1) EQUAL TO '>'
> 091128* EXIT PERFORM
> 091128 COMPUTE N = LINE-LIMIT + 1
> END-IF
> 091128 IF N NOT > LINE-LIMIT
> IF LINE-BYTE (N) NOT EQUAL TO SPACE
> MOVE N TO LINE-LENGTH
> END-IF
> 091128 END-IF
> END-PERFORM
> ------------------------------
>
> Is there something obvious I've missed or must I do a complete desk
> check of all the cometic changes I made (not because I enjoyed it, but
> because I got so many errors with my compiler that it seemed like the
> thing to do).
> Is there anybody else who has changed COBDATA to run with an IBM
> compiler?
> Please, thanks,
> Graham Hobbs

--
"I used to write COBOL...now I can do anything."


From: Pete Dashwood on
Sorry about blank response, finger trouble.

Some qick coments below...

Graham Hobbs wrote:
> Hello,
>
> Today I downloaded the COBDATA COBOL source code and compiled it on my
> Windows XP machine using the IBM compiler that is part of Rational
> Developer for System z. I had to make many cosmetic changes, split the
> text of several lines, do one logic change because of EXIT PERFORM,
> and changed the input file to cobdatai.

I'm not familair with this version of COBOL but am interested to know why a
file name needed to be changed...?

>
> It ran to conclusion but didn't seem to work too well:-(.
>
> -----------------------
> My input CMD file was:
> -----------------------
> set cobdatai=c:\copylibg\w06403.cbl
> cobdata
>
> ----------------------
> Where the copybook w06403 contains:
> ---------------------
> 01 WS-F06403-REC.
> 05 WS-CSTMR-NBR PIC X(8).
> 05 WS-CSTMR-MOP14-INFO.
> 10 WS-CSTMR-NAME PIC X(30).
> 10 WS-CSTMR-ADR1 PIC X(32).
> etc
>

That looks OK...

> ----------------------
> and the output was:
> ----------------------
> LVL NAME POS LEN TYP OC
> 1 01 - 1
> 2 05 - 1
> 3 05 - 1
> 4 10 - 1
> 5 10 - 1
> etc

That certainly doesn't... :-)
>
> -------------------------
> and the logic change (091128's) I made was:
> -------------------------
> PERFORM VARYING N FROM 1 BY 1 UNTIL N GREATER THAN
> LINE-LIMIT
> IF LINE-BYTE (N) EQUAL TO '*' AND
> N LESS THAN LINE-LENGTH AND
> LINE-BYTE (N + 1) EQUAL TO '>'
> 091128* EXIT PERFORM
> 091128 COMPUTE N = LINE-LIMIT + 1

I think you need to save the value of N before you increment it to cause the
exit perform.

It's a long time since I looked at the code but I'm pretty sure it will use
the value of N later on.



> END-IF
> 091128 IF N NOT > LINE-LIMIT
> IF LINE-BYTE (N) NOT EQUAL TO SPACE
> MOVE N TO LINE-LENGTH
> END-IF
> 091128 END-IF
> END-PERFORM
> ------------------------------
>
> Is there something obvious I've missed or must I do a complete desk
> check of all the cometic changes I made (not because I enjoyed it, but
> because I got so many errors with my compiler that it seemed like the
> thing to do).

Without seeing the kind of errors it threw and whether they are knock-ons or
serious, it is hard to advise.

Obviously, you have needed to chage the code to make it run on your
platform. Somewhere along the way, errors have been introduced.

So it would seem that a check on the changes made might be in order...

Faced with converting it to run on your platform here's what I would do:

1. Check that nested programs are supported in your environment.
2. Compile it and try and establish exactly WHICH constructs it uses which
are problematic. For example, you know that EXIT PERFORM is not supported so
you chose to get the same effect by incrementing the control variable beyond
the limit. Fair enough, but if that variable is used and expected to contain
something important (like the length of the string being processed) then
this will be disastrous. Find all the EXIT PERFORMS and make sure that in
each case, you save the controlling variable before you increment it to
cause exit. However even this does not duplicate the action of an EXIT
PERFORM because control is transferred to the action following the PERFORM
and nothing within the range of the PERFORM is executed. Your "equivalent
code" needs to check the condition again before it can exit.

So, if it were me, I'd be looking for a way of coding an EXACT equivalent to
the unsupported verb, and I'd TRY to use that consistently throughout the
program (especially if I wasn't absolutely sure of what the code was trying
to do...)

In the case above I believe the code is trying to establish the length of
the input line, discarding *> and what follows that, as it is not interested
in comments. (It may be that your compiler does not support *> as an
embedded comment for COBOL and that would cause a large number of compile
errors if the COBDATA code uses this...)

There is a function in Fujitsu COBOL that will return the effective length
of a string, but I think that Robert was either not aware of this or
deliberately didn't use it, to try and keep some compatibility. Anyway, what
you need to do is to set N to the length of the effective string terminated
by *> or all blanks

Here's something that SHOULD give you what you need and you could replace
the whole complex PERFORM and its range with these lines...

MOVE ZERO TO N
INSPECT LINE-IN
TALLYING N
FOR ALL "*>"
IF N = ZERO
INSPECT LINE-IN
TALLYING N
FOR ALL CHARACTERS BEFORE ALL SPACE
ELSE
MOVE ZERO TO N
INSPECT LINE-IN
TALLYING N
FOR ALL CHARACTERS BEFORE "*>"
END-IF

.... then carry on with the statement which currently follows the
END-PERFORM.


> Is there anybody else who has changed COBDATA to run with an IBM
> compiler?

121 people have downloaded the COBDATA Tool. I don't know how many are using
it on IBM sites.

I know some of them have integrated the source into their own tools and use
it in ways neither Robert nor myself imagined when we undertook to publish
it. (One imaginative use I know of is using it to drive access to
"undefined" COBOL data on a RDB, providing offsets and lengths of fields in
COBOL records for languages like VB...)

There have been 4 errors reported in it and these have been fixed. The last
error was reported several months ago.

I have also had some requests for the code as a COM .DLL (which I have
gladly acceded to) so it can be called from a Web Page.

If you are unable to get it working, Graham, lease let me know.

If you DO get it working please send me the source code so I can post it for
anyone else who may be using the same platform.

Cheers,

Pete.
--
"I used to write COBOL...now I can do anything."


From: Graham Hobbs on
Bill,
Thanks for the info, I had no idea these other COBOL's could be so
'almost freeform' - seems to complicate life?
Anyway, after the cosmetics, essentially the only construct in COBDATA
that wouldn't compile in RDz was one use of EXIT PERFORM.
Graham
---
On Sat, 28 Nov 2009 23:33:38 -0600, "William M. Klein"
<wmklein(a)nospam.netcom.com> wrote:

>"IBM COBOL for Windows" (the compiler that comes with RDz is totally
>compatible with IBM Enterprise COBOL (on IBM mainframes). It has many, MANY
>differences from Micro Focus and Fujitsu (aka Alchamy) COBOL compilers
>common in Windows environments.
>
>I would think that a "conversion" of the COBDATA source code would be medium
>error pronte and likely to hit several features that are different or
>missing in the RDz compiler.
>
>"Graham Hobbs" <ghobbs(a)cdpwise.net> wrote in message
>news:g6m3h5deqg28t44ksc1f11eah41eh4cc9u(a)4ax.com...
>> Hello,
>>
>> Today I downloaded the COBDATA COBOL source code and compiled it on my
>> Windows XP machine using the IBM compiler that is part of Rational
>> Developer for System z. I had to make many cosmetic changes, split the
>> text of several lines, do one logic change because of EXIT PERFORM,
>> and changed the input file to cobdatai.
>>
>> It ran to conclusion but didn't seem to work too well:-(.
>>
>> -----------------------
>> My input CMD file was:
>> -----------------------
>> set cobdatai=c:\copylibg\w06403.cbl
>> cobdata
>>
>> ----------------------
>> Where the copybook w06403 contains:
>> ---------------------
>> 01 WS-F06403-REC.
>> 05 WS-CSTMR-NBR PIC X(8).
>> 05 WS-CSTMR-MOP14-INFO.
>> 10 WS-CSTMR-NAME PIC X(30).
>> 10 WS-CSTMR-ADR1 PIC X(32).
>> etc
>>
>> ----------------------
>> and the output was:
>> ----------------------
>> LVL NAME POS LEN TYP OC
>> 1 01 - 1
>> 2 05 - 1
>> 3 05 - 1
>> 4 10 - 1
>> 5 10 - 1
>> etc
>>
>> -------------------------
>> and the logic change (091128's) I made was:
>> -------------------------
>> PERFORM VARYING N FROM 1 BY 1 UNTIL N GREATER THAN
>> LINE-LIMIT
>> IF LINE-BYTE (N) EQUAL TO '*' AND
>> N LESS THAN LINE-LENGTH AND
>> LINE-BYTE (N + 1) EQUAL TO '>'
>> 091128* EXIT PERFORM
>> 091128 COMPUTE N = LINE-LIMIT + 1
>> END-IF
>> 091128 IF N NOT > LINE-LIMIT
>> IF LINE-BYTE (N) NOT EQUAL TO SPACE
>> MOVE N TO LINE-LENGTH
>> END-IF
>> 091128 END-IF
>> END-PERFORM
>> ------------------------------
>>
>> Is there something obvious I've missed or must I do a complete desk
>> check of all the cometic changes I made (not because I enjoyed it, but
>> because I got so many errors with my compiler that it seemed like the
>> thing to do).
>> Is there anybody else who has changed COBDATA to run with an IBM
>> compiler?
>> Please, thanks,
>> Graham Hobbs
>

 |  Next  |  Last
Pages: 1 2 3 4
Prev: "Climategate" code
Next: IS NUMERIC check for SPACES