Upper Case conversion

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
dhiraj
Participant
Posts: 68
Joined: Sat Dec 06, 2003 7:03 am

Upper Case conversion

Post by dhiraj »

Hi,

Is it possible to convert the entire input record read from a sequential file in to upper case. i am aware of the UpCase function, but if i use this i'll have to apply this funtion for each and every field. isn't there any generic way in which i can apply this to athe entire incoming record at once.

also i have some 100 odd jobs for which i have to convert all the inputs in to upper case . is there any other easier way of doing this.
mass relace or something.

thanx

dhiraj
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You should not post this in the Looking for Talent forum.

The short answer, if you're on UNIX, is to use a filter in the Sequential File stage, running the file through tr. For example:

Code: Select all

tr -s  '[:lower:]'  '[:upper:]' 
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dhiraj
Participant
Posts: 68
Joined: Sat Dec 06, 2003 7:03 am

Post by dhiraj »

sorry ray,

i posted it to this forum by mistake.

btw i'm using windows.


thanks
dhiraj
GavMagill
Participant
Posts: 14
Joined: Sun Mar 28, 2004 2:43 pm
Location: Auckland, New Zealand

Upper Case Conversion

Post by GavMagill »

As a suggestion try defining the inbound record as a single wide field in the sequential stage, UPCASE the single field then split the result through a second transform using substrings [] commands.

Just gave it a try and it works ok. Just have to be aware of quotes around any string fields and allow for these when splitting the main field.

Regards
Gavin
Gavin Magill
ETL Developer
+6427 291 0525
whardeman
Posts: 111
Joined: Mon Oct 21, 2002 11:17 am
Location: Fort Worth, Tx
Contact:

Post by whardeman »

Moving topic to DataStage forum
Walter Hardeman
Webmaster
mhester
Participant
Posts: 622
Joined: Tue Mar 04, 2003 5:26 am
Location: Phoenix, AZ
Contact:

Post by mhester »

To take Gavin's response one step further (and easier and more efficient) would be to write the record using the same delimiter. Then define the metadata correctly in another sequential stage thereby eliminating any need for substring'ing or field'ing of data in a transform.

Regards,

Michael Hester
Post Reply