RSD file system

The RSD (record sequential delimited) file system supports sequential files that have fixed-length records. You can process RSD files by using the standard system file utility functions such as browse, edit, copy, delete, and print.

RSD files provide good performance. They give you the ability to port files easily between AIX and Windows-based systems and to share files between programs and applications written in different languages.

RSD files support all COBOL data types in records of fixed length. Each record that is written is followed by a newline control character. For a read operation, the file record area is filled for the record length. If an end-of-file is encountered before the record area is filled, the record area is padded with space characters.

If you edit an RSD file with a text editor, you must ensure that the length of each record is maintained. For example, if you edit file infile, and want to ensure that each record has 80 characters, you can pad each record to column 80 with spaces and write the result to file outfile by issuing this command:

awk '{printf("\%-80s\n",$0)}' infile > outfile

Attempting a WRITE statement with the AFTER ADVANCING or BEFORE ADVANCING phrase to an RSD file causes the statement to fail with the file status key set to 30.

The RSD file system is safe for use with threads. However, you must ensure that multiple threads do not access the level-01 records for the file at the same time. Multiple threads can perform operations on the same RSD file, but you must use a pthread_cond_wait call or its equivalent to force all but one of the threads to wait for the file access to complete on the active thread.

related concepts  
File organization and access mode