× 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.



Hi.

Just a comment to emptying files in programs.  If a physical file(PF) is opened 
output in COBOL, it will be cleared.  Open of logical files(LF) will not clear 
the file.

Mvh.

Geir Kildal
IT-konsulent
Nordea Finans Norge AS 
Storgt. 10
2815 Gjøvik
Tlf.: +47 611 36428
Mob.: +47 90 10 13 16
E-post geir.kildal@xxxxxxxxxxxxxxx

.


-----Original Message-----
From: cobol400-l-bounces+geir.kildal=nordeafinans.no@xxxxxxxxxxxx
[mailto:cobol400-l-bounces+geir.kildal=nordeafinans.no@xxxxxxxxxxxx]On
Behalf Of Zangare Basil
Sent: Friday, January 27, 2006 6:21 PM
To: COBOL Programming on the iSeries/AS400
Subject: Re: [COBOL400-L] File creation questions


You're right, it's not exclusive to ILE.  

How the file is going to be used must be taken into consideration.  In
the case where a program maybe used by more than user at the same time
it's best to create the file in QTEMP.  Otherwise someone could either
clobber your data or lock you out of the file if it's opened as an
output file.

Another way to create the file in QTEMP with a CL program is with
CRTDUPOBJ.  This will copy an exist file/object to QTEMP.  The DATA(*NO)
option copies only the structure.

CRTDUPOBJ       OBJ(TextFile)
                FROMLIB(UAVPROFL)
                OBJTYPE(*FILE)
                TOLIB(QTEMP)
                NEWOBJ(*OBJ)
                DATA(*NO)



Basil Zangare
Applications Specialist
Nikon Inc
1300 Walt Whitman Road
Melville, New York 11747
phone: (631) 547-4389
fax: (631) 547-4026
bzangare@xxxxxxxxx


-----Original Message-----
From: cobol400-l-bounces@xxxxxxxxxxxx
[mailto:cobol400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jon Paris
Sent: Friday, January 27, 2006 11:17 AM
To: COBOL Programming on the iSeries/AS400
Subject: Re: [COBOL400-L] File creation questions

 >> I'm not too familiar with this method since my shop doesn't use all
of
the ILE techniques.

This isn't really an ILE technique.  It was added because the iSeries
COBOL
compilers were not fully ANSI compliant under the revised interpretation
of
the standard. i.e. If an output file doesn't exist it will be created by
opening/writing it.

The support is minimal and it is not recommended to use it for anything
other than compatibility reasons (e.g. if you want identical code to run
on
multiple platforms).  The reason it is not recommended is that creating
a
file on an iSeries carries a much heavier overhead than creating a file
on
(say) a Unix box.  This is because all files on the iSeries are
databases
and that is a little more complex to build than a simple flat or ISAM
file.

The method suggested for iSeries is to create the file permanently and
then
if you need it to be "emptied" on each use, run a CLRPFM from a CL prior
to
the program or run the CLRPFM via QCMDEXC within the COBOL prior to
opening
the file.

I believe it is possible to control the location of the created file,
but I
suspect only via an OVRDBF - and if you're going to do that you might as
well do it properly.


Jon Paris
Partner400

www.Partner400.com
www.RPGWorld.com



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.