Data area RPGLE Example
H Option(*SrcStmt:*noDebugIo)
*
* Test Program for Data area
*
D
*
DTestDtara S 50 DTAARA('TESTDTARA')
*
DTestDaDs DS
DDaDate 1 10
DDaTimeS 14 39
*
DvDateDa S D
DvTimeSDa S Z
/Free
vDateDa = %Date();
vTimeSda = %Timestamp();
In *Lock TestDtara;
If TestDtara = ' ';
DaDate = %char(vDateDa);
DaTimes= %Char(vTImeSda);
TestDtara = TestDaDs;
Else;
TestDaDs = TestDtara;
If %date(DaDate) = %date();
Dsply 'Current Date';
Else;
Dsply DaDate;
EndIf;
If %TimeStamp(DaTimeS) = %TimeStamp();
Dsply 'Current Time';
Else;
Dsply DaTimeS;
EndIf;
DaTimes = %Char(%timeStamp(DaTimeS) + %hours(2));
DaDate = %Char(%date(DaDate) + %days(1));
TestDtara = TestDaDs;
EndIf;
Out TestDtara;
*Inlr = *on;
Return;
/End-Free
*
* Test Program for Data area
*
D
*
DTestDtara S 50 DTAARA('TESTDTARA')
*
DTestDaDs DS
DDaDate 1 10
DDaTimeS 14 39
*
DvDateDa S D
DvTimeSDa S Z
/Free
vDateDa = %Date();
vTimeSda = %Timestamp();
In *Lock TestDtara;
If TestDtara = ' ';
DaDate = %char(vDateDa);
DaTimes= %Char(vTImeSda);
TestDtara = TestDaDs;
Else;
TestDaDs = TestDtara;
If %date(DaDate) = %date();
Dsply 'Current Date';
Else;
Dsply DaDate;
EndIf;
If %TimeStamp(DaTimeS) = %TimeStamp();
Dsply 'Current Time';
Else;
Dsply DaTimeS;
EndIf;
DaTimes = %Char(%timeStamp(DaTimeS) + %hours(2));
DaDate = %Char(%date(DaDate) + %days(1));
TestDtara = TestDaDs;
EndIf;
Out TestDtara;
*Inlr = *on;
Return;
/End-Free
Comments
Post a Comment