Getting Month Name from Column Name

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
anudeepdasari001
Participant
Posts: 58
Joined: Mon Dec 14, 2015 3:16 pm
Location: Arizona

Getting Month Name from Column Name

Post by anudeepdasari001 »

I have a scenario where I have columns Like REV_ACT_JAN ........ REV_ACT_DEC, I am doing a pivot to store all the columns in one field i.e Amount, And also i have another filed MONTH which should be identified from the Column Name(ex:REV_ACT_JAN then the MONTH field should have 01 and so on)
Could someone help me out in building this logic
anudpETL
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Is your source a file with the first record containing the column names or is it something else?
-craig

"You can never have too many knives" -- Logan Nine Fingers
anudeepdasari001
Participant
Posts: 58
Joined: Mon Dec 14, 2015 3:16 pm
Location: Arizona

Post by anudeepdasari001 »

The source is Oracle DB not the file
anudpETL
R.K.Glover
Participant
Posts: 8
Joined: Mon Mar 11, 2013 2:51 pm
Location: RTP, North Carolina

Post by R.K.Glover »

Can you write an SQL statement that selects the system tables, and returns the column names of the table in question?

Or... a substring of the column names in question?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Solutions that try to access the metadata at run time are, in general, not supported.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply