File pattern warning in Sequential file
Moderators: chulett, rschirm, roy
File pattern warning in Sequential file
We are using file pattern in sequential file for concat all files start with "aaam_classif*"and write into one output file. It is working fine if files are available, but if not found any single file that time we want job should be success.
But we are getting one warning" Couldn't find any files on host with pattern"
Could you please suggest any one how to rectify that warning?
Thanks & Regards
SNT_DS
But we are getting one warning" Couldn't find any files on host with pattern"
Could you please suggest any one how to rectify that warning?
Thanks & Regards
SNT_DS
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Make sure in advance (in the job sequence) that there is at least one file that matches the pattern. For example, use an Execute Command activity to ls the directory with the file pattern, and test its exit status or output using the Trigger expression.
You could, as an alternative, create a message handler to demote the warning message to informational.
You could, as an alternative, create a message handler to demote the warning message to informational.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Hi Ray,ray.wurlod wrote:Make sure in advance (in the job sequence) that there is at least one file that matches the pattern. For example, use an Execute Command activity to ls the directory with the file pattern, and test its exit status or output using the Trigger expression.
You could, as an alternative, create a message handler to demote the warning message to informational.
First thanks to you
I have created Sequence job with Execute command:
Success
Execute activity ---------------------> Job Activity
|
|
|Fail
|
Notification activity
In execute Command:
Command: sh -c
Parameter: test -r aaam_classif*
I passed above values in execute Command. But my job is getting one warning
"s_mdf_RD..JobControl (@Execute_Command_0): Command sh -c did not finish OK, reply = '1' "
Could you please suggest me what is wrong in execute Command?
Try the following in execute command stage to check if any files with a particular patter exist.
where filedir is the directory where the files are.
You can run that in execute command stage. If the result is greater than 0, process your job, else send out notification.
Code: Select all
ls <<filedir>> | grep aaam_classif | wc -l
You can run that in execute command stage. If the result is greater than 0, process your job, else send out notification.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What triggers are on the Execute Command activity? The test command returns 1 if the test condition is not met. A pipeline such as that suggested by DSguru2B may be better, as the terminating command (wc) should always set its exit status to 0. You then need to test the command output (not its status) in your triggers.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod wrote:What triggers are on the Execute Command activity? The test command returns 1 if the test condition is not met. A pipeline such as that suggested by DSguru2B may be better, as the terminating command (wc) should always set its exit status to 0. You then need to test the command output (not its status) in your triggers.
Thanks ray..