Ü  OUT (Write a Data Area)

·         It updates the dataarea specified in factor-2.

·         Here if we want the dataarea to be in locked mode even after doing the update by OUT operation, we can use *LOCK in factor-1. If we don’t then the dataarea will get unlocked after updating.

Factor 1

Op-code

Factor 2

Result Field

Resulting Indicators

       HI                            LO                      EQ

*LOCK

OUT (E)

Data area name

 

 

Error

 

 

Example


Columns . . . :    6  76            Edit                           AMINEM/PRJ1
SEU==>                                                                  GENACC
FMT C  CL0N01Factor1+++++++Opcode&ExtFactor2+++++++Result++++++++Len++D+HiLoEq
*************** Beginning of data *************************************
0004.00 C     *DTAARA       DEFINE                  DA               12
0005.00 C     *ENTRY        PLIST
0006.00 C                   PARM                    A1               12
0007.00 C     *LOCK         IN        DA
0008.00 C                   MOVEL     DA            C                12
0009.00 C                   MOVEL     *ZEROS        I                12 0
0010.00 C                   EVAL      I=%INT(C)
0011.00 C                   ADD       1             I
0012.00 C                   EVAL      C=%CHAR(I)
0013.00 C                   MOVEL     C             DA
0015.00 C                   MOVEL     C             A1
0016.00 C                   OUT       DA
0017.00 C                   UNLOCK    DA
0019.00 C                   SETON                                        LR
0020.00 C                   return
****************** End of data ****************************************

 

Below is the dataarea used in the program “DA”:

 

                               Display Data Area                               
                                                             System:   SYSTEM09
 Data area . . . . . . . :   DA                                              
   Library . . . . . . . :     QGPL                                            
 Type  . . . . . . . . . :   *CHAR                                              
 Length  . . . . . . . . :   30                                                
 Text  . . . . . . . . . :                                                     
                                                                               
            Value                                                              
 Offset      *...+....1....+....2....+....3....+....4....+....5                
     0      '100000000001'                                   
 
 
                                                                               
                                                                               
 F3=Exit   F12=Cancel  


 

OUTPUT

On each call of this program, auto-generation of number will happen.

The generated number will be updated to the dataarea.

 











User Comments:



Subscribe

.  


Copyright © www.go4as400.com, 2013-2023. Copyright notice   Terms of services   Privacy policy