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
 

 

[Solved]How to declare TImestamp in cobol program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to declare TImestamp in cobol program
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
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Thu Jun 09, 2005 6:03 pm    Post subject:
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    Post subject: Re: How to declare TImestamp in cobol program
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    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
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


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