Pad records for text files

You can define the pad/unpad character for fixed and variable formats at both the file and network level in the SEND, and RECV commands when TYPE = FILE.

Format options

Use the FRECFM and NRECFM parameters to set the record format.

Fixed format

FRECFM = F or NRECFM = F

When using a fixed format, the parameters FPAD and NPAD define the character to use for padding. If FPAD and NPAD are not set, the character used for padding is a space.

Variable format

FRECFM = V or NRECFM = V

When using a variable format, FPAD and NPAD define the character to use to unpad the record. If you do not set FPAD or NPAD, then the record remains unchanged and no unpadding occurs.

Parameters

FPAD = character

This parameter defines the padding character at the file level.

  • Fixed format: Specifies the character to use for padding using FPAD at file level. If FPAD is not set, the padding character is ' '.
  • Variable format: Defines the character to use to unpad the record. If FPAD is not set, the record is unchanged.

NPAD = character

This parameter defines the padding character at the network level.

  • Fixed format: Pads the record with this character up to the size defined by NLRECL. If NPAD is not set, the padding character is ' '.
  • Variable format: Defines the character used to unpad the record. If NPAD is not set, the record is unchanged.

Usage

After the input or output file in each example a representation depicts the file sent or received over the network.

Example of padding a variable format file on the sender side

In the SEND profile (CFTSEND object) specify:

fcode=ASCII

frecfm=V

nrecfm=F

nlrecl=<desired_record_size>

npad=@

Input file

Axway

Transfer CFT

v 3.2.2

File sent over the network, when nlrecl=20:

Axway@@@@@@@@@@@@@@@

Transfer CFT@@@@@@@@

v3.0.1@@@@@@@@@@@@@@

Example of unpadding a fixed format file on the sender side

In SEND profile specify:

Input file when flrecl=20:

Axway@@@@@@@@@@@@@@@

Transfer CFT@@@@@@@@

v 3.2.2@@@@@@@@@@@@@@

File sent over the network:

Axway

Transfer CFT

v 3.2.2

Example of padding a variable format file on the receiver side

In the RECV profile specify:

fcode=ASCII

frecfm=F

flrecl=<desired_record_size>

fpad=@

File received from the network:

Axway

Transfer CFT

v 3.2.2

Output file

Axway@@@@@@@@@@@@@@@

Transfer CFT@@@@@@@@

v 3.2.2@@@@@@@@@@@@@@

Example of unpadding a fixed format file on the receiver side

In the RECV profile specify:

fcode=ASCII

frecfm=V

fpad=@

File received from the network

Axway@@@@@@@@@@@@@@@

Transfer CFT@@@@@@@@

v 3.2.2@@@@@@@@@@@@@@

Output file

Axway

Transfer CFT

v 3.2.2

Related Links