on 06-06-2016 12:47 PM
Hi,
Can anyone help me in writing a script in BODS.
Requirement is like:
Please help me as I am new to BODS.
Regards,
Anurag.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The job has not run successfully, there is an error, written to your trace file: "the system cannot find the path specified".
That's due to the backslashes used in the folder path. The backslash is used as an escape character in DS scripting. Try to print('\\frgows55\BODS_Target\NAFTA\script_bods.bat') and see what happens.
Use exec('cmd','\\\\frgows55\BODS_Target\NAFTA\script_bods.bat',8);
Dirik... you beauty!!
Thanks a lot man..!
Finally I can sleep peacefully tonight!
Thanks a lot everyone for your guidance.
Arun Thanks to you too! For your examples and speedy reply.
Many thanks everyone. Cheers!
Regards,
Anurag.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI All,
I've written a script which actually met my scenario. (Downloading files from FTP)
Now can any one tell me how to call that bat file in BODS script?
suppose the .bat file name is script.
how do I call that .bat file in BODS script?
Thanks in advance!
Regards,
Anurag.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My file is in FTP (Filezilla) which needs to be copied to my job server (frgows55). Now somebody please tell me how to write a script. And please explain.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naha anurag,
We have new functions added in BODS 4.2
1. file_copy
2. file_move
you can move files using any of the above functions.
or you can also use the above logic posted by madhusudhan.
please refer the below link for more information on file_copy and file_move functions.
http://help.sap.com/businessobject/product_guides/sbods42/en/ds_42_reference_en.pdf
Thanks,
Ravi Kiran.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure, check out section 2.3.12 File location object in the SAP Data Services Reference Guide (url as given before). The function you need is actually called copy_from_remote_system:
copy_from_remote_system(“flo_ftp_1”, “prod.txt”)
This function uses the FTP information in the file location object flo_ftp_1 to copy the file named prod.txt that is located in a remote directory.
Here's a sample script which I had written..
@echo off
set USER=user_name
set "PASSWORD=password"
set LOCAL_DIR=D:\Data\Proj\Source
set FILE_NAME=filename.txt
set dt=%date:~7,2%-%date:~4,2%-%date:~10,4%_%time:~0,2%_%time:~3,2%_%time:~6,2%
del D:\Data\Proj\ftpcommand.txt
echo USER %USER%>>D:\Data\Proj\ftpcommand.txt
echo %PASSWORD%>>D:\Data\Proj\ftpcommand.txt
echo lcd D:\Data\Proj\Source>>D:\Data\Proj\ftpcommand.txt
echo CD /FTP_Folder>>D:\Data\Proj\ftpcommand.txt
echo ascii>>D:\Data\Proj\ftpcommand.txt
echo MGET filename.txt>>D:\Data\Proj\ftpcommand.txt
echo disconnect>>D:\Data\Delfi\ftpcommand.txt
echo bye>>D:\Data\Proj\ftpcommand.txt
ftp -n -i -s:D:\Data\Proj\ftpcommand.txt FTP_SERVER_IP
/* Copy File from Source folder to Backup Folder on Job Server */
copy D:\Data\Proj\Source\filename.txt D:\Data\Proj\Backup\filename.txt_%dt%.txt
Dont do a copy paste Use your own logic as per the requirement
Regards
Arun Sasi
Hi Naga,
See the code below,
print ('*** Moving file to [$G_FILE_DIRECTORY]archive\\');
$G_NextJobCmd = 'move "' || $G_FILE_DIRECTORY || $G_FILE_NAME || '" "' || $G_File_Directory2 || 'archive\\' ;
exec( 'cmd', $G_NextJobCmd, 0 );
$G_FILE_DIRECTORY : Variable with the source path
$G_FILE_NAME : Variable with file name.
$G_File_Directory2 : Varaible with target directory.
Thanks,
Madhusudhan K.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.