MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to get the Current Date while Unloading data ?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
srini_igsi
Beginner


Joined: 12 May 2006
Posts: 41
Topics: 16
Location: Mumbai

PostPosted: Tue Aug 01, 2006 5:05 am    Post subject: How to get the Current Date while Unloading data ? Reply with quote

Hi,

Our Client is a Health Insurance sponsorer and more than 2 million members are registered under diff health plans.

Our client is having two groups (Group A and Group B).

Group A benefit period is 1/1/2006 (start dt) - 12/31/2006 (end dt).
Group B benefit period is 2/1/2006 start dt) - 1/31/2007 (end dt).

The requirement is 'Allow reporting of prior and current benefit periods for a given member during a "transition" period (Jan - March, 90 days from the expiration of the benefit period)'.

Lets say that we have entered into the month of Feb 2007 (transition period), so in this month inorder to extract the records up to feb of 2007, the following condition is suposed to be given.

'Benefit start date <current>= current date' will extract all the records up to Feb of 2007.

We have an Unload JCL, which is supposed to extract the records satisfying the said condition. So how can I include the said condition in the control card of the JCL.
_________________
Thanks,
-Srini
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Tue Aug 01, 2006 6:44 am    Post subject: Reply with quote

srini_igsi,

Can you not hard code the current date in the query ?
Code:

Benefit_start_date = '2006-08-01'

_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Tue Aug 01, 2006 7:22 am    Post subject: Reply with quote

srini_igsi,

It is not clear as to what you are doing. you said you had problem posting the code. Try using BBCODE as explained in here

http://www.mvsforums.com/helpboards/viewtopic.php?p=19031#19031

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
srini_igsi
Beginner


Joined: 12 May 2006
Posts: 41
Topics: 16
Location: Mumbai

PostPosted: Tue Aug 01, 2006 7:23 am    Post subject: Reply with quote

The condition should be as follows.

Benefit start date <= current date
and
(Benefit end date + 90 days) >= current date

Pl let me know if there is an alternative to achieve the same.
_________________
Thanks,
-Srini
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Tue Aug 01, 2006 7:50 am    Post subject: Reply with quote

srini_igsi,

You can code the condition as in in your unload jcl. For some reason the sql gets truncated here . So I am not able to post it. Sorry

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
srini_igsi
Beginner


Joined: 12 May 2006
Posts: 41
Topics: 16
Location: Mumbai

PostPosted: Tue Aug 01, 2006 11:55 am    Post subject: Reply with quote

Kolusu,

All that I wanted to know is converting the said pseudocode into logic.

Benefit start date <= current date and
(Benefit end date + 90 days) >= current date.

I have to place this logic inside the control card of the unload JCL, which extracts
all the records satsfying the criteria..
_________________
Thanks,
-Srini
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Tue Aug 01, 2006 12:57 pm    Post subject: Reply with quote

Srini,

As I mentioned earlier you can simply code it as shown below in your control card. (assuming that benefit_start_date and benefit_end_date columns are defined as Date Columns)

Code:

SELECT *                                     
  FROM TABLE                                   
 WHERE Benefit_start_date            <= Current date
   AND (Benefit_end_date + 90 days)  >= Current date


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
srini_igsi
Beginner


Joined: 12 May 2006
Posts: 41
Topics: 16
Location: Mumbai

PostPosted: Wed Aug 02, 2006 1:27 am    Post subject: Reply with quote

Thanq very much Kolusu.

It's working perfectly.
The reason for posting this Q is, initially I thought that the function 'Current Date' may not be allowed inside the control card.
_________________
Thanks,
-Srini
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group