View previous topic :: View next topic
|
Author |
Message |
suraaj
New User
Joined: 16 Apr 2009 Posts: 69 Location: Canada
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
suraaj
New User
Joined: 16 Apr 2009 Posts: 69 Location: Canada
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
suraaj
New User
Joined: 16 Apr 2009 Posts: 69 Location: Canada
|
|
|
|
Thanks Bill...got your point.
Regards Suraj |
|
Back to top |
|
|
|