Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Fixed Width / Length for OPEN DATASET

Former Member
0 Likes
1,123

Hi All,

Is there a way to recreate in OPEN DATASET the functionality that WS_UPLOAD have particularly on adding spaces at the end of a record.

WS_UPLOAD uses the flag :

trunc_trailing_blanks = ' '

trunc_trailing_blanks_eol = ' '

Thanks and best regards!!!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
943

Hi KLL,

First of all, WS_UPLOAD does not have those parameters. Please check IMPORT parameters of WS_UPLOAD. Also, WS_UPLOAD does not add spaces at the end of the record.

Parameters trunc_trailing_blanks = ' ' and trunc_trailing_blanks_eol = ' ' are present in IMIPORT parameters of GUI_DOWNLOAD.

Hence, please reframe your question.

Reward points if the answer is helpful.

Regards,

Mukul

6 REPLIES 6
Read only

Former Member
0 Likes
943

Try using 'Length len' addition with TRANSFER statement.

TRANSFER f TO g LENGTH len.

Read only

0 Likes
943

Thanks Darshil.

May I know how do you do it on READ DATASET

Read only

0 Likes
943

Sorry I read DOWNLOAD rather than UPLOAD earlier.

try

READ DATASET dsn MAXIMUM LENGTH len.

Just to add here,

here length is considered is bytes if the file is opened in byte mode and it will be considered in characters if it is opened in text mode.

Reward all useful answers.

Read only

Former Member
0 Likes
944

Hi KLL,

First of all, WS_UPLOAD does not have those parameters. Please check IMPORT parameters of WS_UPLOAD. Also, WS_UPLOAD does not add spaces at the end of the record.

Parameters trunc_trailing_blanks = ' ' and trunc_trailing_blanks_eol = ' ' are present in IMIPORT parameters of GUI_DOWNLOAD.

Hence, please reframe your question.

Reward points if the answer is helpful.

Regards,

Mukul

Read only

0 Likes
943

Hi All,

Is there a way to recreate in OPEN DATASET the functionality that GUI_DOWNLOAD have particularly on adding spaces at the end of a record.

GUI_DOWNLOAD uses the flag :

trunc_trailing_blanks = ' '

trunc_trailing_blanks_eol = ' '

Thanks and best regards!!!

Read only

0 Likes
943

Hi,

No, you can not add spaces at the end of the record using OPEN DATASET statement.

You can vary the length of the variable to keep some empty spaces at the end of the record.

Reward points if the answer is helpful.

Regards,

Mukul