File Exists in Directory
Moderators: chulett, rschirm, roy
File Exists in Directory
All,
I want to run the job if the source file exists in directory..if not i want to send an email notifiation to users says source file not exists..
How to check whether file exists in directory..if so run the job else email notification.I am calling this job in sequencer.
Please throw some light on this..
Thanks in advance..
I want to run the job if the source file exists in directory..if not i want to send an email notifiation to users says source file not exists..
How to check whether file exists in directory..if so run the job else email notification.I am calling this job in sequencer.
Please throw some light on this..
Thanks in advance..
something like
use this job with email notification activitiy in a seq
Code: Select all
x=filename
a=$x + `date`.txt
b=ls -l
if [$a -eq $b];
then
continue
else
UtilitytoAbort("File does not exist")
fi
If women didn't exist, all the money in the world would have no meaning.
-- Aristotle Onassis
-- Aristotle Onassis
Sorry my bad. Something like this but check before doing as I am not sure:
Code: Select all
IF EXITS FILENAME
continue
else
UtilitytoAbort("No File")
If women didn't exist, all the money in the world would have no meaning.
-- Aristotle Onassis
-- Aristotle Onassis
Write a routine that tries to rename the file. If the file is not there (rename was unsuccessful) and returns a non zero return code. If its there, it returns 0 as return code. Call this routine in routine activity in a sequence job and check for its return code. If 0, run the job else send out email using Notification Activity.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
DSGuru,
I tried with the following code in the routine its giving error.
Please advise..
I tried with the following code in the routine its giving error
Code: Select all
Call DSEXECUTE("DOS","copy E:\*.*/a E:srcpos.txt/a",output,SystemReturnCode)
Ans = SystemReturnCode
Please advise..
I did..when i test the output says <<ERROR>>
Thanks in advance..Program "DSU.FileExists": Line 2, Unable to open the operating system file "DSU_BP.O/DSEXECUTE".
[ENOENT] No such file or directory
Program "DSU.FileExists": Line 2, Unable to load file "DSEXECUTE".
Program "DSU.FileExists": Line 2, Unable to load subroutine.