Friday, August 17, 2018

Command as source backslash issue

I tried reading source via command and came across an issue. The command tested in bash shell worked fine. In Command Task it was working fine as well. However, when put into the Source Qualifier as Command property on a session, it kept crushing.

Looking at the logs I've discovered, that the command is altered. Original command:

ll ./* | awk -F\ '{if ( NF==1 ) title=$1} else if ( NF>2 ) print title ","$NF"," strftime("%Y"), $6, $7, $8}'

Fetched from log:

ll ./* | awk -F/ '{if ( NF==1 ) title=$1} else if ( NF>2 ) print title ","$NF"," strftime("%Y"), $6, $7, $8}'

Never found any solution. Following the advice found at Informatica KB I've created a script to invoke the command indirectly.


KB entry says: This is a known issue and a CR 108604 has been submitted to be addressed in the future release of PowerCenter. Last Modified Date:8/2/2008 8:05 PMID:1947, - seems it's over 10 years old... Not sure if it's going to be fixed anytime soon. It refers PowerCenter 8.1 and still exists in 10.2

As found in this KB article, there is a custom property available:

SkipUnixToNTCmdPathConversion = yes

Setting this to "yes" stops the automatic backslash to forwardslash conversion.

Wednesday, February 7, 2018

Removing whitespaces from XML source

There are a few ways to remove whitespaces from XML source.

  • obviously, you can use LTRIM / RTRIM in an expression
  • you can apply normalize-space ( string ) XPath Query Function
However, if it's necessary to apply this across all the ports, it's possible to use a custom property on a session:
  • XMLStripWhitespace=Yes;
And the other way around:
if for some reason the whitespaces are gone but it actually is needed to preserve them, the above mentioned settings need to be reviewed. If there is no trace of a whitespace removal function anywhere, it's possible that it's been set on Integration Service as a default. In such case, for a given session, the whitespaces may be preserved by setting the custom property to the opposite value, overriding the default:
  • XMLStripWhitespace=No;