MF syntaxing for aliasing
Moderators: chulett, rschirm, roy
MF syntaxing for aliasing
Hi all,
I am developing a job using Mainframe tables, where i am getting a conflict between two fields in different tables with the same name which i need as output.
so, can some one please suggest me the syntax for aliasing in MF job.
Thanks
I am developing a job using Mainframe tables, where i am getting a conflict between two fields in different tables with the same name which i need as output.
so, can some one please suggest me the syntax for aliasing in MF job.
Thanks
Vinay
Hi Vinay,
Welcome to DsXchange :D !!!!
Is it with Source are target? Its its with source and if the issue is with Datastage jobs, you can extract and change the name of the columns later in the stages. You need to explain in bit more detailed manner on you design of you job.
Welcome to DsXchange :D !!!!
Is it with Source are target? Its its with source and if the issue is with Datastage jobs, you can extract and change the name of the columns later in the stages. You need to explain in bit more detailed manner on you design of you job.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
the tables are in the source...
I am joining two tables both of which have a field with the same name (with different values of course) and that field is NOT my joining key.
but i need both fields in my output.
the problem is not in extraction but in writing the query. I have to alias the field so that DS understands the field name.
anyway I know the syntax for alias in Oracle. I dont have the knowledge of MF jobs.
Example query-
SELECT SCHEMA.TABLE1.FIELD1 AS ABC, SCHEMA.TABLE2.FIELD1 AS EFG FROM TABLE1, TABLE2.
I also tried the same thing in MF(ODBC stage) but it didn't work.
Thanks
I am joining two tables both of which have a field with the same name (with different values of course) and that field is NOT my joining key.
but i need both fields in my output.
the problem is not in extraction but in writing the query. I have to alias the field so that DS understands the field name.
anyway I know the syntax for alias in Oracle. I dont have the knowledge of MF jobs.
Example query-
SELECT SCHEMA.TABLE1.FIELD1 AS ABC, SCHEMA.TABLE2.FIELD1 AS EFG FROM TABLE1, TABLE2.
I also tried the same thing in MF(ODBC stage) but it didn't work.
Thanks
Vinay
Have you tried just SELECT SCHEMA.TABLE1.FIELD1 ABC.....
What is your job desing. If you have any transformer or modify or any other stage which aids renaming the column, you can do it before joining the columns in Join stage.
What is your job desing. If you have any transformer or modify or any other stage which aids renaming the column, you can do it before joining the columns in Join stage.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
DataStage does not provide inherently for aliases in mainframe jobs. However, if you specify a valid alias in the SQL, that will be passed to DB2/390 and honoured.
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.
-
- Participant
- Posts: 73
- Joined: Tue May 10, 2005 6:21 pm
- Location: Sydney
I didn't try but just give you a hint:
You said you are using ODBC stage, then use user-defined SQL and follow the syntax of standard SQL for column aliasing.
You said you are using ODBC stage, then use user-defined SQL and follow the syntax of standard SQL for column aliasing.
BigFoot wrote:i also tried that...butHave you tried just SELECT SCHEMA.TABLE1.FIELD1 ABC.....![]()
please specify the syntax for aliasing...if you specify a valid alias in the SQL, that will be passed to DB2/390 and honoured.![]()
Thanks
Edward Yuan
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Shouldn't the aliases be on the tables, rather than on the fields?
Code: Select all
SELECT ABC.FIELD1, EFG.FIELD1 FROM SCHEMA1.TABLE1 ABC, SCHEMA2.TABLE2 EFG WHERE ABC.FIELD1 = EFG.FIELD1
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.
-
- Participant
- Posts: 73
- Joined: Tue May 10, 2005 6:21 pm
- Location: Sydney
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Hi All,
Thanks for all of u for giving me useful suggestions...my issue is resolved...
this is the right solution...
my apologies to kumar...
Thanks for all of u for giving me useful suggestions...my issue is resolved...
Have you tried just SELECT SCHEMA.TABLE1.FIELD1 ABC..... What is your job desing. If you have any transformer or modify or any other stage which aids renaming the column, you can do it before joining ...
this is the right solution...
my apologies to kumar...
Vinay