×
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.
It's Friday and I am brain dead. I am sure I am overlooking something but I
do not see it at this point and would appreciate a second set of eyes. My goal
is to test the IFS for file existence and increment the file name if a file
exists in a directory. In this scenario, I know the file exists in the IFS and
I have full rights to the file but the program returns a not found value. Below
is the relevant code in question. I am testing the program with the following
call statement:
call MYPRGM300 parm('/home/gd290jem/PlmExtract.Dat').
Any help would be greatly appreciated.
Jim Minisce
Godiva Chocolatier, Inc
********************************************************************
*
* Program Parameters
*
********************************************************************
*
*
D MYPRGM300 Pr Extpgm('MYPRGM300')
D File_Path 45a Const
*
D MYPRGM300 Pi
D File_Path 45a Const
********************************************************************
*
* API to test for IFS file existance
*
D access Pr 10i 0 extProc('access')
D ptrIFSFile * value Options(*String)
D AccessMode 10i 0 Const
*
D F_OK C Const(0)
*
* Global program variables
*
D mode S 10u 0
D File_Extension S 15a Varying Inz
D POS1 S 5i 0 Inz
D POS2 S 5i 0 Inz
D WriteFilePath S 100a Inz
D WriteFileName S 100a Inz
D Counter S 5i 0 Inz
D Underscore C CONST('_')
D Period C CONST('.')
// Check for file existence, if the file exists, a zero is
returned.
// If file already exists, increment File_Extension variable so
only
// unique file names are generated. Ex. If file FileName.csv
already
// exists, then set file name to FileName_01.csv and re-test for
existance.
// Keep doing that till a unique name if found.
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.