Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding a 4gl file 1

Status
Not open for further replies.

Sonk

Technical User
Jun 5, 2001
31
US
How can I check for the existance of a file in 4gl? I am running AIX 4.3.3.
 
Sonk:

Are you asking how to find a specific file in a file system? If so this might help:

# untested
find . -type f -name file.4gl -print

# or all 4gl files
find . -type f -name "*.4gl" -print

If I've missed something, please provide more information.

Regards,

Ed
 
I should have indicated that I am using 4gl, and would like to enter a command from that point.
 
Sonk:

Sorry, I didn misunderstand.

Anyway, 4GL is very brain-dead when dealing with the Unix OS. You could do something like this:

main

run "test -r zz.4gl; echo $? > r.file"
end main

If the file exists, a value of zero is redirected to r.file. If it doesn't exist, a non-zero value redirects to r.file.

You then can do something like this:

load from r.file insert into some_table_with_one_smallint_column

and select what is in the table. This is a real kludge.

In the past, I developed "C" functions callable by 4GL. Check out this FAQ:

forum179

One of the function examples does exactly what you ask. Of course, there are issues with introducing "C" in your 4GL. This FAQ discusses those issues.

Regards,

Ed
 
Your 4-letter command was exactly what we needed. Thank you so much for your time-saving advice.

thumbsup2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top