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
 

 

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: 135
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: 1529
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: 2502
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: 2502
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: 2502
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 Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm
This topic is locked: you cannot edit posts or make replies. output data in CSV Format janmejay DFSORT/ICETOOL 3 Sat Oct 15, 2016 2:16 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm


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