Title: | "ASK THE WIZARDS" |
Moderator: | QUARK::LIONEL |
Created: | Mon Oct 30 1995 |
Last Modified: | Mon May 12 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 1857 |
Total number of notes: | 3728 |
Return-Path: "VMS001::WWW"@vms001.das-x.dec.com Received: by vmsmkt.zko.dec.com (UCX V4.1-12, OpenVMS V6.2 VAX); Fri, 17 Jan 1997 16:20:31 -0500 Received: from vms001 by mail11.digital.com (8.7.5/UNX 1.5/1.0/WV) id QAA09505; Fri, 17 Jan 1997 16:11:59 -0500 (EST) Date: Fri, 17 Jan 1997 16:11:40 -0500 Message-Id: <[email protected]> From: "VMS001::WWW"@vms001.das-x.dec.com (17-Jan-1997 1611) To: [email protected], [email protected], [email protected] Subject: Ask the Wizard: '[email protected]' X-VMS-To: [email protected] Remote Host: jjnet.jnj.com Browser Type: Mozilla/2.0 (compatible; MSIE 3.0; Windows NT) Remote Info: <null> Name: Theodore A Isabella Email Address: [email protected] CPU Architecture: VAX and Alpha Version: v 6.2 Questions: I'm writing a DCL program that opens an existing file and places in it information optained from an interactive session, i.e., inout from a keyboard. The problem I have is when I use the OPEN/WRITE or OPEN/APPEND I do not get the desired results. What I would like to is is open the file, move the pointer down about 10 or 12 lines, insert the desired changed and close the file. Regards,
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
1472.1 | Check File Format, Use Of OPEN, READ and WRITE Commands | XDELTA::HOFFMAN | Steve, OpenVMS Engineering | Mon Feb 03 1997 18:33 | 24 |
:I'm writing a DCL program that opens an existing file and places in it :information optained from an interactive session, i.e., inout from a :keyboard. The problem I have is when I use the OPEN/WRITE or OPEN/APPEND :I do not get the desired results. :What I would like to is is open the file, move the pointer down about :10 or 12 lines, insert the desired changed and close the file. Without example code, it is difficult to answer this question. You will want to consider the particular file format that is used, and the format that is appropriate: sequential, relative, or indexed. For files that are regularly modified, a fixed-length sequential, relative, or indexed format is often the best choice. Further, OPEN/READ/WRITE is likely necessary, and you will need to use a loop or other construct to reach the appropriate record. You should also be aware that replacing a record in the middle of a sequential file can be problematic -- the file format must allow this and the record size must be compatible. I'd start by looking at the OpenVMS User's Guide for assistance, as well as the Guide To File Applications... |