Ü C  SPEC

·         C is the alphabetic code used for Calculation specifications.

 

To prompt C SPEC given the line command: IPC                                     

 

 
Prompt type . . .    C      Sequence number . . .  '''''''         
         
                                                                             
Level    N01 Factor 1         Operation         Factor 2       Result        
 __      __  __________       _________         _________      _________
                                               
            Decimal                                                          
Length     Positions     HI   LO   EQ    Comment  
 ____          __        __   __   __    _________________



The prompt elements are described below:

 

 

o   N01 (Conditioning Indicator)

     Position: 09

ü  This is condition indicator to decide if the calculation operation is to be performed or not.

 

ü  If we put N at position 9 then it means that the operation will be done only if the indicator at position 10 is off.

 

Position: 10-11

 

ü  Blank

The position can be left blank if we don’t want to put any condition for the calculation operation.


ü  01-99

Type a value from 01 to 99 to represent a general indicator.

 

ü  KA-KN or KP-KY

Type a value from KA to KN or KP to KY to represent a function key indicator.


ü  OA-OG or OV

Type a value from OA to OG or OV to represent an overflow indicator.

 

 

o   Factor 1

 

Factor1 represents the name or literal on which the actual operation is to be performed.

 


o   Op-Code ( Operation and Extender code)

 

Type an operation code to specify the operation to be performed.

For each operation there are certain op-codes defined that we can write in this section.

 

Below are the operation codes:

§  ADD {(H)} (Add)

§  ADDDUR {(E)} (Add Duration)

§  ANDxx (And)                                       

§  BEGSR (Beginning of Subroutine)

§  CABxx (Compare and Branch)

§  CALL {(E)} (Call a Program)

§  CALLB {(D | E)} (Call a Bound Procedure)

§  CALLP {(M | R | E)} (Call a Program or Procedure) 

§  CASxx (Conditionally Invoke Subroutine)

§  CAT {(P)} (Concatenate Two Character Strings)

§  CHAIN {(N | E)} (Random Retrieval from a File)

§  CHECK {(E)} (Check Characters)

§  CHECKR {(E)} (Check Reverse)

§  CLEAR (Clear)

§  CLOSE {(E)} (Close Files)

§  COMP (Compare)

§  DEFINE (Field Definition)                

§  DELETE {(E)} (Delete Record)

§  DIV {(H)} (Divide)

§  DO (Do)

§  DOU {(M | R)} (Do Until)

§  DOUxx (Do Until)

§  DOW {(M | R)} (Do While)

§  DOWxx (Do While)                         

§  DSPLY {(E)} (Display Function)

§  DUMP (Program Dump)                      

§  ELSE (Else)                              

§  ELSEIF {(M | R)} (Else/If)

§  ENDyy (End a Structured Group)

§  ENDSR (End of Subroutine)

§  EVAL {(H | M | R)} (Evaluation)

§  EVAL {(M | R)} (Evaluation Right Adjust)

§  EXCEPT (Calculation Time Output)

§  EXFMT {(E)} (Write/Then Read Format)

§  EXSR (Invoke Subroutine)

§  EXTRCT {(E)}(Extract Date/Time)

§  FEOD {(E)} (Force End of Data)

§  FOR  (For)

§  GOTO (Go To)

§  IF {(M | R)} (If)

§  IFxx (If)

§  IN {(E)} (Retrieve a Data Area)

§  ITER (Iterate)

§  KFLD (Define Parts of a Key)                       

§  KLIST (Define a Composite Key)           

§  LEAVE (Leave a Do Group)                 

§  LOOKUP (Look Up a Table or Array Element)               

§  MOVE   (Move)

§  MOVEA {(P)} (Move Array)

§  MOVEL {(P)} (Move Left)

§  MULT {(H)} (Multiply)

§  MVR (Move Remainder)

§  NEXT {(E)} (Next)

§  ON-ERROR (On-Error)

§  OPEN {(E)} (Open File for Processing)

§  ORxx (Or)                                 

§  OTHER (Otherwise Select)

§  OUT {(E)} (Write a Data Area)

§  PARM (Identify Parameters)

§  PLIST (Identify a Parameter List)

§  POST {(E)} (Post)                          

§  READ {(N | E)} (Read a Record)

§  READC {(E)} (Read Next Changed Record)

§  READE {(N | E)} (Read Equal Key)

§  READP {(N | E)} (Read Prior Record)

§  READPE {(N | E)} (Read Prior Equal)

§  RETURN {(H | M | R)} (Return to Caller)

§  SCAN {(E)} (Scan Character String)

§  SELECT (Begin a Select Group)

§  SETGT {(E)} (Set Greater Than)             

§  SETLL {(E)} (Set Lower Limit)              

§  SETOFF (Set Indicator Off)                 

§  SETON (Set Indicator On)                                                                          

§  SORTA (Sort an Array)                                    

§  SUB {(H)} (Subtract)                                     

§  SUBDUR {(E)} (Subtract Duration)                         

§  SUBST {(P | E)} (Substring)                               

§  TAG (Tag)                                                

§  TEST {(D | T | Z | E)} (Test Date/Time/Timestamp)        

§  TESTB (Test Bit)                                         

§  TESTN (Test Numeric)                                     

§  TESTZ (Test Zone)                                        

§  TIME (Time of Day)                                       

§  UNLOCK {(E)} (Unlock a Data Area or Release a Record)    

§  UPDATE (Modify Existing Record)                          

§  WHEN {(M | R)} (When)

§  WHENxx (When True Then Select)                           

§  WRITE (Create New Records)                               

§  XFOOT {(H)} (Sum the Elements of an Array) 

§  XLATE {(P | E)} (Translate)                 

§  Z-ADD {(H)} (Zero and Add)                 

§  Z-SUB {(H)} (Zero and Subtract)


*** All the listed op-codes are explained in the next chapter.

 

 

 


Operator Extender:

 

Operation extender is used along with the op-codes to customize the op-code e.g. to half adjust the decimal value, to read file without lock, to make the value padded with blank etc.

Possible values:

ü  Blank

It can be left blank if we don’t want any kind of extender with the op-code.

 

ü  (E)

Type (E) for error handling to occur.  An error indicator is not allowed if the E extender is specified.

 

ü  (H)

Type (H) if half adjust is to be performed.

 

ü  (N)

Type (N) if to read a file without lock.

 

ü  (P)

Type (P) if the result field is to be padded with blanks.           

 

 

 

o   Factor 2             

  Factor1 represents the name or literal on which the actual operation is to be performed.

 

 

o   Result   

   Result field is used to hold the result of the calculation operation in a name or literal.      

 

 

o   Field Length

   Possible values:

ü  Blank

Leave the field blank if the result field is already defined.

 

ü  1-30

Type a value from 1 to 30 to specify the length for a numeric field.

 

ü  1-32767

Type a value from 1 to 32767 to specify the length for a character field.

 

 

o   Decimal Positions

  Choose from the following:

ü  Blank

Leave the field blank if the result field is already defined or if it is not decimal.

 

ü  0-30

Type a value from 0 to 30 to indicate the number of decimal positions of the result field.

 

 

 

o   HI

  This resulting indicator representing a condition found for greater than, high or no record found condition. 

 

  Possible values:                  

ü  Blank

Leave the field blank if no indicator is to be set on.

 

ü  01-99

Type any two-digit number to indicate general indicators.        

 

ü  KA-KN or KP-KY

Type a value from KA to KN or from KP to KY to indicate a function key indicator.


ü  LR

Type LR to indicate a last record indicator.


ü  OA-OG or OV                                                       

Type a value from OA to OG or OV to indicate any overflow indicator.

 

 

o   LO

  This resulting indicator representing a condition found for less than or an error condition

 

  Possible values:                  

 

ü  Blank

Leave the field blank if no indicator is to be set on.


ü  01-99

Type any two-digit number.


ü  KA-KN or KP-KY

Type a value from KA to KN or from KP to KY to indicate a function key indicator.


ü  OA-OG or OV

Type a value from OA to OG or OV to indicate an overflow indicator.

 

o   EQ

  This resulting indicator representing a condition found for equal, beginning-of-file, an end-of-file, or a search string-found condition. 

 

  Possible values:

ü  Blank                                                             

Leave the field blank if no indicator is to be set on.

 

ü  01-99

Type any two-digit number.                                     

 

ü  KA-KN or KP-KY

Type a value from KA to KN or from KP to KY to indicate a function key indicator.


ü  OA-OG or OV                                                       

Type a value from OA to OG or OV to indicate an overflow indicator.

 

 

 

o   Comment

Type comments to describe any calculation.  

 

 

 

Ü C  SPEC another prompt type: IPCX

 

This prompt gives Extended Factor 2 specifications for calculation.


Prompt type . . .   CX      Sequence number . . .  '''''''            
                                                                      
Level    N01  Factor 1         Operation                               
 __      ___  ___________      __________
                                                               
Extended                                                              
Factor 2                                          Comment 
_______________________________________________   ________________        

 











User Comments:



Subscribe

.  


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