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
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm
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


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