I have a job where the target sequential file in stored in a unix directory by using FTP stage. The requirement is to add a email notification whenthe size of the file exceeds a certain size, e.g. 5MB.
Can anyone help me with the way of implementing this change?
Instead of the size, if anyone suggests about scenario where no. of rows in the file increases abruptly over some specified number, that could be also helpful. Thanks.
Tracking the size or no. of rows in a seq file
Moderators: chulett, rschirm, roy
Re: Tracking the size or no. of rows in a seq file
Let your job write entire file even if it exceeds size, in after job subroutine execute one batch script or shell script.
this script will telnet the remote server check for the size of file and then use the utility dssmtpmail.exe to send mail ( check for setting with SMTP server).
this script will telnet the remote server check for the size of file and then use the utility dssmtpmail.exe to send mail ( check for setting with SMTP server).
Check out the DSGetLinkInfo function for a way a routine can check the number of records down a link from another job, say from one that does the notification when it exceeds your threshold.deb033 wrote:Instead of the size, if anyone suggests about scenario where no. of rows in the file increases abruptly over some specified number, that could be also helpful.
Last edited by chulett on Mon Feb 09, 2009 4:17 pm, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 34
- Joined: Fri May 16, 2008 6:24 am
Write a DS routine, in which find the size of the file by executing a Unix command and do a check to find if it is more than 5 MB and send a mail notification.
Call this after your sequential file creation job .
(I think, if there is no intermediary storage on your server, you may have to write a small Unix script and call it in the routine)
Call this after your sequential file creation job .
(I think, if there is no intermediary storage on your server, you may have to write a small Unix script and call it in the routine)
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The STATUS statement, documented in the Server Job Developer's Guide, returns a dynamic array relating to the file open on its file variable. One of the elements of this dynamic array is the file size in bytes.
So all you need to do is read the manual, and you'll have it all.
Note that the STATUS statement is not the same thing as the STATUS() function.
So all you need to do is read the manual, and you'll have it all.
Note that the STATUS statement is not the same thing as the STATUS() function.
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.
-
- Premium Member
- Posts: 34
- Joined: Fri May 16, 2008 6:24 am
Status returns the file status of an open file and assigns it to a dynamic array. field-6 of the dynamic array will give you the file size.deb033 wrote:
Ray, can you please describe the way you told in a bit elaborately such that it will be easier for implementation? Thanks.
Following snipped may help you to understand this better.
Code: Select all
STATUS darray FROM <file_variable> THEN PRINT darray
field6 = darray<6,1,1>
PRINT "FILE SIZE = ": field6