on 05-16-2019 12:09 PM
Hi Friends,
I would like to know how to generate a .txt in the specific name like " s2_231_timestamp.txt in bods using scripts (in Windows, Linux environment).
Thank you.
Hello mr.X x
You can create a variable like below:
$File_Name = 's2_231_' || to_date(sysdate(),'YYYYMMDDHH24MISS') || '.txt'
Assuming s2_231 is default and file is generated after successful execution of Batch job and timestamp part will be changing every execution.You can define the format however you wanted.
This must be kept in script level.
Likewise you can have dynamic variable for '.csv' also.
Regards,
Iswarya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello meer.9700
Depending on the environment of the job server you can utilize command line tools provided by the operating system.
You can read more on the exec() function in the Reference guide. There is also a sub chapter based on remote shell executions.
Below are two simple examples of creating a text file of the same name in the default 'workspace' folder. You can use these a template:
• in Linux environment exec('touch','/sap/SAP/dataservices/workspace/s2_231_timestamp.txt',0);
• in Windows exec('cmd', 'cd C:\PROGRA~3\SAPBUS~1\DATASE~1\WORKSP~1 && copy NUL >s2_231_timestamp.txt');
regards
Bon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.