English German Spanish
Support|Education|Careers|Contact Us

How to handle embedded spaces within the ODEXCC.PRM file

Article ID: 1456
Date Created: 23/02/2010 14:23:55
Date Modified: 23/02/2010 14:38:04
Applies To: All versions of ODEX Plus (UNIX)
More Information:
An example would be the OCODE field, if the SSID code contains a space, then the first part would be interpreted as the SSID and the remainder will be seen as comments.  This can be avoided by using quotes around SSID:

OCODE            'MY SSID'               Your EDI code used in SSID

When using the various automatic file processing options in ODEXCC.PRM, the program and argument fields need to be enclosed in quotes if they contain spaces

FILERCVDPROG     '/usr1/uktest/test.bat'
FILERCVDARGS     'File_received %SSIDORGCODE% '

Further problems may occur if a placeholder eg %SSIDORGCODE% (refering to the originator's SSID code) contains an embedded space character.  In this example, it would appear to the batch script as two separate arguments instead of one.

This can be avoided by encasing the placeholder in double quotes (the double quote character, not two single quotes next to each other).  This will ensure that it is treated as a single argument, whilst still resolving to the correct value.

FILERCVDPROG     '/usr1/uktest/test.bat'
FILERCVDARGS     'File_received "%SSIDORGCODE%" '

Generally in UNIX scripting, using single quotes will treat a string as a literal, whereas double quotes allow a string to be resolved (if it is a variable).  Both allow a string with embedded spaces to be treated as a single argument.

Eg:

echo ' $CCPATH '

Outputs the literal string: $CCPATH

echo " $CCPATH "

Outputs whatever this environment variable resolves to (the installation directory for ODEX)

Keywords: ODEXCC.PRM



Rate this article

12345

Current rating: 0
1 star = Poor, 5 stars = Perfect)

Feedback

Did this information solve your problem?
 
What can we do to improve this information?
 
Please provide an email address so that we can obtain
further information if necessary (optional):




User Logon
Username/Password:
CONTACT US

UK: +44 (0) 1733 371 311
ES: +34 91 268 66 29
SE: +46 (0) 322 935 25
DE: +49 (0) 40 31112 374


sales@di-international.com
Terms and Conditions | Copyright Data Interchange Plc 2012