cancel
Showing results for 
Search instead for 
Did you mean: 

OS command required

Former Member
0 Kudos

Hello All,

I have a requirement where the target output file name needs to be populated as below in my Receiver SFTP channel.

Channel is creating as : CTACT_CG_.<YYYYMMDD-HHMMSS>.TXT

Client expecting as      : CT_CG.TXT.<YYYYMMDD-HHMMSS>

I want to achieve this by executing a OS command in the channel.

Can anyone help me in building a OS command instead of going for Shell script

Regards,

Moorthy

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Answers (1)

Answers (1)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Naresh,

                 If your scenario has mapping in it please use ASMA within UDF as shown below

public String putFileName(String Number,Container container){      

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("'http://advantco.com/xi/XI/SFTP","FileName");

String s="CT_CG.TXT"+""+java.text.SimpleDateFormat("<yyyyMMdd-HHmmss>").format(new java.util.Date());

conf.put(key, s);

return " ";

}    

Map this UDF to root element  or any dummy field in target XML.

In Receiver CC you need to set these

1. Receiver Comm Channel has ASMA , file name and "fail if ASMA missing" ticked.

2. in receiver communication channel -> File access parameters-> File name scheme -


> put any value say "*". This step is not compulsory.

3. In target directory of receiver CC put the name of the directory where you need the file to be formed.

Regards

Anupam