julian date conversion into 'ccyy-mm-dd'

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Ascential DS/390 relies fully on the date format for its mapping. So if the format says '9999999', then it cannot deduce the format to be 'CCYYDDD'.

The suggestion (as Mike mentioned) is to remove the 3 lines holding the CC, YY and DDD fields first and then change the group to 'non-group' element by providing it the format of Character (8) and assign the format 'CCYYDDD'.

This is simple to implement but you must be careful to ensure that the fields you delete and not used elsewhere in your program.

So another suggestion is to include a new field that REDEFINES this date group field (level 20) and you can assign the format and datatype to this new field.
srikie
Participant
Posts: 58
Joined: Thu Oct 14, 2004 4:19 pm

Post by srikie »

I got that part. But this was another question, can we use 99999999 as 9's complement form of date format?
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

srikie,

I doubt that the 99999999 format represents a 9s complement. I think it just means that there are 8 numeric digits with no specific CC, YY, MM or DD meaning. About the only useful thing I can think of for that format would be to have DataStage insert separator characters.

Mike
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

If the input COBOL file defn says PIC 9(7) or PIC 9999999, then it represents Number(7) and not 9s complement.

As mentioned before, unless you give the 'date format' to be CCYYDDD, you will need to write your own method / logic to derive the result.
Post Reply