Usage Note 9179: Updating RECFM=V external files in place
When updating a RECFM=V external file in place, ensure that the length of each logical record is not changed when fields' values are changed. If the update operation shortens the logical record, an additional end-of-record marker is written to the file. If lengthened, the updated record is either truncated to the length of the original record if SHAREBUFFERS is not used, or overwrites data on the subsequent record if SHAREBUFFERS is used.
To prevent unexpected results, if the length of the updated record is shorter than the original, the updated record should be padded with blanks to ensure the original end-of-record marker is overwritten. To accomplish this, use the LENGTH= option on the INFILE in conjunction with the $VARYINGw. format, as in this example:
data _null_;
infile 'fully qualified path' length=len;
file 'fully qualified path';
input;
_infile_=tranwrd(_infile_,'alter','edit');
put _infile_ $varying. len;
run;
If the update operation might lengthen any logical records, a different file name should be specified in the FILE statement.
Operating System and Release Information
SAS System | Base SAS | Microsoft Windows XP Professional | 9 TS M0 | |
Microsoft Windows NT Workstation | 9 TS M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9 TS M0 | |
Microsoft Windows 2000 Server | 9 TS M0 | |
Microsoft Windows 2000 Datacenter Server | 9 TS M0 | |
Microsoft Windows 2000 Professional | 9 TS M0 | |
z/OS | 9 TS M0 | |
64-bit Enabled Solaris | 9 TS M0 | |
Solaris | 9 TS M0 | |
Microsoft Windows 2000 Advanced Server | 9 TS M0 | |
64-bit Enabled HP-UX | 9 TS M0 | |
HP-UX IPF | 9 TS M0 | |
HP-UX | 9 TS M0 | |
Linux | 9 TS M0 | |
OpenVMS Alpha | 9 TS M0 | |
64-bit Enabled AIX | 9 TS M0 | |
Tru64 UNIX | 9 TS M0 | |
AIX | 9 TS M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Usage Note |
Priority: | medium |
Topic: | Data Management ==> Access ==> External I/O
|
Date Modified: | 2003-01-08 09:55:23 |
Date Created: | 2003-01-08 09:55:23 |