We get some .dat files from SAP Application Server. Sometimes they will be empty and when we try to use the empty files to load the DW tables we are getting some warnings stating the file is empty. We are aware of function get_file_attribute(), I think this holds good for files on JobServer. But how to use this function to check the file on remote application server.
Thanks for prompt reply.
Yeah, that we do while populating the tables. But I need to use this feature for validation purpose or catch the exceptions/warnings for empty files.
I think Data_Guy means using the SIZE command to get the remote file size. It might work, depending on the FTP server.
Syntax: size(filename)
Request the size of the file named filename on the server. On success, the size of the file is returned as an integer, otherwise None is returned. Note that the āSIZEā command is not standardized, but is supported by many common server implementations.
if the $gv_file_size is 0 then do whatever you are supposed to do.
p.s. the file should be at the same computer with job server
p.s. if you want to do it on the remote server then you should write a simple script that creates a text file which holds the file names and size of the files and check this text file at the very beginning of the load. If you can give more detailed information about your system (unix & NT), i can provide the script.
I would suggest you take a little time to figure out how to perform simple string manipulations, so youāre not guessing.
Play around with concatenating global variables, and also substitution variables. When concatenating I much prefer using ā[$GLOBAL_VAR]\TextFile.csvā ⦠to using concatenation symbols. ⦠$GLOBAL_VAR || ā\ā || āTextFile.csvā
I will always separate a preceding slash included in a the middle of a concatenation into its own string. A single backslash is an escape character, so you can get some weird results if you use ā\neverDoThisā. It may or may not work, but it is bad form.