IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

why PIC X(10) for date in DB2


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sajjan jindal
Warnings : 1

New User


Joined: 09 Sep 2007
Posts: 60
Location: india

PostPosted: Mon Aug 03, 2009 8:08 pm
Reply with quote

33) What is the physical storage length of each of the following DB2 data types:
DATE, TIME, TIMESTAMP?
DATE: 4bytes
TIME: 3bytes
TIMESTAMP: 10bytes
34) What is the COBOL picture clause of the following DB2 data types:
DATE, TIME, TIMESTAMP?
DATE: PIC X(10)
TIME : PIC X(08)
TIMESTAMP: PIC X(26)

Date contains : YYYYMMDD, why does it require X(10) ?

same question for TIME and TIMESTAMP?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Aug 03, 2009 8:09 pm
Reply with quote

The idea behind the Interview Questions forum is that you tell us the answers that you think are correct, and other forum members will tell you if you are correct or not, or maybe offer a better answer.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Aug 03, 2009 8:41 pm
Reply with quote

DATE, TIME, TIMESTAMP?
DATE: PIC X(10)
TIME : PIC X(08)
TIMESTAMP: PIC X(26)

Date contains : YYYYMMDD, why does it require X(10) ?

same question for TIME and TIMESTAMP?

The format of the character string returned for a date, time, or timestamp depends on the setup of DB2 for your system, and would include some punctuation. For a date it could be yyyy-mm-dd or mm/dd/yyyy or dd.mm.yyyy or some other format.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top