MF syntaxing for aliasing

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
BigFoot
Participant
Posts: 5
Joined: Mon Jan 08, 2007 2:55 am
Location: Bangalore

MF syntaxing for aliasing

Post by BigFoot »

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
Vinay
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

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.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
BigFoot
Participant
Posts: 5
Joined: Mon Jan 08, 2007 2:55 am
Location: Bangalore

Post by BigFoot »

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
Vinay
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

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.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
BigFoot
Participant
Posts: 5
Joined: Mon Jan 08, 2007 2:55 am
Location: Bangalore

Post by BigFoot »

Have you tried just SELECT SCHEMA.TABLE1.FIELD1 ABC.....
i also tried that...but :(
if you specify a valid alias in the SQL, that will be passed to DB2/390 and honoured.
please specify the syntax for aliasing... :idea:

Thanks
Vinay
Yuan_Edward
Participant
Posts: 73
Joined: Tue May 10, 2005 6:21 pm
Location: Sydney

Post by Yuan_Edward »

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.
BigFoot wrote:
Have you tried just SELECT SCHEMA.TABLE1.FIELD1 ABC.....
i also tried that...but :(
if you specify a valid alias in the SQL, that will be passed to DB2/390 and honoured.
please specify the syntax for aliasing... :idea:

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

Post by ray.wurlod »

Alas, there's no ODBC stage in mainframe jobs.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

ray.wurlod wrote:Alas, there's no ODBC stage in mainframe jobs.
Its a px job. The mainframe tables are visible to his px job.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
Yuan_Edward
Participant
Posts: 73
Joined: Tue May 10, 2005 6:21 pm
Location: Sydney

Post by Yuan_Edward »

I have never used MF stages, but the author said he tried to use ODBC stage...

Would be insterested in learning something about MF stages
BigFoot wrote:the tables are in the source...

I also tried the same thing in MF(ODBC stage) but it didn't work.

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

Post by ray.wurlod »

First, you need to buy DataStage Enterprise MVS Edition licence.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
BigFoot
Participant
Posts: 5
Joined: Mon Jan 08, 2007 2:55 am
Location: Bangalore

Post by BigFoot »

Hi All,

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
Post Reply