Page 1 of 1

Equivalent to LETTERS in DataStage 7.5.2 Parallel Edition

Posted: Thu Nov 19, 2009 4:23 am
by Sampath
Hi All,

We are in process of migrating the server(7.1) job to Parallel Edition i.e 7.5.2 In server i have used LETTERS to extract only Alphabetics because the column may contain special characters and numbers.When i am converting the job to 7.5.2 Parallel i am getting a problem.


I searched the forum i got convert function can do that.but for extracting numbers from string it would be helpful

Please give the solution.

Posted: Thu Nov 19, 2009 5:48 am
by ArndW
Unfortunately, no equivalent function exists in PX; there are some posts on workarounds in the forum, as you've discovered already, but none are as straightforward as the server functions they replace. W

Posted: Thu Nov 19, 2009 6:40 am
by Sainath.Srinivasan
You can write your own function...something along the lines below

Code: Select all

// Note - Not compiled or tested
# include <iostream.h>

char returnString[4001]; // Assuming max length

char *letters(char *inString)
{
   char *tempPtr = inString;
    int idx = 0;
    while (*tempPtr)
   { 
         if ((*tempPtr >= 'A' && *tempPtr <= 'Z') || (*tempPtr >= 'a' && *tempPtr <= 'z'))
             returnString[idx++] = *tempPtr;
         tempPtr++;
     }
     returnString[idx] = '\0';
     return returnString;
}

Posted: Thu Nov 19, 2009 7:18 am
by ray.wurlod
Moderator: please move to parallel forum

Posted: Thu Nov 19, 2009 11:18 am
by kduke
Most UNIX boxes have the strings command. You can just use this.