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
Upper Case conversion
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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:
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Upper Case Conversion
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
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
ETL Developer
+6427 291 0525
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
Regards,
Michael Hester
Mike Hester
mhester@petra-ps.com
mhester@petra-ps.com