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: 7315

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: 7315

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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am


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