Free software training Videos

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

List Of Best WebSites

Showing posts with label cl. Show all posts
Showing posts with label cl. Show all posts

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

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                                  

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

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 **************************************** 

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         *        
                                                          


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).

*tcat in as400


*TCAT 
 
 
(concatenation with trailing blank truncation,)
 
 
symbol    operator  |<
TRUNCATED THE ALL TRAILING SPACES.
NO SPACE IS INCLUDED







0001.00 PGM                                                      
0002.00              DCL        VAR(&C) TYPE(*CHAR) LEN(20)      
0003.00              CHGVAR     VAR(&C) VALUE(' RAM    '|<'ESH') 
0004.00              SNDUSRMSG  MSG(&C)                          
0005.00 ENDPGM                                                  

output

RAMESH


WHAT IS OUT PUT FOR THIS PROGRAM

FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
       *************** Beginning of data ************************************
001.00 PGM                                                                  
002.00              DCL        VAR(&A) TYPE(*CHAR) LEN(30) VALUE('WELCOME + 
003.00                           TO AS400')                                 
004.00              DCL        VAR(&B) TYPE(*CHAR) LEN(30) VALUE('WELCOME + 
005.00                           TO JAVA')                                  
006.00              DCL        VAR(&C) TYPE(*CHAR) LEN(60)                  
007.00              CHGVAR     VAR(&C) VALUE(%SST(&A 1 16) *CAT (%SST(&B 12 +
008.00                           4)))                                       
009.00              SNDUSRMSG  MSG(&C)                                      
010.00 ENDPGM                                                               
       ****************** End of data ***************************************

*BCAT in as400

*BCAT 
 
 
                     *Concatenation with blank insertion,
 
 
It truncate all trailing blanks in first string .
but one blank is inserted.
 
 
oprator symbol     |>
 
 
0001.00 PGM                                                       
0002.00              DCL        VAR(&C) TYPE(*CHAR) LEN(20)       
0003.00              CHGVAR     VAR(&C) VALUE('    RAM    ' |> 'ESH')
0004.00              SNDUSRMSG  MSG(&C)                           
0005.00 ENDPGM                                       
 
OUTPUT
 
  RAM ESH     (one space between ram and esh)         

*cat in as400


The *CAT operator concatenates two character strings

operator symbol is     ||


EXAMPLE1:
  CHGVAR     VAR(&C) VALUE('RAM' *CAT 'ESH')
            output
RAMESH


EAMPLE2;
CHGVAR     VAR(&C) VALUE('RAM   ' *CAT 'ESH')

     OUTPUT
RAM  ESH ( 2 SPACES AFTER RAM)





Example:

0001.00 PGM                                                                 
0002.00              DCL        VAR(&A) TYPE(*CHAR) LEN(10) VALUE('ramesh') 
0003.00              DCL        VAR(&B) TYPE(*CHAR) LEN(10) VALUE('CHANDANA')
0004.00              DCL        VAR(&C) TYPE(*CHAR) LEN(20)                 
0005.00              CHGVAR     VAR(&C) VALUE(&a *cat &b)                   
0006.00              SNDUSRMSG  &C                                          
0007.00 ENDPGM  


OutPUT

Job 418467/CHVRAMESH/QPADEV0024 changed by JOBMANAGER.
ramesh    CHANDANA                                                   




_________USING OPERATOR  SYMBOL __________________
0001.00 PGM                                                                 
0002.00              DCL        VAR(&A) TYPE(*CHAR) LEN(10) VALUE('ramesh') 
0003.00              DCL        VAR(&B) TYPE(*CHAR) LEN(10) VALUE('CHANDANA')
0004.00              DCL        VAR(&C) TYPE(*CHAR) LEN(20)                 
0005.00              CHGVAR     VAR(&C) VALUE(&a *cat &b)                   
0006.00              SNDUSRMSG  &C                                          
0007.00              CHGVAR     VAR(&C) VALUE('  RAM   ' || ' ESH ')        
0008.00              SNDUSRMSG  &C                                          
0009.00 ENDPGM                                                                                                         

Thursday, 22 November 2012

%binary in as400

syntax

%BIN(character-variable-name starting-position length)
 
The binary built-in function (%BINARY or %BIN) interprets the contents of a specified CL character variable as a signed binary integer. The starting position begins at the position specified and continues for a length of 2 or 4 characters. 

Referance
 
 publib.boulder.ibm.com/infocenter/iadthelp/v6r0/
index.jsp?topic=/com.ibm.etools.iseries.pgmgd.doc/evfclmst51.htm


1)THIS COMMAND IS USED FOR CONVERTING X-DECIMAL VALUE TO EQVALENT DEC VALUE
 
  FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
        *************** Beginning of data *************************************
0001.00 PGM                                                                    
0002.00              DCL        VAR(&VAR1) TYPE(*CHAR) LEN(2) VALUE(X'000A')   
0003.00              DCL        VAR(&VAR2) TYPE(*DEC) LEN(3 0)                 
0004.00              CHGVAR     VAR(&VAR2) VALUE(%BIN(&VAR1))                  
0005.00              CHGVAR     VAR(&VAR1) VALUE(&VAR2)                        
0006.00              SNDUSRMSG  MSG(&VAR1)                                     
0007.00 ENDPGM                                                                 
        ****************** End of data ****************************************
 
 
OUTPUT
 
Job 414535/CHVRAMESH/QPADEV0029 changed by JOBMANAGER.
10 
 
 
 
 

Tuesday, 20 November 2012

%sst or %substring command in as400

it produces subset of existing string

The substring built-in function (%SUBSTRING or%SST) produces a character string that is a subset of an existing character string and can only be used within a CL procedure. In a CHGVAR command, the %SST function can be specified in place of the variable (VAR parameter) to be changed or the value (VALUE parameter) to which the variable is to be changed. In an IF command, the %SST function can be specified in the expression.










 FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
        *************** Beginning of data *************************************
0001.00 PGM                                                                   
0002.00              DCL        VAR(&NAME) TYPE(*CHAR) LEN(20) VALUE('my +    
0003.00                           name is ramesh')                            
0004.00              CHGVAR     VAR(%SST(&NAME 12 7)) VALUE(KUMAR)            
0005.00              SNDPGMMSG  MSG(&NAME)                                    
0006.00 ENDPGM                                                                
        ****************** End of data ****************************************

OUTPUT

 ===> call clp008 
                  
 F3=Exit   F4=Promp
 F23=Set initial me
 my name is KUMAR  
**************************************************************************
a


WHat IS output OF this program  ?


Columns . . . :    1  71            Edit                     CHVRAMESH1/RAMESH
SEU==>                                                                  CLP008
FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
       *************** Beginning of data *************************************
001.00 PGM                                                                    
002.00              DCL        VAR(&NAME) TYPE(*CHAR) LEN(20) VALUE('my +     
003.00                           name is ramesh')                             
004.00              CHGVAR     VAR(%SST(&NAME 12 7)) VALUE(KUMAR)             
005.00              SNDUSRMSG  MSG(&NAME)                                     
006.00          IF         COND(%SST(&NAME 12 5) *EQ 'KUMAR')   +             
007.00                           THEN(CALL PGM(CLP003))                       
008.00 ENDPGM                                                                 
       ****************** End of data **************************************** 

Monday, 19 November 2012

chgvar as400

 chgvar command in clp
Change Variable (CHGVAR)


       the dec variable not send directly to output in clp. so we can change it into char        
      it converts dec variable to char variable.
              

  
The Change Variable (CHGVAR) command changes the value of a Control
Language (CL) variable or part of a character variable.  The value
can be changed to the value of a constant, to the value of another
variable, or to the value gotten from the evaluation of an        
expression or a built-in function.  Expressions and built-in      
functions are described in "Expressions in CL Commands" in the CL 
concepts and reference topic in the iSeries Information Center at 
http://www.ibm.com/eserver/iseries/infocenter.  Also, implicit    
conversion between decimal and character values is performed by the
rules given in the VALUE parameter description.                   





*************** Beginning of data *************************************
0001.00 PGM                                                                   
0002.00              DCL        VAR(&AGE) TYPE(*DEC) LEN(3) VALUE(200)        
0003.00              DCL        VAR(&AGE1) TYPE(*CHAR) LEN(5)                 
0004.00              CHGVAR     VAR(&AGE1) VALUE(&AGE)                        
0005.00              SNDPGMMSG  MSG(&AGE1)                                    
0006.00 ENDPGM                                                                
        ****************** End of data ****************************************

output

 ===>                                                                         
 F3=Exit          F4=Prompt             F5=Refresh            F6=Create       
 F9=Retrieve      F10=Command entry     F23=More options      F24=More keys   
 00200                                                                        



example 2

        *************** Beginning of data *************************************
0001.00 PGM                                                                   
0002.00              DCL        VAR(&AGE) TYPE(*DEC) LEN(3) VALUE(200)        
0003.00              DCL        VAR(&AGE1) TYPE(*CHAR) LEN(5)                 
0004.00              CHGVAR     VAR(&AGE) VALUE(&AGE+1)                       
0005.00              CHGVAR     VAR(&AGE1) VALUE(&AGE)                        
0006.00              SNDPGMMSG  MSG(&AGE1)                                    
0007.00 ENDPGM                                                                
        ****************** End of data ****************************************

what is output?
write in comment
 

Sunday, 18 November 2012

call command in clp

The Call (CALL) command calls a program named on the command, and passes control to it. Optionally, the program or user issuing the CALL command can pass parameters to the called program. The CALL command can be used in batch jobs, in interactive jobs, and in both compiled and interpreted control language (CL). When the called program finishes processing, it can return control to the calling program using the RETURN command.
syntax

in command line
CALL   PGM(clp001)
 
example in program
        *************** Beginning of data *************************************
0001.00 PGM                                                                    
0002.00              CALL       CLP002                                         
0003.00              CALL       CLP003                                         
0004.00              CALL       CLP004                                         
0005.00                                                                        
0006.00 ENDPGM                                                                 
        ****************** End of data ****************************************
                                                                                

sndpgmmsg in as400

                       Send Program Message (SNDPGMMSG)
The Send Program Message (SNDPGMMSG) command sends a message to a     
named message queue or to a call message queue.  A call message       
queue can be the *EXT external message queue or a message queue       
associated with a call stack entry.  Each time a program or           
procedure is called a new message queue is associated with its call   
stack entry.  The message queue is identified by the name of its      
associated program or procedure.                                      
                                                                      
A program can send a message to its own message queue or to a         
message queue that is associated with a different call stack entry.   
                                                                      
This command can send both exception and non-exception messages.   


The SNDPGMMSG command allows a message of up to 512 characters
to be sent.  However, if the message is sent to the *EXT     
message queue of an interactive job, only 76 characters are  
shown on the Display Program Messages display.




example

PGM                                          
             SNDPGMMSG  MSG('simple message')
ENDPGM                                      

OUTPUT
 ===>                                                                          F3=Exit          F4=Prompt             F5=Refresh            F6=Create      
 F9=Retrieve      F10=Command entry     F23=More options      F24=More keys  
 simple message               
------------------------------------------------
       *************** Beginning of data *************************************
001.00 PGM                                                                   
002.00              DCL        VAR(&NAME) TYPE(*CHAR) LEN(20) VALUE('my +    
003.00                           name is RAMESH')                            
004.00              IF         COND((%SST(&NAME 12 6)) *EQ 'RAMESH') THEN(DO)
005.00              SNDPGMMSG  MSG(&NAME)                                    
006.00              ENDDO                                                    
007.00 ENDPGM                                                                
       ****************** End of data ****************************************
output
in msgarea

my name is ramesh
__________________________________________
      *************** Beginning of data ************************************
01.00 PGM                                                                  
02.00              DCL        VAR(&NAME) TYPE(*CHAR) LEN(20) VALUE('my +   
03.00                           name is RAMESH')                           
04.00              IF         COND((%SST(&NAME 12 6)) *EQ 'RAMESH') THEN(DO)
05.00              SNDPGMMSG  MSG(&NAME) TOPGMQ(*EXT)                      
06.00              ENDDO                                                   
07.00 ENDPGM                                                               
      ****************** End of data ***************************************
output
 Job 421214/CHVRAMESH/QPADEV004S changed by JOBMANAGER.
Job 421214/CHVRAMESH/QPADEV004S changed by JOBMANAGER.
my name is RAMESH                                    
                                              

Saturday, 17 November 2012

CMDLBL COMMAND IN AS400

0001.00 PGM                                     
0002.00              GOTO       CMDLBL(ABC)     
0003.00  ABC:        SNDPGMMSG  MSG(HI)         
0004.00 ENDPGM    


USING IF

0001.00 PGM                                                             
0002.00              DCL        VAR(&SEX) TYPE(*CHAR) VALUE('M')        
0003.00             IF         COND(&SEX *EQ 'M') THEN(GOTO CMDLBL(ABC))
0004.00  ABC:        SNDPGMMSG  MSG(HI)                                 
0005.00 ENDPGM