CNAB240 Seg AFixed-width file

CNAB240 Segmento A — Brazil's payment instruction record

One payment inside a Brazilian . is the layout FEBRABAN publishes for the files a company and its bank exchange, and Segmento A is the line that says pay this person this amount on this date. The names are worth unpacking once, because each one tells you something. FEBRABAN is the Federação Brasileira de Bancos, the Brazilian banks' own federation. That is why one layout is published for the whole market rather than one per bank. CNAB is the Centro Nacional de Automação Bancária, the banking-automation body the format is named after. And 240 is the length of a line in characters.

DIRECTION: From a company to its bank as a remessa (a file of instructions), and back from the bank to the company as a retorno (the same layout, carrying what happened). The return file is the same shape as the instruction file, which is why the last field of this record is a set of occurrence codes that mean nothing on the way out and everything on the way back.

WHO IS INVOLVED

  • Pagador (the paying company)Writes the file. Its accounts-payable system produces one Segmento A per payment, counts them into a lote, and counts the lotes into a file.
  • Banco (the bank)Reads the file against the layout version agreed with the customer, executes each payment, and sends the same records back with the outcome written into the reserved fields.
  • Favorecido (the beneficiary)This domestic profile identifies the beneficiary using bank/branch/account fields. That does not mean Brazil has no IBAN: current Swift Registry 103 has a 29-character BRformat for international use.

WHAT TO UNDERSTAND ABOUT IT

The whole record is 240 characters with no tags, no field names and no separators — which is the single most important thing to understand about it, because it means the file cannot tell you what it contains. Only the layout document can.

Version + profile: CNAB240 Seg A is a fixed-width layout, so a field is found by counting characters and a layout version is not cosmetic: when a publisher revises the document, positions move and a reader that counts to the old offset reads the wrong field rather than failing. Check the version your counterparty is sending before building against this page, and check whether they have a house variant — several of these formats are published as a standard that banks are free to extend.

2 MESSAGES