Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Wanted to write date validation

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
mainframe_world

New User


Joined: 22 Jan 2010
Posts: 12
Location: delhi

PostPosted: Sat Feb 27, 2010 11:38 am    Post subject: Wanted to write date validation
Reply with quote

Hi,

I have a screen field that is "Eff-DATE" format (MMDDYY) on the screen and at the backend i have to store it like CCYYMMDD format.

I have to check for validation for month, date, year, century and check the leap year aslo.

Please anybody help me to write this logic.

Thanks
sharma
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: Sat Feb 27, 2010 11:46 am    Post subject:
Reply with quote

Hello,

Before you code, you need to know the "rules". . .

Most organizations either have a callable subroutine that does date validation and/or re-formatting. If your organization has such a routione, you should use it.

If there is not a routine, there will be documented rules as to how dates are to be handled. For example when to use 19 or 20 for the century.

Once you understand the date rules, suggest you post how you intend to write the code or the actual code you have written.

Someone here should be able to help - but do not expect someone to post already done code. . .
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7907
Location: Bellevue, IA

PostPosted: Sat Feb 27, 2010 5:49 pm    Post subject:
Reply with quote

Quote:
Please anybody help me to write this logic.
Most of the people who respond on this forum are paid for their professional work product, which is what you are asking for. Unless you are willing to pay for such work (and rates of 1000 U. S. dollars per day or any fraction are common), please do not ask for code.

When you have a problem and post the code you're having problems with, usually people will help get the code right. But asking up front for code is not wise since it doesn't show any work you've done, and this is a HELP forum, not a DO-YOUR-JOB-FOR-YOU forum.
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Sat Feb 27, 2010 9:15 pm    Post subject:
Reply with quote

Quote:
this is a HELP forum, not a DO-YOUR-JOB-FOR-YOU forum.


Robert, for outside continental U.S., thats a 1000 U.S. Dollars per day + EXPENSES !
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: Sat Feb 27, 2010 10:00 pm    Post subject:
Reply with quote

mainframe_world wrote:
I have to check for validation for month, date, year, century and check the leap year aslo.
Sounds like a COBOL 101 exercise.....
Month 1 to 12
Date 1 to 28,29,30,30 depending upon the month and leap year
Year 00 to 99 depending upon the posible range of 'eff dates'
Century 19 or 20 if the range of 'eff dates' is fairly current
Leap year is every 4th except some 00 years

A couple tables and a little math should provide you with validation needed.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Sat Feb 27, 2010 10:05 pm    Post subject: Reply to: Wanted to write date validation
Reply with quote

Search this site for "CEEDAYS". You'll find hits regarding its use in date validation.

Bill
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7907
Location: Bellevue, IA

PostPosted: Sat Feb 27, 2010 10:29 pm    Post subject:
Reply with quote

Good point, Earl -- a number of my consulting assignments included expenses as well and they were in the U.S.
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: Sat Feb 27, 2010 11:50 pm    Post subject:
Reply with quote

Hello,

When possible (for longer term engagements), i like having the hourly rate "loaded" to include expenses/extras (flying cross-country for a week or less is completely different). This way, when there is work for more than 40 hours a week, it is a kind of "overtime" which consultants often do not get icon_smile.gif

Being on the road, i'm usually willing to put in more time if a client wants. Well, i was. . . Since 2005 or so, i seldom bill more than 40 hrs a week. Getting slack. . . icon_rolleyes.gif
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Sun Feb 28, 2010 10:03 pm    Post subject:
Reply with quote

Quote:
Since 2005 or so, i seldom bill more than 40 hrs a week. Getting slack. . .


Dick, is that getting slack. . . , OR is it getting OLD ? icon_biggrin.gif
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: Sun Feb 28, 2010 11:31 pm    Post subject: Reply to: Wanted to write date validation
Reply with quote

Both. . . icon_wink.gif

However, getting older beats the alternative. . . .
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: Mon Mar 01, 2010 1:08 am    Post subject:
Reply with quote

Bill O'Boyle wrote:
Search this site for "CEEDAYS". You'll find hits regarding its use in date validation.
I've lost my pointer to the current LE bookshelf, any hints?

BTW, INTEGER-OF-DATE
Code:
    ___ Format _______________________________________________________________________________________
   |                                                                                                  |
   | >>__FUNCTION INTEGER-OF-DATE__(__argument-1__)________________________________________________>< |
   |                                                                                                  |
   |__________________________________________________________________________________________________|



argument-1
Must be an integer of the form YYYYMMDD, whose value is obtained from the calculation (YYYY * 10,000) + (MM * 100) + DD, where:

YYYY represents the year in the Gregorian calendar. It must be an integer greater than 1600, but not greater than 9999.

MM represents a month and must be a positive integer less than 13.

DD represents a day and must be a positive integer less than 32, provided that it is valid for the specified month and year combination.
Just what happens if the DD is not valid for the month and year combination?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon Mar 01, 2010 1:56 am    Post subject: Reply to: Wanted to write date validation
Reply with quote

Guy,

Here's the Bookshelf link for z/OS V1R11.0 Language Environment -

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/CEE2BKA0

Date Intrinsic Functions, which require passing a value and were introduced with COBOL/370 (early 90's), will crash and burn if the passed-value were invalid.

OTOH, LE Callable Date routines (IE: CEEDAYS) will return a value of other than X'00's in the first two-bytes (addressed as a binary-halfword) of the 12-Byte Feedback Code parm, if the date-parm passed were invalid.

This why CEEDAYS can be used to validate dates, without causing an abend.

Bill
Back to top
View user's profile Send private message
mainframe_world

New User


Joined: 22 Jan 2010
Posts: 12
Location: delhi

PostPosted: Wed Mar 10, 2010 1:07 am    Post subject: Re: Reply to: Wanted to write date validation
Reply with quote

Bill O'Boyle wrote:
Guy,

Here's the Bookshelf link for z/OS V1R11.0 Language Environment -

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/CEE2BKA0

Date Intrinsic Functions, which require passing a value and were introduced with COBOL/370 (early 90's), will crash and burn if the passed-value were invalid.

OTOH, LE Callable Date routines (IE: CEEDAYS) will return a value of other than X'00's in the first two-bytes (addressed as a binary-halfword) of the 12-Byte Feedback Code parm, if the date-parm passed were invalid.

This why CEEDAYS can be used to validate dates, without causing an abend.

Bill


Thanks to all
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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us