How Many COBOL Programs Does It Take To Change A Light Bulb? 
Author Message
 How Many COBOL Programs Does It Take To Change A Light Bulb?

Quote:



>Gotcha! It works fine with undefinded record! And you don't even need to get
>the record-length from parm or anywhere else, you get it directly from the
>file. You get the whole record asis in the exact manner as it is stored. So
>take the first two bytes as binary, subtract 4 and you have the length of the
>real data.

I hadnt thought of retrieving the record len from the actual record.

The real key here is to use RECORDING MODE U and RECORD CONTAINS 0, the
combination of which forces the program to create the proper DCB at
runtime. It is interesting that this combination will also allow you to
read any length FIXED lrecl with the same FD.

--



Sun, 18 Mar 2001 03:00:00 GMT  
 How Many COBOL Programs Does It Take To Change A Light Bulb?

Quote:
><HTML><PRE>Subject: Re: How Many COBOL Programs Does It Take To Change A
>Light Bulb?

>Date: Wed, Sep 30, 1998 13:46 EDT





>>Gotcha! It works fine with undefinded record! And you don't even need to get
>>the record-length from parm or anywhere else, you get it directly from the
>>file. You get the whole record asis in the exact manner as it is stored. So
>>take the first two bytes as binary, subtract 4 and you have the length of
>the
>>real data.

>I hadnt thought of retrieving the record len from the actual record.

>The real key here is to use RECORDING MODE U and RECORD CONTAINS 0, the
>combination of which forces the program to create the proper DCB at
>runtime. It is interesting that this combination will also allow you to
>read any length FIXED lrecl with the same FD.

>--
></PRE></HTML>

Very ingenious, indeed, and it does appear to work, but is there any IBM doc
that indicates that this trick is supported?


Wed, 21 Mar 2001 03:00:00 GMT  
 How Many COBOL Programs Does It Take To Change A Light Bulb?
  <snip>

Quote:

>It would certainly be interesting what Mr. Klein's "usually reliable
source"
>says about it!?!

  <more snip>

I had already sent a query from the original post - but have now sent a
follow-up to see what they say.



Sun, 25 Mar 2001 03:00:00 GMT  
 How Many COBOL Programs Does It Take To Change A Light Bulb?

The following is specific to the IBM COBOL 85 compilers on the MVS platform    
(VS COBOL II, COBOL 370, COBOL for MVS and VM and COBOL for OS390 and VM).  

1.  The maximum length of a record on a variable length record file must    
agree with the length of the record as described in the Data Set Control    
Block (or tape label).  Thus a record described to COBOL as having a maximum    
length of 2000 bytes should have a record length (LRECL) in the DSCB of 2004.      
There is a way around this limitation because JCL provided LRECL overrides    
file (DSCB/ tape label) LRECL so provided the maximum length of the records    
on the file is not greater that 2004, coding LRECL=2004 will get around the    
problem for non-VSAM files.  Unfortunately there is no similar bypass for    
VSAM.  

2.  IBM claims it is enforcing the COBOL standard.  My opinion of that    
requirement and the inability to override it is anger and frustration.  I    
would like and have had use for the ability to point an "FD VARYING-FILE    
RECORD VARYING FROM 0 to 32760 DEPENDING ON VARYING-FILE-RECORD-SIZE." to any    
file in the shop, both VSAM and non-VSAM with fixed, variable or undefined    
records and have the program read it.  This matches one of the functions    
requested in the SHARE/GUIDE Language Futures Task Force White Paper which    
dates back to the early 1980's.  Indeed if we had an easy way to describe    
bridging mechanisms in JCL (inadequate equivalent of Burroughs WFL, AS400    
OCL, etc.) so that programs could process files which differed from what the    
program believed was truth, it would have eased fixing the year 2000 mess.    
This was also defined as highly useful in the white paper.    

Quote:

> ><HTML><PRE>Subject: Re: How Many COBOL Programs Does It Take To Change A  
> >Light Bulb?  

> >Date: Sat, Sep 26, 1998 16:09 EDT  


> >>...actually, I'm wondering how many COBOL programs it takes to copy  
> >variable  
> >>length files!  

> >>Using COBOL For MVS (NOCMPR2) without assembler subroutines, it looks    
like  
> >if  
> >>one wants to copy variable length files with LRECLs ranging from 1 to    
32768  
> >>bytes, one would need 32768 separate programs to avoid File Status 39    
open  
> >>errors - even using ...DEPENDING ON clauses - since COBOL seems to demand  
> >that  
> >>the maximum possible record length (determined at compile time) be no  
> >greater  
> >>than the file's actual LRECL!  

> >>Someone (knowledgeable, not guessing) please tell me what I'm doing    
wrong,  
> >or  
> >>it's time to round up the {*filter*} mob for the Standards folks!  

> >Can you give us some more information on what type of input data you have.  
> >What's the input file consist of?  What, exactly (not partially), is going  
> >on?  

> ></PRE></HTML>  

> Other stuff is going on, but for the purposes of this issue, just assume    
you  
> have to read records from variable length files (different LRECLs) using    
ONE  
> program compiled with COBOL For MVS.    

> The program is to be used with all the variable length files within a    
system,  
> and therein lies the rub. For the COBOL For MVS program to work, it looks    
like  
> the maximum LRECL in the program must agree with the physical files, or a  
> failure occurs at run-time.  

> An earlier post indicated this was the case. I hope someone can prove  
> otherwise, but I'd tend to agree based upon my coworker's efforts and the    
COBOL  
> for MVS documentation.    

Clark F. Morris, Jr.  
CFM Technical Programming Services  
Bridgetown, Nova Scotia, Canada  




Mon, 30 Apr 2001 03:00:00 GMT  
 How Many COBOL Programs Does It Take To Change A Light Bulb?

None... that's a hardware problem.

DD

... and did you know that this joke was *old* before you were even a gleam
down your father's leg?



Fri, 04 May 2001 03:00:00 GMT  
 
 [ 22 post ]  Go to page: [1] [2]

 Relevant Pages 
 

 
Powered by phpBB® Forum Software