IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

RECORD CONTAINS 0 TO 2000 CHARACTERS


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
suraaj

New User


Joined: 16 Apr 2009
Posts: 69
Location: Canada

PostPosted: Fri Nov 29, 2013 9:32 pm
Reply with quote

I came across a code like below:
Code:

FD  OUTPUT-BDY
    RECORDING MODE IS V
    LABEL RECORDS ARE STANDARD
    RECORD CONTAINS 0 TO 2000 CHARACTERS
    BLOCK CONTAINS 0 RECORDS.


Whats the difference if code is as below:
Code:

FD  OUTPUT-BDY
    RECORDING MODE IS V
    LABEL RECORDS ARE STANDARD
    RECORD CONTAINS 1 TO 2000 CHARACTERS
    BLOCK CONTAINS 0 RECORDS.


The record length of the file is 2000 with record format as VB. Please clarify

Regards Suraaj
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Nov 29, 2013 10:02 pm
Reply with quote

Minimum record-length four for the first (just the RDW) and five for the second (RDW plus one byte of data).

Since records with no data are pointless, confusing, and probably (when they exist) created in error the 1 TO 2000 is better.

Better yet is an actual minimum. 203 TO 2000 or something. Then when a short record turns up, the run-time (Language Environment) will give you some help by abending.
Back to top
View user's profile Send private message
suraaj

New User


Joined: 16 Apr 2009
Posts: 69
Location: Canada

PostPosted: Fri Nov 29, 2013 10:07 pm
Reply with quote

Thanks Bill for the reply...

But does it mean that 0 to 2000 and 1 to 2000 mean the same??? For clarity let us assume the data is all alphanumeric.

Please clarify

Regards Suraaj
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Nov 29, 2013 10:11 pm
Reply with quote

No, not the same.

0 TO 2000 will allow a record with zero bytes of data to be read/written. 1 TO 2000 will not.

However, if your genuine minimum record-length is 118, then 0 TO 2000 and 1 TO 2000 have the same problem - they would allow short records to be written quietly, without causing a problem. Until later. If you are unlucky, much later. Or much, much later.

So

Code:
RECORD CONTAINS <genuine-minium> TO <genuine-maximum>
Back to top
View user's profile Send private message
suraaj

New User


Joined: 16 Apr 2009
Posts: 69
Location: Canada

PostPosted: Fri Nov 29, 2013 10:20 pm
Reply with quote

Thanks Bill...got your point.

Regards Suraj
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top