Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us