julian date conversion into 'ccyy-mm-dd'
Moderators: chulett, rschirm, roy
julian date conversion into 'ccyy-mm-dd'
Hi,
I am working on DS MVS edition. Can any one suggest me on how to convert julian date which is of 'ccyy-ddd' format to 'ccyy-mm-dd'.
As I am working on msv edition I dont have the comfort of using server routines.
Thanks
Srikie
I am working on DS MVS edition. Can any one suggest me on how to convert julian date which is of 'ccyy-ddd' format to 'ccyy-mm-dd'.
As I am working on msv edition I dont have the comfort of using server routines.
Thanks
Srikie
Here's the best option to accomplish this:
Let DataStage do its automatic date reformatting. You will need to specify a date format for the source date and a date format for the target date. There isn't a date format for CCYY-DDD, but there is one for CCYYDDD. You can reformat CCYY-DDD into CCYYDDD using substring/concatenation. Then you can simply map the CHAR(7) column with date format CCYYDDD to a CHAR(10) column with date format CCYY-MM-DD and DataStage will automatically convert.
Mike
Let DataStage do its automatic date reformatting. You will need to specify a date format for the source date and a date format for the target date. There isn't a date format for CCYY-DDD, but there is one for CCYYDDD. You can reformat CCYY-DDD into CCYYDDD using substring/concatenation. Then you can simply map the CHAR(7) column with date format CCYYDDD to a CHAR(10) column with date format CCYY-MM-DD and DataStage will automatically convert.
Mike
It's not specified at the job level in job properties. It's specified at the column level within a stage. For example, in a fixed-width flat file stage, go to the columns tab and right-click on your date column. Select "edit row" and this will bring up a form dialog. There is a drop-down list for selecting a date format.
Mike
Mike
My source file is vsam file. When I try to change the date format for that column bcoz its a group it doesnt give any listing the drop-down list.
But when I changed column type from group to character, it gives me the
Error: Group column cannot have data type other than GROUP.
Error: Maximum file record size must be equal to or greater than 297
Can you tell mehow to deal with this. I mean with out holding into a temporary stage variable.
But when I changed column type from group to character, it gives me the
Error: Group column cannot have data type other than GROUP.
Error: Maximum file record size must be equal to or greater than 297
Can you tell mehow to deal with this. I mean with out holding into a temporary stage variable.
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
From your words, it appears that this date value is provided in a variable which has a corresponding group level field which you are trying to fiddle with.
You cannot change a group level field without affecting the child fields.
So you first need to locate the child field which immediately follows the group and has an higher level number.
As you said, the input must be of CCYYDDD format as your source data is of that format.
In the target, goto the field defn in Designer, right click on the column and select 'Edit Row'.
This will open up a larger screen with more column metadata. You will also find a COBOL folder in it.
As part of the column properties, you will be able to see the 'Date Format' drop-down list from which you need to select the desired output format.
Note that DataStage maps values depending on the format you provide.
Once this is done, you need to generate and move the codes to mainframe for further processing.
You cannot change a group level field without affecting the child fields.
So you first need to locate the child field which immediately follows the group and has an higher level number.
As you said, the input must be of CCYYDDD format as your source data is of that format.
In the target, goto the field defn in Designer, right click on the column and select 'Edit Row'.
This will open up a larger screen with more column metadata. You will also find a COBOL folder in it.
As part of the column properties, you will be able to see the 'Date Format' drop-down list from which you need to select the desired output format.
Note that DataStage maps values depending on the format you provide.
Once this is done, you need to generate and move the codes to mainframe for further processing.
It sounds as if your date was defined something like this in your COBOL FD:
I believe you are correct in saying that you can't specify a date format for a group-level column.
I think you'll have to change your FD to eliminate the group. I think the easiest way is probably to make the change in your CFF stage directly. In my example, you would need to delete the CCYY and DDD columns, change the CCYYDDD from a group column to a CHAR(7) column, and then you should be able to select a date format.
You shouldn't get the "Group column cannot have data type other than GROUP" error when the lower level columns are deleted.
Mike
Code: Select all
05 CCYYDDD.
10 CCYY PIC X(4).
10 DDD PIC X(3).
I think you'll have to change your FD to eliminate the group. I think the easiest way is probably to make the change in your CFF stage directly. In my example, you would need to delete the CCYY and DDD columns, change the CCYYDDD from a group column to a CHAR(7) column, and then you should be able to select a date format.
You shouldn't get the "Group column cannot have data type other than GROUP" error when the lower level columns are deleted.
Mike
Hi Sainath
My source format is :
20 FM132-SER-NUM-JULIAN-DATE.
25 FM132-SER-NUM-JULDT-CCYY.
30 FM132-SER-NUM-JULDT-CC PIC X(02).
30 FM132-SER-NUM-JULDT-YY PIC X(02).
25 FM132-SER-NUM-JULDT-DDD PIC X(03).
Now when I try to change child elements date format according to ccyyddd it gives me error that date format cannot exceed the column length. When I try to set the date format for Group it doesnt give me any
option to select in the dropdown list.
I understood wher to set the date format but this case it is different.
If I am not clear please let me know I will give more info.
Thanks
srikie
My source format is :
20 FM132-SER-NUM-JULIAN-DATE.
25 FM132-SER-NUM-JULDT-CCYY.
30 FM132-SER-NUM-JULDT-CC PIC X(02).
30 FM132-SER-NUM-JULDT-YY PIC X(02).
25 FM132-SER-NUM-JULDT-DDD PIC X(03).
Now when I try to change child elements date format according to ccyyddd it gives me error that date format cannot exceed the column length. When I try to set the date format for Group it doesnt give me any
option to select in the dropdown list.
I understood wher to set the date format but this case it is different.
If I am not clear please let me know I will give more info.
Thanks
srikie
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
srikie,
You can try the suggestion by Sainath.Srinivasan,
or I think this should work as well:
Delete these four columns:
Change this column from GROUP to CHAR(7) and specify date format:
Mike
You can try the suggestion by Sainath.Srinivasan,
or I think this should work as well:
Delete these four columns:
Code: Select all
25 FM132-SER-NUM-JULDT-CCYY.
30 FM132-SER-NUM-JULDT-CC PIC X(02).
30 FM132-SER-NUM-JULDT-YY PIC X(02).
25 FM132-SER-NUM-JULDT-DDD PIC X(03).
Code: Select all
20 FM132-SER-NUM-JULIAN-DATE.
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom