Free software training Videos

Free software training Videos
https://www.youtube.com/user/VLRTraining

List Of Best WebSites

Friday, 30 November 2012

%ABS FUNCTION IN RPGLE

 FMT D  DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++
        *************** Beginning of data *************************************
0001.00 DA                S              1S 0 INZ(-4)                          
0002.00 C                   EVAL      A=%ABS(A-2)                              
0003.00 C     A             DSPLY                                              
0004.00 C                   SETON                                        LR    
        ****************** End of data ****************************************


ABS FUNCTION IN RPG


what IS OUTPUT

Built-in-functions in rpgle

  1.  %ABS - Absolute Value of Expression
  2.   %ADDR - Get Address of Variable
  3.   %ALLOC - Allocate Storage
  4.   %CHAR - Convert to Character Data
  5.   %CHECK - Check Characters
  6.   %CHECKR - Check Reverse
  7.   %DATE - Convert to Date
  8.   %DAYS - Number of Days
  9.   %DEC - Convert to Packed Decimal Format
  10.   %DECH - Convert to Packed Decimal Format with Half Adjust
  11.   %DECPOS - Get Number of Decimal Positions
  12.   %DIFF - Difference Between Two Date, Time, or Timestamp Values
  13.   %DIV - Return Integer Portion of Quotient
  14.   %EDITC - Edit Value Using an Editcode
  15.   %EDITFLT - Convert to Float External Representation
  16.   %EDITW - Edit Value Using an Editword
  17.   %ELEM - Get Number of Elements
  18.   %EOF - Return End or Beginning of File Condition
  19.   %EQUAL - Return Exact Match Condition
  20.   %ERROR - Return Error Condition
  21.   %FLOAT - Convert to Floating Format
  22.   %FOUND - Return Found Condition
  23.   %GRAPH - Convert to Graphic Value
  24.   %HOURS - Number of Hours
  25.   %INT - Convert to Integer Format
  26.   %INTH - Convert to Integer Format with Half Adjust
  27.   %LEN - Get or Set Length
  28.   %LOOKUPxx - Look Up an Array Element
  29.   %MINUTES - Number of Minutes
  30.   %MONTHS - Number of Months
  31.   %MSECONDS - Number of Microseconds
  32.   %NULLIND - Query or Set Null Indicator
  33.   %OCCUR - Set/Get Occurrence of a Data Structure
  34.   %OPEN - Return File Open Condition
  35.   %PADDR - Get Procedure Address
  36.   %PARMS - Return Number of Parameters
  37.   %REALLOC - Reallocate Storage
  38.   %REM - Return Integer Remainder
  39.   %REPLACE - Replace Character String
  40.   %SCAN - Scan for Characters
  41.   %SECONDS - Number of Seconds
  42.   %SHTDN - Shut Down
  43.   %SIZE - Get Size in Bytes
  44.   %SQRT - Square Root of Expression
  45.   %STATUS - Return File or Program Status
  46.   %STR - Get or Store Null-Terminated String
  47.   %SUBDT - Extract a Portion of a Date, Time, or Timestamp
  48.   %SUBST - Get Substring
  49.   %THIS - Return Class Instance for Native Method
  50.   %TIME - Convert to Time
  51.   %TIMESTAMP - Convert to Timestamp
  52.   %TLOOKUPxx - Look Up a Table Element
  53.   %TRIM - Trim Blanks at Edges
  54.   %TRIML - Trim Leading Blanks
  55.   %TRIMR - Trim Trailing Blanks
  56.   %UCS2 - Convert to UCS-2 Value
  57.   %UNS - Convert to Unsigned Format
  58.   %UNSH - Convert to Unsigned Format with Half Adjust
  59.   %XFOOT - Sum Array Expression Elements
  60.   %XLATE - Translate
  61.   %YEARS - Number of Years

eval in rpgle

EVAL (Evaluate expression)

 

The EVAL operation code evaluates an assignment statement of the form result=expression.

 

http://as400bks.rochester.ibm.com/iseries/v5r2/ic2924/books/c0925083654.htm

 

Thursday, 29 November 2012

data types in rpg

Blank                                                            
    Leave the field blank for a character field, or a packed decimal
    standalone field, or a zoned decimal field data structure    
    subfield.  For zoned or packed data types, the decimal positions
    field must be nonblank.                                      

A
    Type A if this is a character field.                         

B
    Type B if this is a fixed binary field.                      

D
    Type D if this is a date field.                              

F          

     Type F if this is a floating-point field. 
                                               
 G                                             
     Type G if this is a graphic character field.
                                               
 I                                             
     Type I if this is a signed integer field. 
                                               
 N                                             
     Type N if this is an indicator field.     
                                               
 P                                             
     Type P if this is a packed decimal field. 
                                               
 S                                             
     Type S if this is a zoned field.          
                                               
 T

     Type T if this is a time field.           
                                              
 U                                            
     Type U if this is a unsigned integer field.
                                              
 Z                                            
     Type Z if this is a timestamp field.     
                                              
 *                                            
     Type * if this is a pointer field.       
                                              
                             

Declaration TypeS IN RPG

 Blank                                                            
     Leave the field blank if this specification does not define a
     data structure, a constant, a standalone field, an array, or a
     table.                                                       
                                                                  
 DS                                                               
     Type DS if this specification defines a data structure.      
                                                                  
 C                                                                
     Type C if this specification defines a constant.             
                                                                  
 PI                                                               
     Type PI if this specification defines a procedure interface. 
                                                                  
 PR                                                               
     Type PR if this specification defines a prototype for a call.
S                                                              
    Type S if this specification defines a standalone field, an
    array, or a table.                                         

rpgle operations

  1.  DSPLY - Display Function
  2.   DUMP - Program Dump
  3.   ELSE - Else
  4.   ELSEIF - Else If
  5.   ENDyy - End a Structured Group
  6.   ENDSR - End of Subroutine
  7.   EVAL - Evaluate expression
  8.   EVALR - Evaluate expression, right adjust
  9.   EXCEPT - Calculation Time Output
  10.   EXFMT - Write/Then Read Format
  11.   EXSR - Invoke Subroutine
  12.   EXTRCT - Extract Date/Time/Timestamp
  13.   FEOD - Force End of Data
  14.   FOR - For
  15.   FORCE - Force a Certain File to Be Read Next Cycle
  16.   GOTO - Go To
  17.   IF - Else If
  18.   IFxx - If
  19.   IN - Random Retrieval from a File
  20.   ITER - Iterate
  21.   KFLD - Define Parts of a Key
  22.   KLIST - Define a Composite Key
  23.   LEAVE - Leave a Do/For Group
  24.   LEAVESR - Leave a Subroutine
  25.   LOOKUP - Look Up a Table or Array Element
  26.   MHHZO - Move High to High Zone
  27.   MHLZO - Move High to Low Zone
  28.   MLHZO - Move Low to High Zone
  29.   MLLZO - Move Low to Low Zone
  30.   MONITOR - Begin a Monitor Group
  31.   MOVE - Move
  32.   MOVEA - Move Array
  33.   MOVEL - Move Left
  34.   MULT - Multiply
  35.   MVR - Move Remainder
  36.   NEXT - Next
  37.   OCCUR - Set/Get Occurrence of a Data Structure
  38.   ON-ERROR - On Error
  39.   OPEN - Return File Open Condition
  40.   ORxx - Or
  41.   OTHER - Otherwise Select
  42.   OUT - Write a Data Area
  43.   PARM - Identify Parameters
  44.   PLIST - Identify a Parameter List
  45.   POST - Post
  46.   READ - Read a Record
  47.   READC - Read Next Changed Record
  48.   READE - Read Equal Key
  49.   READP - Read Prior Record
  50.   READPE - Read Prior Equal
  51.   REALLOC - Reallocate Storage
  52.   REL - Release
  53.   RESET - Reset
  54.   RETURN - Return to Caller
  55.   ROLBK - Roll Back
  56.   SCAN - Scan for Characters
  57.   SELECT - Begin a Select Group
  58.   SETGT - Set Greater Than
  59.   SETLL - Set Lower Limit
  60.   SETOFF - Set Indicator Off
  61.   SETON - Set Indicator On
  62.   SHTDN - Shut Down
  63.   SORTA - Sort an Array
  64.   SQRT - Square Root of Expression
  65.   SUB - Subtract
  66.   SUBDUR - Subtract Duration
  67.   SUBST - Get Substring
  68.   TAG - Tag
  69.   TEST - Test Date/Time/Timestamp
  70.   TESTB - Test Bit
  71.   TESTN - Test Numeric
  72.   TESTZ - Test Zone
  73.   TIME - Convert to Time
  74.   UNLOCK - Unlock a Data Area or Release a Record
  75.   UPDATE - Modify Existing Record
  76.   WHEN - When True Then Select
  77.   WHENxx - When True Then Select
  78.   WRITE - Create New Records
  79.   XFOOT - Sum Array Expression Elements
  80.   XLATE - Translate
  81.   Z-ADD - Zero and Add
  82.   Z-SUB - Zero and Subtract

simple program in rpgle

STEP1:
Type wrkmbrpdm in command line
step 2:
press f6 for creating new program(STRSEU)
step3:
type program name,type,text in seu
as400 rpg program
-------------------------------

Step4
step4:step4: declare one variables a and b
Varibles must be declared in DECLARATION SECTION

Type D and press F4

Write variable name
Give DeclarationType      is S
as400 rpgle program

--------------------------------------------

declare number2 and result varibles
In calculation specification claculate result of number1+number2 using EVAL operator
using DSPLY operation display the result



 

rpgle online training

RPG IV Specifications

There are seven types of RPG IV specifications. Each specification type is optional.
Main source section:
  1. Control specifications provide the compiler with information about generating and running programs, such as the program name, date format, and use of alternate collating sequence or file translation.
  2. File description specifications describe all the files that your program uses.
  3. Definition specifications describe the data used by the program.
  4. Input specifications describe the input records and fields used by the program.
  5. Calculation specifications describe the calculations done on the data and the order of the calculations. Calculation specifications also control certain input and output operations.
  6. Output specifications describe the output records and fields used by the program.
Subprocedure section:
  1. Procedure specifications mark the beginning and end of the subprocedure, indicate the subprocedure name, and whether it is exported.
  2. Definition specifications describe the local data used by the subprocedure.
  3. Calculation specifications describe the calculations done on both the global and local data and the order of the calculations.
Referance
RPG 4 ONLINE TRAINING

rpgle training

history of rpg

  1. RPG is a high-level programming language (HLL) for business applications.
  2. RPG_REPORT PROGRAM GENERATOT
  3. Developed by IBM in 1959 as the Report Program Generator 
  4. The current version, RPG IV (a.k.a. ILE RPG)
  5. RPG II was introduced with the System/3 series of computers.
    RPG III was created for the System/38 and its successor the AS/400.
    DE/RPG or Data Entry RPG was exclusively available on the IBM 5280 series
    RPG/400 was effectively RPG III running on AS/400.
    RPG IV (a.k.a. RPGLE and ILE RPG[2]) was released in 1994  
REFERANCE
RPGLE online TRainong

 

Tuesday, 27 November 2012

data queue in as400

Data from a job can be transferd to another job using a data queue

CRTDTAQ

                           Create Data Queue (CRTDTAQ)                         
                                                                               
 Type choices, press Enter.                                                    
                                                                               
 Data queue . . . . . . . . . . . > DTAQ001       Name                         
   Library  . . . . . . . . . . .     *CURLIB     Name, *CURLIB                
 Type . . . . . . . . . . . . . .   *STD          *STD, *DDM                   
 Maximum entry length . . . . . . > 15            1-64512                      
 Force to auxiliary storage . . .   *NO           *NO, *YES                    
 Sequence . . . . . . . . . . . .   *FIFO         *FIFO, *LIFO, *KEYED         
 Include sender ID  . . . . . . .   *NO           *NO, *YES                    
 Queue size:                                                                   
   Maximum number of entries  . .   *MAX16MB      Number, *MAX16MB, *MAX2GB    
   Initial number of entries  . .   16            Number                       
 Automatic reclaim  . . . . . . .   *NO           *NO, *YES                    
 Text 'description' . . . . . . .   'first data q'                                     
                                                                               

RESULT

F23=Set initial menu                                    
Object DTAQ001 type *DTAQ created in library CHVRAMESH1. 
---------------------------------------------------------------------------------
Program for send and receives data from data queue.




Monday, 26 November 2012

local data area in as400

0001.00 PGM                                                        
0002.00              DCL        VAR(&NAME) TYPE(*CHAR) LEN(30)     
0003.00              CHGDTAARA DTAARA(*LDA) VALUE('THIS IS MY NEW ')
0004.00              RTVDTAARA  DTAARA(*LDA (1 30)) RTNVAR(&NAME)  
0005.00              SNDUSRMSG &NAME                               
0006.00 ENDPGM                                                     

output

Job 430806/CHVRAMESH/QPADEV001L changed by JOBMANAGER.
THIS IS MY NEW                                       

RTVDTAARA in as 400

The Retrieve Data Area (RTVDTAARA) command is used in a CL program or REXX procedure to retrieve all or part of a specified data area and copy it into a variable. RTVDTAARA does not retrieve any other attributes of the data area. Existence of the data area is not required at the time the CL program is compiled.
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=%2Fcl%2Frtvdtaara.htm

example
-----------------------------
 FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ..
        *************** Beginning of data *****************************
0001.00 PGM                                                           
0002.00              DCL        VAR(&NAME) TYPE(*CHAR) LEN(30)        
0003.00              RTVDTAARA  DTAARA(DTA002 (50 30)) RTNVAR(&NAME)  
0004.00              SNDUSRMSG &NAME                                  
0005.00 ENDPGM                                                        
        ****************** End of data ********************************
                                                                      

Output
Job 429823/CHVRAMESH/QPADEV001L changed by JOBMANAGER. 
Job 429823/CHVRAMESH/QPADEV001L changed by JOBMANAGER. 
praveen kumar gubbala                                  

CHGDTAARA in as400

The Change Data Area (CHGDTAARA) command changes the value of the local data area, the group data area, the program initialization parameter data area, or the specified data area stored in a library. This command does not change the data attributes or any of the object attributes of the data area. The new value must have the same type and a length less than or equal to the data area length or the specified substring length.

http://publib.boulder.ibm.com/html/as400/v4r5/ic2979/info/cl/chgdtaar.htm

---------------------------------------------------------

Example

ibm as400 online training

-----------------------------
 output
ibm as400 online training

DSPDTAARA in as400

The Display Data Area (DSPDTAARA) command shows the attributes and value of the specified data area. The following attributes are displayed: the type and length of the data area, the library where the data area is located (there is no library associated with a

http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Fcl%2Fdspdtaara.htm

example:
type dspdtaara in command line press f4

online as400 training
 OUTPUT
online as400 training

CRTDTAARA in as400

The Create Data Area (CRTDTAARA) command creates a data area and stores it in a specified library. It also specifies the attributes of the data. The data area can also be initialized to a specific value.

for more info
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=%2Fcl%2Fcrtdtaara.htm

example

1)Type crtdtaara in command line and press f4

you get this screen

clp online training








-----------

type data area name,type,initialvalue etc
press enter

 Selection or command                                                          
 ===> CRTDTAARA DTAARA(DTA002) TYPE(*CHAR) LEN(100) VALUE('chandana venkata rame
sh') TEXT('dta002 contains names')                                              

data area in as400

Data Area is a data storing file,one data area can store only one record of data, the size of Data area is 2048 bytes.The stored data is retrieved when ever is needed and where ever is needed.Data Area won't have source but by creation object will be created in the library.To see whether the data area is created or not use "WRKOBJPDM".


FOR more information

http://as400mani.blogspot.in/2012/01/data-area-in-as400.html




1.CRTDTAARA :For creation
2.DSPDTAARA :For display
3.CHGDTAARA :for adding and editing
4.RTVDTAARA :For retrieving data
5.DLTDTAARA :For deleting the data area

ESCAPE MESSAGE IN AS400

Escape (*ESCAPE): If the problem is serious enough, the program should abend (abend is short for abnormal end). If your CL program abends, it must send an escape message to its caller (the program that called it, or you yourself, if you initiated the program manually). When the caller gets the escape message it will know for sure that there was something seriously wrong,


FOR MORE INFORMATION
http://www.mcpressonline.com/system-administration/general/as400-messages-part-i.html

selective command prompting IN AS 400

REFER

??     The parameter is displayed and input-capable.
?*     The parameter is displayed but is not input-capable. Any user-specified value is passed to the command processing program.
?<     The parameter is displayed and is input-capable, but the command default is sent to the CPP unless the value displayed on the parameter is changed.
?/     Reserved for IBM use.
?–     The parameter is not displayed. The specified value (or default) is passed to the CPP. Not allowed in prompt override programs.
?&     The parameter is not displayed until F9=All parameters is pressed. Once displayed, it is input-capable. The command default is sent to the CPP unless the value displayed on the parameter is changed.
?%     The parameter is not displayed until F9=All parameters is pressed. Once displayed, it is not input-capable. The command default is sent to the CPP.
EXAMPLE
 FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5
        *************** Beginning of data *****************
0001.00 PGM                                               
0002.00   ?CRTSRCPF                                       
0003.00 ENDPGM                                            
        ****************** End of data ********************

OUTPUT









EXAMPLE2
        *************** Beginning of data *******************************
0001.00 PGM                                                             
0002.00              ?          CRTSRCPF ??FILE(CHVRAMESH1/AERCEFI) +   
0003.00                         ??TEXT('COMMAND PROMPTING')             
0004.00 ENDPGM                                                          
        ****************** End of data **********************************


Sunday, 25 November 2012

monmsg in cl programmin

Monitor Message (MONMSG)

 

The Monitor Message (MONMSG) command is used to monitor escape, notify, and status messages sent to the program message queue of the program in which the command is used. Completion and diagnostic messages cannot be monitored.

Referance 

----------------------
 EXAMPLE-1
         *************** Beginning of data *****************************
0001.00 PGM                                                          
0002.00 CRTSRCPF FILE(A434567890)                                    
0003.00              MONMSG     MSGID(CPF7302) EXEC(GOTO CMDLBL(END1))
0004.00              SNDUSRMSG  MSG('physical file created')         
0005.00       /*       DLTF       FILE(A434567890)        */              
0006.00  END1:       ENDPGM                                          
        ****************** End of data ********************************

EXAMPLE-2
        *************** Beginning of data *************************************
0001.00 PGM                                                                    
0002.00              DCL        VAR(&A) TYPE(*DEC) LEN(3) VALUE(123)           
0003.00              DCL        VAR(&C) TYPE(*CHAR) LEN(5)                     
0004.00              DCL        VAR(&B) TYPE(*DEC) LEN(3)                      
0005.00              CHGVAR     VAR(&A) VALUE(&A / &B)                         
0006.00            MONMSG     MSGID(MCH1211) EXEC(CHGVAR VAR(&A) VALUE(1))     
0007.00              CHGVAR     VAR(&C) VALUE(&A)                              
0008.00              SNDUSRMSG  MSG(&C)                                        
0009.00              ENDPGM                                                    
        ****************** End of data **************************************** 

dltf command in as400

DLTF (Delete File)

The Delete File (DLTF) command can be used to delete files on the source and target servers.

Referance

screen

as400 online training
as400 online
 eaxmaple progaram

0001.00 PGM                                                          
0002.00 CRTSRCPF FILE(A434567890)                                    
0003.00              MONMSG     MSGID(CPF7302) EXEC(GOTO CMDLBL(END1))
0004.00              SNDUSRMSG  MSG('physical file created')         
0005.00              DLTF       FILE(A434567890)                     
0006.00  END1:       ENDPGM                                          


WRKSPLF COMMAND IN CL


The Work with Spooled Files (WRKSPLF) command allows the user to work with the spooled files on the system that meet the selection values specified by the SELECT keyword. You can either display or print all the spooled files on the system or a selected subset of them.



http://publib.boulder.ibm.com/html/as400/v4r5/ic2962/info/cl/wrksplf.htm

----------------------------------------------------------------------------------
                        Work with Spooled Files (WRKSPLF) 
                                                          
 Type choices, press Enter.                               
                                                          
 Select files for:                SELECT                  
   User . . . . . . . . . . . . .                *CURRENT 
   Print device . . . . . . . . .                *ALL     
   Form type  . . . . . . . . . .                *ALL     
   User data  . . . . . . . . . .                *ALL     
   ASP  . . . . . . . . . . . . .                *ALL     
 ASP device . . . . . . . . . . . ASPDEV         *        
 Output . . . . . . . . . . . . . OUTPUT         *        
                                                          


DSPMSGD IN AS400

                      Display Message Description (DSPMSGD







                                                         
 Type choices, press Enter.                              
                                                         
 Range of message identifiers:    RANGE                  
   Lower value  . . . . . . . . .                CPF5702  
   Upper value  . . . . . . . . .                *ONLY   
 Message file . . . . . . . . . . MSGF           QCPFMSG 
   Library  . . . . . . . . . . .                  *LIBL 
 Detail . . . . . . . . . . . . . DETAIL         *FULL   
 Format message text  . . . . . . FMTTXT         *YES    
 Output . . . . . . . . . . . . . OUTPUT         *      


 ----------------------------------------------------------------------------------
 Message ID . . . . . . . . . :   CPF5702                                     
 Message file . . . . . . . . :   QCPFMSG                                     
   Library  . . . . . . . . . :     QSYS                                      
                                                                              
 Message . . . . :   File either not DDM file or not found.                   
 Cause . . . . . :   A request to do a remote operation was received, but file
   &1 in library &2 either is not a distributed data management (DDM) file or 
   is not found.                                                              
 Recovery  . . . :   Do one of the following and then try the command again:  
     -- Specify a DDM file on the command.                                    
     -- Specify a different value for the system parameter.                   
     -- Create a DDM file.                                                    
                                                                              
                                                

----------------------------------------------------------------
SOME MESSAGE CODES
CPF3204
Cannot find object needed for file &1 in &2.
CPF323C
QRECOVERY library could not be allocated.
CPF5702
File either not DDM file or not found.
CPF7302
File &1 not created in library &2.
                             
                                                                               

ADDMSGD COMMAND IN AS400

The Add Message Description (ADDMSGD) command describes a message and stores it in a message file for later use. The message description remains in the message file until the file is deleted or until the Remove Message Description (RMVMSGD) command is used to remove it from the file. To change any of the attributes of the message description, such as its message text or severity code, use the Change Message Description (CHGMSGD) command.

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=%2Fcl%2Faddmsgd.htm

                       Add Message Description (ADDMSGD)    
                                                            
Type choices, press Enter.                                  
                                                            
Message identifier . . . . . . . MSGID        > M000002     
Message file . . . . . . . . . . MSGF         > MSG001      
  Library  . . . . . . . . . . .                  *LIBL     
First-level message text . . . . MSG          > MSESSAGE3   
                                                            
                                                            
Second-level message text  . . . SECLVL       > 'MESSAGE4'  
                                                            
                                                            
                                                            
                                                            
                                                            
                                                            
 ...                                                        
Severity code  . . . . . . . . . SEV          > 11          


---------------------------------------------------------------
CLPROGRAM

0001.00 PGM                                                
0002.00              SNDUSRMSG  MSGID(M000002) MSGF(MSG001)
0003.00                                                    
0004.00 ENDPGM                                              

Saturday, 24 November 2012

CRTMSGF command in as400

CRTMSGF

The Create Message File (CRTMSGF) command creates a user-defined message file for storing message descriptions.

 referance
http://publib.boulder.ibm.com/html/as400/v4r5/ic2979/info/cl/crtmsgf.htm


----------------------------------------
                          Create Message File (CRTMSGF)      
                                                             
 Type choices, press Enter.                                  
                                                             
 Message file . . . . . . . . . . MSGF         > msg001         
   Library  . . . . . . . . . . .                  *CURLIB   
 Text 'description' . . . . . . . TEXT           'msg file'     
                                                             
                                                              

dclf command in as400

Declare File (DCLF)

 it is used for declare a device file such as disply file or database file

 

Parameters

Keyword Description Choices Notes
FILE File Qualified object name Required, Positional 1
Qualifier 1: File Name
Qualifier 2: Library Name, *LIBL, *CURLIB
RCDFMT Record format Single values: *ALL
Other values (up to 50 repetitions): Name
Optional, Positional 2
OPNID Open file identifier Simple name, *NONE Optional
ALWVARLEN Allow variable length fields *NO, *YES Optional
ALWNULL Allow field value of null *NO, *YES Optional
ALWGRAPHIC Allow graphic fields *NO, *YES Optional
DCLBINFLD Declare binary fields *DEC, *INT Optional

 

  Accessing the database using clp

1)using cl program we view the data in database file
2)we cannot delete update or write out to the file

eaxmple
      *************** Beginning of data **********
01.00 PGM                                        
02.00              DCLF       FILE(PF001)        
03.00              RCVF       RCDFMT(PF001R)     
04.00              SNDUSRMSG  MSG(&NAME)         
05.00              RCVF       RCDFMT(PF001R)     
06.00              SNDUSRMSG  MSG(&NAME)         
07.00 ENDPGM                                     
      ****************** End of data *************

Friday, 23 November 2012

RTVJOBA IN AS4OO

Retrieve Job Attributes 

 

  1. This command is valid only within a CL program or a REXX procedure. 

CL var for JOB          (10) . . JOB          > &NAME      
CL var for USER         (10) . . USER                      
CL var for NBR           (6) . . NBR                       
CL var for LOGLVL        (1) . . LOGLVL                    
CL var for LOGSEV      (2 0) . . LOGSEV                    
CL var for LOGTYPE      (10) . . LOGTYPE                   
CL var for LOGCLPGM     (10) . . LOGCLPGM                  
CL var for INQMSGRPY    (10) . . INQMSGRPY                 
CL var for OUTQ         (10) . . OUTQ                      
CL var for OUTQLIB      (10) . . OUTQLIB                   
CL var for ACGCDE       (15) . . ACGCDE                    
CL var for DATE          (6) . . DATE                      
CL var for SWS           (8) . . SWS          > &NAME1     
CL var for TYPE          (1) . . TYPE                      
CL var for RTNCDE      (5 0) . . RTNCDE                     
CL var for ENDSTS        (1) . . ENDSTS                   
CL var for RUNPTY      (2 0) . . RUNPTY                   
CL var for TIMESLICE   (7 0) . . TIMESLICE                
CL var for PURGE        (10) . . PURGE                    
CL var for DFTWAIT     (7 0) . . DFTWAIT                  
CL var for USRLIBL    (2750) . . USRLIBL                  
CL var for SBMMSGQ      (10) . . SBMMSGQ                  
CL var for SBMMSGQLIB   (10) . . SBMMSGQLIB               
CL var for PRTTXT       (30) . . PRTTXT                   
CL var for DDMCNV        (5) . . DDMCNV                   
CL var for BRKMSG        (7) . . BRKMSG                   
CL var for DATFMT        (4) . . DATFMT                   
CL var for DATSEP        (1) . . DATSEP                   
CL var for CURLIB       (10) . . CURLIB                   
CL var for PRTDEV       (10) . . PRTDEV                   
CL var for SYSLIBL     (165) . . SYSLIBL                  
CL var for CURUSER      (10) . . CURUSER                   
CL var for SUBTYPE       (1) . . SUBTYPE                   
CL var for PRTKEYFMT    (10) . . PRTKEYFMT                 
CL var for TIMSEP        (1) . . TIMSEP                    
CL var for TSEPOOL      (10) . . TSEPOOL                   
CL var for DEVRCYACN    (13) . . DEVRCYACN                 
CL var for STSMSG        (7) . . STSMSG                    
CL var for SRTSEQ       (10) . . SRTSEQ                    
CL var for SRTSEQLIB    (10) . . SRTSEQLIB                 
CL var for LANGID        (3) . . LANGID                    
CL var for CNTRYID       (2) . . CNTRYID                   
CL var for CCSID       (5 0) . . CCSID                     
CL var for JOBMSGQMX   (2 0) . . JOBMSGQMX                 
CL var for JOBMSGQFL    (10) . . JOBMSGQFL                 
CL var for DFTCCSID    (5 0) . . DFTCCSID                  
CL var for CYMDDATE      (7) . . CYMDDATE                  
CL var for DECFMT        (1) . . DECFMT                   
CL var for CHRIDCTL     (10) . . CHRIDCTL                 
CL var for ASPGRP       (10) . . ASPGRP                   
CL var for SPLFACN      (10) . . SPLFACN                  
CL var for DATETIME     (20) . . DATETIME                 
CL var for TIMZON       (10) . . TIMZON                   
CL var for TIMZONABBR   (10) . . TIMZONABBR               
CL var for TIMZONFULL   (50) . . TIMZONFULL               
CL var for TIMOFFSET    (3 0)  . TIMOFFSET                
CL var for THDRSCAFN    (20) . . THDRSCAFN                
CL var for RSCAFNGRP    (10) . . RSCAFNGRP        


example:

0001.00 PGM                                                        
0002.00              DCL        VAR(&NAME) TYPE(*CHAR) LEN(20)     
0003.00              DCL        VAR(&NAME1) TYPE(*CHAR) LEN(20)    
0004.00              RTVJOBA    JOB(&NAME) SWS(&NAME1)             
0005.00              SNDPGMMSG  MSG(&NAME *CAT &NAME1) TOPGMQ(*EXT)
0006.00              SNDPGMMSG  MSG(&NAME1) TOPGMQ(*EXT)           
0007.00 ENDPGM                                                             


 

operators in as400

  • Arithmetic operators (+, -, *, /)
  • Character operator (||, |>, |<)
  • Logical operators (&, |, ¬)
  • Relational operators (=, >, <, >=, <=, ¬=, ¬>, ¬<) 
a
(=, >, <, >=, <=, not symbol=, not symbol>, not symbol<) or their reserved values (*EQ, *GT, *LT, *GE, *LE, *NE, *NG, *NL).