d $data uds dtaara(@MYDATA)
d $value 50a
/free
dsply $value; // Display data area value
In $data; // Data Area is locked
dsply $value; // Display data area value
Out $data; // Update and unlock the data area
In $data; // Reads but doesn't locks the data area
dsply $value; // Display data area value
Unlock $data; // Unlock the data area no affect
In *lock $data; // Reads and Locks the data area
dsply $value; // Display data area value
Unlock $data; // Unlock the data area
*inlr = *on;
return;
/end-free
Its better to not define the UDS and lock the data area when needed and unlock after update or when unlock is specified. Solves a lot of issues with Message Id: RNQ0412 - Data area *LIBL/{your_data_area) is not allocated for output. Here is an example code.
d $data ds dtaara(@MYDATA)
d $value 50a
/free
In $data; // Just Read, don't lock it
dsply $value; // Display data area value
In *lock $data; // Reads and Locks the data area
dsply $value; // Display data area value
Out $data; // Update and unlock the data area
In *lock $data; // Reads and Locks the data area
dsply $value; // Display data area value
Unlock $data; // Unlock the data area
*inlr = *on;
return;
/end-free
No comments:
Post a Comment
NO JUNK, Please try to keep this clean and related to the topic at hand.
Comments are for users to ask questions, collaborate or improve on existing.