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
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