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

A question on storage of date, time and timestamp.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Mon Jan 18, 2010 1:38 pm
Reply with quote

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)

33) What is the physical storage length of each of the following DB2 data types:
DATE, TIME, TIMESTAMP?
DATE: 4bytes
TIME: 3bytes
TIMESTAMP: 10bytes

Can anyone pls explain me how the allocation for DATE,TIME and Time stamp is 4,3 and 10 bytes respectively.


Thanks,
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jan 18, 2010 2:11 pm
Reply with quote

Quote:
physical storage length


refers to the space required in the db2 table as it is maintained on DASD.

the cobol pic clauses refer to 'application (in this case cobol program) storage useage'
or
how the data is presented to an application via (e.g.) sql select
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Jan 18, 2010 2:20 pm
Reply with quote

the fastest way to get a mapping of the DB2 data types to the various languages is to define a table and run a dclgen for it .
it will generate data structures with the correct definition; fast, effective, the definitions will be ERROR FREE
in case of issues with the generated definition You could always open a PMR with IBM
Back to top
View user's profile Send private message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Mon Jan 18, 2010 2:50 pm
Reply with quote

Thank you.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts To get the the current time DFSORT/ICETOOL 13
Search our Forums:

Back to Top