IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Covert of comp-3 value into equivalent date value


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Boggarapu Prasad

New User


Joined: 03 Apr 2008
Posts: 4
Location: MALAYSIA

PostPosted: Thu Apr 03, 2008 10:24 am
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 03, 2008 7:01 pm
Reply with quote

What is the format of the s9(5) comp-3 field? yyddd? ddmmy?
Back to top
View user's profile Send private message
Boggarapu Prasad

New User


Joined: 03 Apr 2008
Posts: 4
Location: MALAYSIA

PostPosted: Fri Apr 04, 2008 8:43 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Apr 04, 2008 9:18 pm
Reply with quote

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
View user's profile Send private message
Boggarapu Prasad

New User


Joined: 03 Apr 2008
Posts: 4
Location: MALAYSIA

PostPosted: Mon Apr 07, 2008 8:28 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Apr 07, 2008 8:49 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Apr 07, 2008 8:56 am
Reply with quote

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
View user's profile Send private message
Boggarapu Prasad

New User


Joined: 03 Apr 2008
Posts: 4
Location: MALAYSIA

PostPosted: Mon Apr 07, 2008 9:16 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Apr 07, 2008 8:32 pm
Reply with quote

DFSORT does not have any built-in functions for that.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Apr 07, 2008 9:27 pm
Reply with quote

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 icon_question.gif icon_question.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top