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. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm


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