### Handling of Spanned Records

Spanned records are supported by FLAM5 components with a record length of up to 1 MiB. This length can be extended on request. The old FLAM4 components do not support such large records. To write large records to the old FLAMFILE, the matrix with the records must be convert to a block with record length fields in order to write this block into a FLAMFILE. The FLAM4 components will handle such a block as an undefined byte stream. When reading, the conversion from block to records must be requested with the same method to restore the original records.

With XCNV, block/record formatting or conversion capabilities can be used. The CONV command offers the LARGER switch when reading and writing FLAMFILEs to activate the this type of conversion. When LARGER is used the block conversion is performed with the B4X method. There is currently no automatic approach implemented for it.

The following example uses the XCNV command to read a VBS file and write the large records to a FLAMFILE with block formatting.

    //FLCLXCNV EXEC PGM=FLCL,REGION=0M,PARM='XCNV=DD:PARM'
    //STEPLIB  DD DSN=&SYSUID..FLAM.LOAD,DISP=SHR
    //SYSOUT   DD SYSOUT=*
    //SYSPRINT DD SYSOUT=*
    //PARM     DD *
       INPUT(
          SAVE.FILE(
             FIO.REC(
                NAME='<SYSUID>.VBS.LR'
             )
          )
       )
       OUTPUT(
          SAVE.FILE(
             FMT.BLK(
                METHOD=B4X
             )
             FIO.FL4(
                NAME='<SYSUID>.VBS.LR.ADC'
             )
          )
       )
    /*

To read the created FLAMFILE back to records and write it as VBS, the job below can be used, using record conversion.

    //FLCLXCNV EXEC PGM=FLCL,REGION=0M,PARM='XCNV=DD:PARM'
    //STEPLIB  DD DSN=&SYSUID..FLAM.LOAD,DISP=SHR
    //SYSOUT   DD SYSOUT=*
    //SYSPRINT DD SYSOUT=*
    //PARM     DD *
       INPUT(
          SAVE.FILE(
             FIO.FL4(
                NAME='<SYSUID>.VBS.LR.ADC'
             )
             CNV.REC(
                METHOD=B4X
                RECLEN=200KiB
                INICNT=4
             )
          )
       )
       INPUT(
          SAVE.FILE(
             FIO.REC(
                NAME='<SYSUID>.NEWVBS'
                FALLOC(
                   RECFORMAT=VBS
                   RENEW
                )
             )
          )
       )
    /*

The READ/WRITE.FLAM4() objects with the LARGER switch actived will do the same, but without the possibility to change the format of the length field with the METHOD parameter.

The FLAM command of FLCL and the new FLAM4 utility will also support the LARGER switch when reading and writing FLAMFILEs.

By default, the record length for VS/VBS is 1 MiB. To save memory, this can be reduced with the RECLEN parameter.

The FLAM5 I/O will read large V(B)S records by default. This can be deactivated for record I/O by using the switch NOSPAN. This switch is active for the FLAM command of FLCL, or the new FLAM4 utility, if the LARGER switch is not enabled to ensure backwards compatibility.

Automatic record length detection will not work with large records (>=32768). This requires to set the record formatting method when reading such a FLAMFILE.