Timestamps

10 pts.
Tags:
D-Spec
RPG
Timestamp
I wish to: 1.) define a timestamp and initialize it to system date/time. What odes the D spec look like for this or can it not be done in the D spec? 2.)Load a data structure whihc is formatted to match timestamp defaults with data by field (CCYY MM DD...etc,). I want to then 3.) Move this data to another variable that is defined as a timestamp and do a SUBDUR using the two timestamp fields. HELP!!!!

Answer Wiki

Thanks. We'll let you know when a new response is added.

<pre>
dTimStmpSys s z inz(*sys)

dMyDS ds
d CCYY 4
d MM 2
d DD 2
d HH 2
d MI 2
d SS 2
d MS 6

dTimStmpLcl s z
dDays s 10i 0

/free
CCYY = ’2008′;
MM = ’04′;
DD = ’01′;
HH = ’10′;
MI = ’30′;
SS = ’00′;
MS = ’000000′;

TimStmpLcl = %timestamp(MyDS :*ISO0);

// Jump out of free as SUBDUR is fixed form only…
/end-free

c TimStmpSys subdur TimStmpLcl Days:*D
c Days dsply

c move ’1′ *inlr
c return
</pre>

Bruce

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Cwc
    Here is an alternative to using SUBDUR, since it's not supported in /Free, and you wouldn't have to jump out in order to get the desired result.
    Days = %Abs( %Diff(TimStmpSys: TimStmpLcl: *Days)  ) ;
    DSPLY Days ;
    *InLr = *On ;
    
    4,290 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following