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

Initialize a Time stamp with Not Null declaration


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
maxsubrat

Active User


Joined: 27 Feb 2008
Posts: 110
Location: india

PostPosted: Tue Sep 18, 2012 1:06 pm
Reply with quote

Hi, I want a clarification. If I declare a Time stamp with Not Null in the DCLGEN table,
Then If I initialize that TS, what default value will get ?

EXEC SQL DECLARE EAD.EMPLOYEE TABLE

************************************************
* COBOL DECLARATION FOR TABLE WCDA.WCDAAUDT
************************************************
01 DCLEMPLOYEE.
10 CHTS PIC X(26).

INITIALIZE DCLEMPLOYEE.

what value CHTS will get ?

Is it current TS?

Thanks
max
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Sep 18, 2012 1:43 pm
Reply with quote

Why not give it a try your own?

You're not using INITIALIZE statement with REPLACING phrase and CHTS is defined as alphanumeric -- so as the definition goes, SPACE is the implied sending field for alphabetic, alphanumeric,national, alphanumeric-edited, and DBCS items.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Sep 18, 2012 1:58 pm
Reply with quote

I'd just add to what Anuj has said... "how could it possibly be a timestamp!"

If, through some sort of magic, the compiler could realise that the field could conveniently hold a timestamp (26 bytes long) and that from something in the data-name the intention of the human was for it to actually hold a timestamp - how would it know what you wanted it to be INITIALIZEd to? A timestamp format with zero values (so, midnight)? The "current" timestamp (so it would magically have to extract from DB2?)?

Please think before posting. It'll save you so some brickbats.
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts C Compile time time stamps Java & MQSeries 10
No new posts Parallelization in CICS to reduce res... CICS 4
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top