Hi DS Gurus,
im getting the source data from the sybase as
ODVAdsti_20060913.csv
TRANSdsti_Trn_20060913.csv like that...
now i want the output like
ODVAdsti
TRANSdsti_Trn
i dont want _20060913.csv
i have to implement the logic in Transformation
i tried Field function n substring functions,but not succeed...
So please help me Gurus
Thanks in advance
Umapathy reddy
Substring Problem
Moderators: chulett, rschirm, roy
-
- Charter Member
- Posts: 6
- Joined: Thu Mar 27, 2003 1:55 pm
- Contact:
I can think of a couple of ways to accomplish your string extraction:
1) If you know that your data will always have the "_20060913.csv" at the end, you can simply do a the following in your derivation:
link.columnname[1,Len(link.columnname)-13]
This approach will always work no matter which format of the data you're receiving. It can also be easily incorporated into a Datastage transform so that it can be used over and over again.
2) You can also use a couple of stage variables as follows:
Variable Name=Derivation
-----------------------------------------------------------
DelCount=Count(link.columnname,"_")
WantedData=Oconv(link.columnname,"G0_":DelCount)
If you need to use this logic in several jobs it can easily be put into a Datastage routine.
Hope this helps!
Mark
1) If you know that your data will always have the "_20060913.csv" at the end, you can simply do a the following in your derivation:
link.columnname[1,Len(link.columnname)-13]
This approach will always work no matter which format of the data you're receiving. It can also be easily incorporated into a Datastage transform so that it can be used over and over again.
2) You can also use a couple of stage variables as follows:
Variable Name=Derivation
-----------------------------------------------------------
DelCount=Count(link.columnname,"_")
WantedData=Oconv(link.columnname,"G0_":DelCount)
If you need to use this logic in several jobs it can easily be put into a Datastage routine.
Hope this helps!
Mark
Mark Ott
DataStage Architect
Adept Technologies, Inc.
DataStage Architect
Adept Technologies, Inc.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: