Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Covert of comp-3 value into equivalent date value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Covert of comp-3 value into equivalent date value
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: 2150
Location: At my coffee table

PostPosted: Thu Apr 03, 2008 7:01 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Apr 04, 2008 9:18 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Apr 07, 2008 8:49 am    Post subject:
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

Site Director


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

PostPosted: Mon Apr 07, 2008 8:56 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Mon Apr 07, 2008 8:32 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Mon Apr 07, 2008 9:27 pm    Post subject: Reply to: Covert of comp-3 value into equivalent date value
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us