View previous topic :: View next topic
|
Author |
Message |
sathish1760
New User
Joined: 02 May 2008 Posts: 42 Location: chennai
|
|
|
|
Can anybody tell me the maximum characters accepted by accept statement in cobol?
sathish |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Did you check the manual link at the top of the page? I've found the Language Reference is real good at telling you what the limits are in COBOL. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Quote: |
ACCEPT: record length on input device 32,760
|
As could have been surmised. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
Let's consider:
Code: |
ACCEPT--identifier-1 FROM mnemonic-name. |
If mnemonic-name is System input device- The length of a data transfer is the same as the length of the record on the input device, with a maximum of 32,760 (as Kevin has said).
From the manuals:
Quote: |
The system input device is read until identifier-1 is filled or EOF is encountered. If the length of identifier-1 is not an even multiple of the system input device record length, the final record will be truncated as required. If EOF is encountered after data has been moved, and before identifier-1 has been filled, identifier-1 is padded with blanks. If EOF is encountered before any data has been moved to identifier-1, padding will not take place and identifier-1 contents will remain unchanged. Each input record is concatenated with the previous input record.
If the input record is of a fixed-length format, the entire input record is used. No editing is performed to remove trailing or leading blanks.
If the input record is of the variable-length format, the actual record length is used to determine the amount of data received. With variable format records, the Record Definition Word (RDW) is removed from the beginning of the input record. Only the actual input data is transferred toidentifier-1. |
|
|
Back to top |
|
|
|