Ü IN (Read a Data Area)

·         This opcode is used to retrieve the value from the dataarea.

Factor 1

Op-code

Factor 2

Result Field

Resulting Indicators

       HI                            LO                      EQ

*LOCK

IN(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:   USALID09
 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:





Copyright © Go4as400.com, 2013-2017. Copyright notice