Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

RECORD CONTAINS 0 TO 2000 CHARACTERS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: RECORD CONTAINS 0 TO 2000 CHARACTERS
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Fri Nov 29, 2013 10:02 pm    Post subject: Reply to: RECORD CONTAINS 0 TO 2000 CHARACTERS
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    Post subject: Reply to: RECORD CONTAINS 0 TO 2000 CHARACTERS
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Fri Nov 29, 2013 10:11 pm    Post subject: Reply to: RECORD CONTAINS 0 TO 2000 CHARACTERS
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    Post subject: Reply to: RECORD CONTAINS 0 TO 2000 CHARACTERS
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us