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

[Solved]How to declare TImestamp in cobol program


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

New User


Joined: 04 May 2005
Posts: 8

PostPosted: Thu Jun 09, 2005 5:09 pm
Reply with quote

HI,
How to declare TImestamp in cobol program
whether we will declare in group variable or individual variable?

thanks in advanse
Back to top
View user's profile Send private message
Deepa.m

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Thu Jun 09, 2005 6:03 pm
Reply with quote

IT IS 26 BYTE LENGTH .first for setting it should be individual variable
01 WS-DB2-CURRENT-TS PIC X(26) VALUE SPACES.

EXEC SQL
SET :WS-DB2-CURRENT-TS = CURRENT_TIMESTAMP
END-EXEC

FURTHER you can move it to group variable

01 5 WS-CURRENT-TIMESTAMP.
10 WS-CURR-TS-CCYY PIC X(04) VALUE SPACE.
10 FILLER PIC X(01) VALUE '-'.
10 WS-CURR-TS-MM PIC X(02) VALUE SPACE.
10 FILLER PIC X(01) VALUE '-'.
10 WS-CURR-TS-DD PIC X(02) VALUE SPACE.
10 FILLER PIC X(01) VALUE '-'.
10 WS-CURR-TS-HH PIC X(02) VALUE SPACE.
10 FILLER PIC X(01) VALUE '.'.
10 WS-CURR-TS-MINS PIC X(02) VALUE SPACE.
10 FILLER PIC X(01) VALUE '.'.
10 WS-CURR-TS-SS PIC X(02) VALUE SPACE.
10 FILLER PIC X(01) VALUE '.'.
10 WS-CURR-TS-MILLISECS PIC X(06) VALUE SPACE. PIC X(26) VALUE SPACES.

MOVE WS-DB2-CURRENT-TS TO WS-CURRENT-TIMESTAMP.
Back to top
View user's profile Send private message
sudheer648

New User


Joined: 23 May 2005
Posts: 97
Location: Chennai

PostPosted: Thu Jun 16, 2005 12:40 pm
Reply with quote

hi smakkena,

The Work-storage varaible can be anything it can be a group/elementary.
What deepa said is absolutely correct.

Things group she was doing for display purpose.it is optional to 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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts To get the count of rows for every 1 ... DB2 3
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top