‎2008 Apr 21 10:08 AM
Hi All,
Can any one tell what is the difference between MAXIMUM LENGTH and ACTUAL LENGTH addition in READ DATASET.
Regards,
Nikhil
‎2008 Apr 21 10:11 AM
Hi,
Using the MAXIMUM LENGTH addition, the number of characters or bytes to be read from the file can be limited. Using ACTUAL LENGTH, the number of characters or bytes actually used can be determined.
Reward if useful.
Regards,
Swetha.
‎2008 Apr 21 10:11 AM
Hi,
Using the MAXIMUM LENGTH addition, the number of characters or bytes to be read from the file can be limited. Using ACTUAL LENGTH, the number of characters or bytes actually used can be determined.
Reward if useful.
Regards,
Swetha.
‎2008 Apr 21 10:12 AM
Hi,
Syntax
READ DATASET <dsn> INTO <f>
[MAXIMUM LENGTH <maxlen>]
[ACTUAL LENGTH <len>].
Reads the contents of the file <dsn> on the application server to the variable <f>. The amount of data can be specified using MAXIMUM LENGTH. The number of bytes transferred can be written to <len> using ACTUAL LENGTH.
Reward points if useful...
Regards
AK
‎2008 Apr 21 10:14 AM
hi check this...
Syntax
READ DATASET <dsn> INTO <f>
MAXIMUM LENGTH <maxlen>
ACTUAL LENGTH <len>.
Reads the contents of the file <dsn> on the application server to the variable <f>. The amount of data can be specified using MAXIMUM LENGTH. The number of bytes transferred can be written to <len> using ACTUAL LENGTH.
regards,
venkat
‎2008 Apr 21 10:18 AM
hi,
MAXIMUM LENGTH : This addition determines how many characters or how many bytes maximum are read from the file
ACTUAL LENGTH This addition assigns the number of characters or bytes to be read from the file to the data object .
reward if helpful
prasanth
‎2008 Apr 21 10:21 AM
hi,
READ DATASET dset INTO dobj [MAXIMUM LENGTH mlen]
[[ACTUAL] LENGTH alen].
Using the MAXIMUM LENGTH addition, the number of characters or bytes to be read from the file can be limited. Using ACTUAL LENGTH, the number of characters or bytes actually used can be determined.
DATA: file TYPE string VALUE `flights.dat`,
hex_container TYPE x LENGTH 1000,
len TYPE i.
FIELD-SYMBOLS <spfli> TYPE spfli.
DESCRIBE FIELD <spfli> LENGTH len IN BYTE MODE.
OPEN DATASET file FOR INPUT IN BINARY MODE.
ASSIGN hex_container TO <spfli> CASTING.
DO.
READ DATASET file INTO hex_container MAXIMUM LENGTH len.
IF sy-subrc = 0.
WRITE: / <spfli>-carrid,
<spfli>-connid,
<spfli>-countryfr,
<spfli>-cityfrom,
<spfli>-cityto,
<spfli>-fltime,
<spfli>-distance.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET file.