Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us