how to convert A-Z to C character and 0-9 to N character

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
rsmohankumar253
Participant
Posts: 1
Joined: Sun Mar 26, 2017 9:57 am

how to convert A-Z to C character and 0-9 to N character

Post by rsmohankumar253 »

Hi,

I want the logic to convert the alphabets a-z to the character 'C', numbers 0-1 to character 'N' and special characters to 'S' character to find the data type distribution. can you please let me know how can we convert the character in IBM datastage 9.1.

Example

value: Hello World 2017 !!!

converted value: CCCCC CCCCC NNNN SSS
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use Information Analyzer, which does all this out of the box.

Otherwise use a long Convert() function (with 52 'C' and ten 'N' characters) in DataStage (in Transformer stage).

Code: Select all

Convert('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghiklmnopqrstuvwxyz0123456789', 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCNNNNNNNNNN', InLink.TheString)
(Technically you don't have to convert the first "C" character. But I believe that the intent is clearer if you do.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply