View previous topic :: View next topic
|
Author |
Message |
Boggarapu Prasad
New User
Joined: 03 Apr 2008 Posts: 4 Location: MALAYSIA
|
|
|
|
Hello..
Is there anyway to covert s9(5) comp-3 value of input file field into equivalent date field (dd/mm/yy) of output file using JCL. ( thru OUTREC option with SORT utility)
Regards/Prasad |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
What is the format of the s9(5) comp-3 field? yyddd? ddmmy? |
|
Back to top |
|
|
Boggarapu Prasad
New User
Joined: 03 Apr 2008 Posts: 4 Location: MALAYSIA
|
|
|
|
CICS Guy wrote: |
What is the format of the s9(5) comp-3 field? yyddd? ddmmy? |
Thank you for attending on this.
Julian date is storing in the in s9(5) comp-3 field
For example:
JD 38848.00000 is
BCE 4607 May 12 12:00:00.0 UT Saturday
Can we convert thru JCL into DD/MM/YY format. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Prasad,
The question was:
Quote: |
What is the format of the s9(5) comp-3 field? yyddd? ddmmy? |
The answer you gave is quite confusing (to me at least). I can't figure out what part of
Quote: |
JD 38848.00000 is
BCE 4607 May 12 12:00:00.0 UT Saturday |
actually answers the question.
If it's a julian date in a s9(5) comp-3 field then it must be either P'yyddd' (X'yydddC') or P'dddyy' (X'dddyyC') so which is it?
Also, are these all 20yy dates (e.g. 2001, 2002, etc), or can there be 19yy and 20yy dates (1998,1999,2000,2001, etc). What is the range of years you're dealing with? |
|
Back to top |
|
|
Boggarapu Prasad
New User
Joined: 03 Apr 2008 Posts: 4 Location: MALAYSIA
|
|
|
|
Dear Frank Ager,
Sorry!!
I am not able categorize the case with the format but I try to give as much as possible information with me
The field is declared in copy book as below
05 TRAN-DATE-LT PIC S9(05) COMP-3
When I see the vaue it is showing in file AID:
5 TRAN-DATE-LT 3/PS 38847
The output of this value is looking as "28/03/08"
This is the reason I could not give exact format of what you are asking..
-Prasad |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Might this be the number of days since Jan 1, 1900 (or some other system control date)?
What sort of code created the date value? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Curiosity got the best of me. . . Ran a little test and got this:
Quote: |
From 1/1/1900 (m/d/y)
to 3/15/2008 (m/d/y)
is:
39520 days |
So, a bit of adjustment will give the base date. . . |
|
Back to top |
|
|
Boggarapu Prasad
New User
Joined: 03 Apr 2008 Posts: 4 Location: MALAYSIA
|
|
|
|
Yes..This test conclude the date from 1st of 1900..Is it possible to show equivalent value there JCL i.e outrec fields option
Thank you! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
DFSORT does not have any built-in functions for that. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
I just got curious and ....
Code: |
39578 = date("B","20080512","S") - date("B","19000101","S")
39213 = date("B","20080512","S") - date("B","19010101","S")
38848 = date("B","20080512","S") - date("B","19020101","S")
|
so they took as the starting date jan 1st 1902 |
|
Back to top |
|
|
|