Equivalent to LETTERS in DataStage 7.5.2 Parallel Edition

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Sampath
Participant
Posts: 21
Joined: Tue Apr 05, 2005 2:03 am

Equivalent to LETTERS in DataStage 7.5.2 Parallel Edition

Post 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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post 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;
}
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Moderator: please move to parallel forum
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Most UNIX boxes have the strings command. You can just use this.
Mamu Kim
Post Reply