Below is a DataStage custom transform routine to get the size of a file. The full path of the file is passed in as a parameter called "Filename".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CMD = "ls -la " : Filename : " | awk '{print $5}'" | |
CALL DSExecute("UNIX",CMD,Output,SystemReturnCode) | |
size = Group(Output, @FM, 1) | |
Ans = If Num(size) Then size Else -1 |
If the file doesn't exist, -1 is returned.
Like the Facebook Page & join Group
https://www.facebook.com/DataStage4you
https://www.facebook.com/groups/DataStage4you
https://twitter.com/datastage4you
For WHATSAPP group , drop a msg to 91-88-00-906098
No comments :
Post a Comment