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
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm
No new posts Converting EBCDIC to Unicode (TimeStamp) muralikrishnan_new COBOL Programming 2 Mon Jul 25, 2016 10:42 pm


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