5 pts.
 To use Arithmetic operations in Cl program
Hi, i am fresher for AS400.I dont know how to retreive a sysval using arithmetic operations in cl programming and too storing in a dataarea and displaying the result through msg

Software/Hardware used:
ASKED: October 14, 2008  12:56 PM
UPDATED: August 22, 2010  11:41 PM

Answer Wiki:
Hi, Take a look at the RTVSYSVAL command to retrieve a sysval. You will need to DCL your variables before using them. You can store data in a data area using CHGDTAARA and retrieve it using RTVDTAARA. You can display the result using one of the SNDMSG, SNDPGMMSG, SNDBRKMSG or SNDUSRMSG commands. There is plenty of help available on the commands - press the help key and you can read the info. Regards, Martin Gilbert.
Last Wiki Answer Submitted:  October 14, 2008  3:02 pm  by  Gilly400   23,625 pts.
All Answer Wiki Contributors:  Gilly400   23,625 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

how to retreive a sysval using arithmetic operations in cl programming…

You don’t use “arithmetic operations” to retrieve system values. You use arithmetic operations to perform arithmetic such as addition, subtraction and multiplication.

…and too storing in a dataarea…

You store values in a data area with the CHGDTAARA command. But why would you do that? The value is already stored in the system value.

Generally there would by two likely reasons for a data area — to save the value temporarily after changing the system value or to send the data area to another system. But you can store the value in a variable if it’s temporary and sending system values to another system is better done by using RTVSYSINF and UPDSYSINF. If complete SYSINF (system information) isn’t needed, specific system values can be extracted from the SYSINF objects.

…and displaying the result through msg

What result do you want to display? Different system values require different handling for messages. Some values are simple character strings that can be directly inserted into message text. Other system values are numeric that can require programming to make them available as text. Still others are lists of values that can have different numbers of elements and different data attributes.

Also, what kind of message do you want to create? Is it a formatted message with a specific description? Is it an impromptu message that you display on an interactive screen through the device message queue? Is it a message that displays with other joblog messages?

Tom

 107,935 pts.