Page 1 of 1

Upper Case conversion

Posted: Mon Mar 29, 2004 12:21 am
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

Posted: Mon Mar 29, 2004 12:25 am
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:]' 

Posted: Mon Mar 29, 2004 12:51 am
by dhiraj
sorry ray,

i posted it to this forum by mistake.

btw i'm using windows.


thanks
dhiraj

Upper Case Conversion

Posted: Tue Mar 30, 2004 3:05 am
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

Posted: Tue Mar 30, 2004 12:20 pm
by whardeman
Moving topic to DataStage forum

Posted: Tue Mar 30, 2004 2:48 pm
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