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
 

 

Move current timestamp

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
niharika19

New User


Joined: 23 Nov 2005
Posts: 3

PostPosted: Wed Jul 05, 2006 6:01 pm    Post subject: Move current timestamp
Reply with quote

ACCEPT WS-CURRENT-DATE FROM DATE
ACCEPT WS-TIME FROM TIME

Move the accepted values to a declared timestamp working storage variable. Here is the working storage declaration for timestamp,


01 WS-TIMESTAMP.
05 WS-TS-CC PIC X(2).
05 WS-TS-YY PIC X(2).
05 FILLER PIC X(1) VALUE '-'.
05 WS-TS-MM PIC X(2).
05 FILLER PIC X(1) VALUE '-'.
05 WS-TS-DD PIC X(2).
05 FILLER PIC X(1) VALUE '-'.
05 WS-TS-HH PIC X(2).
05 FILLER PIC X(1) VALUE '.'.
05 WS-TS-MIN PIC X(2).
05 FILLER PIC X(1) VALUE '.'.
05 WS-TS-SS PIC X(2).
05 FILLER PIC X(1) VALUE '.'.
05 WS-TS-NN PIC X(2).
05 FILLER PIC X(4) VALUE '0000'.

how to move the accepted values to timestamp declared variables
Back to top
View user's profile Send private message

rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Thu Jul 06, 2006 2:57 pm    Post subject:
Reply with quote

use reference modifier (i.e move).....

example:
The following example shows how to use a reference modifier to refer to a substring of a data item:
Move Customer-Record(1:20) to Orig-Customer-Name
As this example shows, in parentheses immediately following the data item you code two values separated by a colon:
Ordinal position (from the left) of the character you want the substring to start with
Length of the desired substring

Regards
jai
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 How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts Checking Current date vickey_dw DFSORT/ICETOOL 1 Wed Feb 08, 2017 11:14 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm


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