John McKown  wrote:

>OP here. I guess I shouldn' t post while "ticked off" at someone. Apologies. 

Not me, I would just be 'p*ssed off!' ;-)

>The real "problem" is that I simply was not able to explain to the programmer 
>__in terms that made sense to a COBOL programmer__ what was happening. His 
>concept of READ ... INTO was that the READ was reading _directly_ INTO the 
>receiving area. 

That is incorrect. Have him read the COBOL Language Ref.

First COBOL, reads in the data, do its checks to see if READ is completed 
successfully and then only MOVE the data to the receiving area according to the 
relevant MOVE and RECORD rules.

For what I know:

If input area is longer than receiving area, you will get abends or your input 
is truncated. Simply.
If input is shorter than receiving, then you get either garbage at the end or 
it is padded up to the end.

AFAIK, COBOL has reserved areas for input, working area and also the final 
receiving area. Depending on your declaration those areas may be pre-filled in 
with blanks, zeroes or whatever you place in.

Just get that in your programmer's empty brain. There  should be ample space 
for that. ;-)

>I have now learned, from this discussion, that the way that a COBOL programmer 
>would say it is that the READ ... INTO is simply a shortcut way of saying READ 
>FILE followed by a MOVE FD TO 01 statement. 

Correct. And please reread Peter Farley's snippet. This could help you.

>And that is why it works sometimes and S0C4-4's other times. 

Because you would overwrite something. So your programmer really needs to think 
like a COBOL programmer. You want to use COBOL, use the COBOL's rules. Same for 
Assembler or other languages.

>I would guess that if the programmer made the ODO variable be the name of the 
>variable in the FD which does contain the correct value, that it would work as 
>he wants every time. I don't know why he put the ODO variable into a WORKING 
>STORAGE variable. 

If he does not tell you, simply stop help him or put a COBOL Language Ref book 
under his nose (and eyes!).

>I am, and think like, an HLASM programmer. So my explanations sometimes are in 
>the correct "dialect" when I talk to COBOL-only people. 

>Again, many thanks to all. I'll try to explain to him when I get back from 
>vacation on Monday.

Good luck! ;-D

Groete / Greetings
Elardus Engelbrecht

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to