SAP Knowledge Base Article - Preview

2768032 - CPIDS exec() function calling .bat throwing syntax error in REN function - SAP Cloud Platform Integration for data services

Symptom

  • Using EXEC() function in postload script to execute a .bat file which contains to move the file from one location to another and rename the file with date stamp.
  • Exec syntax: exec($G_BATCHFILE, ' ', 8);
  • Viewing the logs when after executing the task you see access denied and syntax error.
    • 2019-03-13 05:14:17 (2212:4480) DATAFLOW:Process to execute data flow <Task_MTP_MD_Location_FF_DF_Location_Master_FF> is completed.
    • 2019-03-13 05:14:18 (1524:8052) PRINTFN:1: Access is denied. 0 file(s) copied. The syntax of the command is incorrect.
  • Script uses substrings of %time% and appends to a file name using REN
    • @ECHO OFF
    • rem get the current date in format YYYYMMDD
    • set mydate=%date:~10,4%%date:~4,2%%date:~7,2%
    • rem get the current time in format hhmmss where hh is in 24-hour time
    • set mytime=%time:~0,2%%time:~3,2%%time:~6,2%
    • COPY <full path to original data file> <folder where the file is to be moved>
    • REN <full path to data file including name & extension> <file name>_%mydate%_%mytime%.csv


Read more...

Environment

SAP Cloud Platform Integration for data services

Product

SAP Cloud Integration for data services all versions

Keywords

KBA , LOD-HCI-DS , HANA Cloud Integration for Data Services , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.