× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Just O on file creates, error if there. "Before any output is written to the
file, the disk space required
 for the file is automatically filled with blanks".  O A on file looks for
file to be there, error if not. Use DFILE-YES parameter in OCL File spec to
allow DELETE File and Rebuild it."Before any output is written to the direct
file that allows deletions, the disk space required for the file is
automatically filled with deleted records.  The relative record number that
you place in the RECNO field indicates where the output record is written to
the direct file. The information in the output record is written over the
deleted record.If a deleted record is not replaced with data, it remains in
the file.  A
record can be added later at this relative record number"
CLRPFM did come later. Think ASNA? product had a CLRPFM type command for
S/36.

Bill H.

-----Original Message-----
From: Richard B Baird [mailto:rbaird@esourceconsulting.com]
Sent: Thursday, September 12, 2002 8:50 AM
To: rpg400-l@midrange.com
Subject: RE: F SPEC to clear a file?



I could be really off base here, but.... IIRC in RPGII, an O without Add,
would 'create' the file new if it didn't exist, (i think, even without the
'new' keyword on the file ocl statement).

I don't remember what happened if the file already existed, but something
tells me it might have overlayed the file on the first write.

I DON'T believe that simply opening and closing the file cleared it -
'clearing' a file wasn't something that the 36 and 34 were at all familiar
with.  you deleted and rebuilt files on those boxes.  CLRPFM was later
added to SSP to help migrating packages slowly to 400 techniques, but only
as an afterthought.

If such a technique existed, i'm would have though that it would have been
in all the techy mags, and widely used in utilites librarys as a way of
clearing files.  you could have just written a generic rpg program that
opened and closed the file, called from a procedure that recieved the files
name:  (my syntax could be rusty):

clrpfm filename

procedure clrpfm:

// load clrpfm
// file name-generic label-?1?
// run

rpgII pgm clrpfm

H
FGENERIC   O    F    1    1     DISK
C           SETON              LR
OGENERIC   D      LRNLR
O                              1 ' '

but, i could be wrong...... ;)

-----original message--------
>I must be missing something here because
>no one else has mentioned this, but
>.... Why don't you simply open the file
>for output, and then close it?

When Jon speaks, I look carefully before answering.  It was my recollection
that O in RPG/400 + did not clear the output file like it did on
S/3/32/34/36.  So I tested it:

fmastest   o    e             disk
C                   SETON                                        LR

This did not clear my file.  So I went hunting through The RPG Reference,
V5R1, but could not find a specific reference.  The S/36 manual wasn't very
helpful either.
Hm.
  --buck

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.