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
 
Valid timestamp format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 149
Location: Coimbatore

PostPosted: Thu May 30, 2013 9:34 pm    Post subject: Valid timestamp format
Reply with quote

Hi,

I would need a help on to identify if a field contains a valid timestamp format or not.

I do have a requirement where I get a timestamp value in a variable and I need to check if its in the correct format or not.

The actual timestamp format is fo 26 bytes: yyyy-MM-dd-HH.mm.ss.ffffff

Should I check if there is a '-' on 5th,8th,11th position and '.' in 14th,17th,20th position ?. Will it be the correct way to check it ??

Please advice.

Thanks
Abdul Rafi
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: Thu May 30, 2013 9:42 pm    Post subject:
Reply with quote

Hello,

To be accurate/complete, you must test every part of the entire field. Merely checking the "-" and "." delimiters provides little value. . .

What about a month, day, hour, minute, second that are numeric, but invalid?

Same with year, and leap year.
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Thu May 30, 2013 9:46 pm    Post subject:
Reply with quote

wherre are you getting this timestamp from DB2..????
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1542
Location: Andromeda Galaxy

PostPosted: Thu May 30, 2013 9:59 pm    Post subject:
Reply with quote

Try to do a SET or SELECT FROM SYSDUMMY1 using the value you have

So you dont need to bother about source information
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: Thu May 30, 2013 10:02 pm    Post subject:
Reply with quote

Yup, that will be ok if the code already uses DB2 . . .

d
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Thu May 30, 2013 11:07 pm    Post subject: Reply to: Valid timestamp format
Reply with quote

The following previous post, shows the use of the Assembler TIME macro, returning a date-format of C'CCYYMMDD' and a time-format of C'HHMMSSTHMIJU', with "U" representing microseconds. If you don't have DB2, then this should suffice -

http://ibmmainframes.com/viewtopic.php?p=310291&highlight=#310291
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: Thu May 30, 2013 11:29 pm    Post subject:
Reply with quote

Hi Bill,

I believe the TS wants to validate a timestamp that has arrived in the code . . . icon_cool.gif
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Thu May 30, 2013 11:56 pm    Post subject: Reply to: Valid timestamp format
Reply with quote

Dick,

Sorry, blew right through that post's aspect icon_rolleyes.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: Fri May 31, 2013 1:04 am    Post subject:
Reply with quote

Negative perspiration icon_smile.gif

Do that myself with some regularity icon_redface.gif

d
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Fri May 31, 2013 2:37 am    Post subject: Reply to: Valid timestamp format
Reply with quote

You can verify the format as well as the contents by calling LE Callable Service routine "CEESECS".

http://pic.dhe.ibm.com/infocenter/ratdevz/v7r5/index.jsp?topic=%2Fcom.ibm.etools.cbl.win.doc%2Ftopics%2Frpsrv36.htm

A value returned by "CEESECS", in the first two-bytes of the 12-byte "Feedback Code" parameter, which is not X'00's should be considered an error.

HTH....
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Format Last Record differently from r... Learncoholic DFSORT/ICETOOL 5 Tue Oct 24, 2017 12:01 pm
No new posts Format issues using XMITIP MSGDD ssdjp1 CLIST & REXX 5 Mon Oct 23, 2017 8:47 pm
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

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