Date Conversion in MVS

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
ashwin141
Participant
Posts: 95
Joined: Wed Aug 24, 2005 2:26 am
Location: London, UK

Date Conversion in MVS

Post by ashwin141 »

Hi

Can somebody please guide me that what will be the simplest way of converting a Date from ccyy-mm-dd format to dd-mon-yy format.
For example

2006-02-12 as 12-feb-06.
It can be done in transformer, using some stage variables and if-else loop, I wish to know if there is any function or combination of functions which can make this task simple.

Thanks a lot

Regards
Ashwin
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

The easiest way is to let DataStage do it for you:

1) Define your input column as Character 10. Choose a date format of CCYY-MM-DD.
2) Define your output column as Character 9. Choose a date format of DD-MON-YY.
3) Move input column to output column. DataStage will do the conversion for you.

Mike
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Thanks Mike, I dint know that I was gonna say no other way other than substring and if then else.
Will this solution work in other jobs like server/parallel also?
Kris

Where's the "Any" key?-Homer Simpson
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

It's a mainframe job feature. Server/parallel jobs provide a much richer set of transform functionality.

Mike
ashwin141
Participant
Posts: 95
Joined: Wed Aug 24, 2005 2:26 am
Location: London, UK

Date conversion MVS

Post by ashwin141 »

Mike wrote:The easiest way is to let DataStage do it for you:

1) Define your input column as Character 10. Choose a date format of CCYY-MM-DD.
2) Define your output column as Character 9. Choose a date format of DD-MON-YY.
3) Move input column to output column. DataStage will do the conversion for you.

Mike
Hi Mike

Thanks a lot for the reply, even I thought about using this approach.
But I guess we don't have DD-MON-YY format in MVS, or is it there?

Please let me know.

Regards
Ashwin
ashwin141
Participant
Posts: 95
Joined: Wed Aug 24, 2005 2:26 am
Location: London, UK

Date Conversion in MVS

Post by ashwin141 »

Thanks

I got it. I hadn't changed the datatype to Character :oops:

Regards
Ashwin
Post Reply