Sorry, you do not have permission to ask a question, You must login to ask a question.

Sorry, you do not have permission to ask a question.

brainchime.com

brainchime.com

brainchime.com Navigation

  • Home
  • About Us
  • Contact Us

Mobile menu

Close
  • Home
  • Categories
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Recent Questions
  • Most Answered
  • Answers
  • Most Visited
  • Most Voted
  • No Answers
  • Random
  • New Questions
  1. Asked: October 13, 2024In: IBM i

    What is SEU in AS400 and why do we use it?

    Admin
    Admin
    Added an answer on October 13, 2024 at 6:15 am

    EU is a source entry utility. To enter source statements, utilize the Source Entry Utility (SEU). It enables syntax checks and prompts for various specification templates. Start the Source Entry Utility (SEU) by using the STRSEU command. When you use the STRSEU command with the source physical fileRead more

    EU is a source entry utility. To enter source statements, utilize the Source Entry Utility (SEU). It enables syntax checks and prompts for various specification templates.

    Start the Source Entry Utility (SEU) by using the STRSEU command. When you use the STRSEU command with the source physical file name set to QPRGLESRC, the source type is automatically set to RPGLE when the editing session for the new member begins. If not, you must specify the source type as RPGLE when creating the source member manually.
    STRSEU SRCFILE(DEVELOPER/QRPGLESRC) SRCMBR(PGM1)

    Using WRKMBRPDM, we can launch SEU and hit F6 to initiate the creation process.

    • Use PDM’s option 2 to modify a member.
    • To remove a member, take option 4 from PDM.
    • To show a member’s take option 5 on PDM.
    • Choose option 7 on PDM to rename the member.
    • Select option 13 on the PDM against the member to modify the member’s text description and source type.
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  2. Asked: October 13, 2024In: IBM i

    What is the multi-format logical file in AS400?

    Admin
    Admin
    Added an answer on October 13, 2024 at 6:00 am

    A multi-format logical file contains more than one record format. Since all formats share the same RRN, their key fields must match. A multi-format logical file comprises two or more physical files with different record formats. Example of multi-format logical file: Let’s take two PFs, PF1 and PF2.Read more

    A multi-format logical file contains more than one record format. Since all formats share the same RRN, their key fields must match.

    A multi-format logical file comprises two or more physical files with different record formats.

    Example of multi-format logical file: Let’s take two PFs, PF1 and PF2. Their DDS are as follows: DDS source for PF1

    A          R RFMT1                                  
    A            ID            10A       
    A            NAME          20A        
    A            AGE            3P 0
    A            ADDRESS       50A 

    DDS source for PF2

    A          R RFMT2                                 
    A            ID            10A
    A            PHONE         10A 
    A            STATUS         6A 

    Let’s write the DDS source for multi-format logical files using PF1 and PF2 with record formats RFMT1 and RFMT2.

    A          R RFMT1                     PFILE(PF1) 
    A          K ID
    A          R RFMT2                     PFILE(PF2) 
    A          K ID
    A          K PHONE
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  3. Asked: October 12, 2024In: IBM i

    what is PR and PI in rpgle?

    Admin
    Admin
    Added an answer on October 12, 2024 at 6:09 am

    The procedure prototype (PR) is referred to by the compiler when calling the program or procedure and ensures that the caller passes the right arguments as per the defined PR. The procedure entry parameters are declared using the procedure interface (PI). Every parameter on the Procedure Interface (Read more

    The procedure prototype (PR) is referred to by the compiler when calling the program or procedure and ensures that the caller passes the right arguments as per the defined PR.

    The procedure entry parameters are declared using the procedure interface (PI).

    Every parameter on the Procedure Interface (PI) should match the parameters on the Prototype (PR) w.r.t data type, size, and return value.

    Declaring PR and PI in RPG Fixed format:
    D ADD PR
    D PARM1 10A CONST
    D PARM2 3P 0 CONST

    D ADD PI
    D PARM1 10A CONST
    D PARM2 3P 0 CONST

    Declaring PR and PI in RPG fully free format:
    DCL-PR ADD;
    PARM1 CHAR(10) CONST;
    PARM2 PACKED(3) CONST;
    END-PR;

    A free-form prototype specification begins with a DCL-PR statement, followed by the prototype’s name, keywords, and a semicolon.

    To end the prototype, use the END-PR statement. END-PR may be included in the DCL-PR statement if 0 params.

    DCL-PROC ADD;
    DCL-PI *N;
    PARM1 CHAR(10) CONST;
    PARM2 PACKED(3) CONST;
    END-PI;
    END-PROC;

    A free-form technique. The interface specification begins with a DCL-PI statement, followed by the procedure name (or *N if you do not wish to repeat the procedure name), keywords, and a semicolon at the end.

    The END-PI command ends the prototype. If no arguments are supplied, the DCL-PI statement may include END-PI.

    If no prototype is specified for a cycle-main process, the procedure interface can be named *N.

    Please ensure that we use DCL-PROC and END-PROC, which are P specs-free formats in RPG AS400 because we use *N with the procedure interface name.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  4. Asked: October 12, 2024In: IBM i

    what is message queue in as400 and why do we use it?

    Admin
    Admin
    Added an answer on October 12, 2024 at 5:53 am
    This answer was edited.

    The message queue (MSGQ) receives all messages transmitted via the AS400 system. The user receives the message from the message queue (MSGQ) or the application linked to it. A reply to the related message is sent back to the user’s or program’s message queue once it has been received in the MSGQ. ThRead more

    The message queue (MSGQ) receives all messages transmitted via the AS400 system. The user receives the message from the message queue (MSGQ) or the application linked to it. A reply to the related message is sent back to the user’s or program’s message queue once it has been received in the MSGQ. There are different types of message queues in as400, which are as follows:

    • Workstation Message Queue
    • User Profile Message Queue
    • Job Message Queue
    • System Operator Message Queue
    • History Log Message Queue

    Important points to consider:

    • Every workstation has a message queue (MSGQ) of its own.
    • There is a message queue (MSGQ) specific to each user profile.
    • Every job executing on the system possesses a unique message queue (MSGQ). An external message queue (*EX) MSGQ is given to each job, and a call message queue is assigned to each call made by the job to an Integrated Language Environment (ILE) procedure or an Original Program Model (OPM) program.
    • The system operator message queue (QSYSOPR) is accessible to the system operator.
    • History Log Message Queue is provided to the system history log (QHST).
    • System History Log (QHST) receives messages from the History Log Message Queue.
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  5. Asked: October 12, 2024In: IBM i

    What is data area in AS400 and why do we use it. What are its different types?

    Admin
    Admin
    Added an answer on October 12, 2024 at 5:43 am
    This answer was edited.

    Data Area is an object that stores data for access by any task executing on the AS400 system. The data area allows you to store a limited amount of data. Users can restore data area objects to their consistent state by using journal data areas in case of an issue. The data area is used to store andRead more

    Data Area is an object that stores data for access by any task executing on the AS400 system. The data area allows you to store a limited amount of data. Users can restore data area objects to their consistent state by using journal data areas in case of an issue.

    The data area is used to store and transfer data across jobs, including fields that are constantly modified, such as the next number, whether it be an order number, a check number, or a user number.

    Create a data area object using the command CRTDTAARA. Local and group data areas cannot be created using the CRTDTAARA command. While creating a data area object, we can also initialize it with some default values.
    CRTDTAARA DTAARA(TESTLIB/DTAARA1)
    TYPE(*CHAR)
    LEN(2000)
    VALUE('INIT')
    TEXT('Data area 1')

    Once the data area object is created, its type is *DTAARA, and the attribute is blank. We can create different types of data areas in the as400 system, such as,

    • Character (*CHAR)
    • decimal (*DEC)
    • logical (*LGL)
    • remote data area (*DDM)

    Points to remember:

    • The maximum length for the decimal data area is (24,9), and the default length is (15,5).
    • The character data area has a maximum length of 2000 and a default length of 32 characters.
    • For the Logical data area, the maximum and default lengths are 1.
    • A logical data region has a value of either ‘0’ or ‘1’, where ‘0’ represents off, false, or no, and ‘1’ represents on, true, or yes.
    • The starting value can be specified when the data area is created. In case you don’t specify, the default values will be ‘0’ for the logical data area, blanks for the character, and 0 for the decimal.

    We can use the following commands w.r.t the data area object.

    • RTVDTAARA: It is used to fetch the data area content in a CL variable and can only be called from a CL program and can not be invoked from an RPG program or command line.
      RTVDTAARA DTAARA(TESTLIB/DTAARA1 *ALL)
      RTNVAR(&VAR1)
    • CHGDTAARA: It is used to change the contents of the data area object.
      CHGDTAARA DTAARA(TESTLIB/DTAARA1 *ALL)
      VALUE('NEXTVALUE')
    • DSPDTAARA: Use the command DSPDTAARA DTAARA(libname/DTAARA1) to view the value stored in a data area object.
    • DLTDTAARA: You can use this command DLTDTAARA DTAARA(libname/DTAARA1) to delete the data area object in a specified library from the IBM I machine.
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  6. Asked: October 10, 2024In: IBM i

    what is data structure and what are the different types of DS in RPG program?

    Admin
    Admin
    Added an answer on October 10, 2024 at 12:20 pm

    The data structure is a structure of different data types. The user defines the storage region for the data structure, which is called the Subfields in the fields of the structure. The data structure can be used to subdivide and group the fields. There are various types of data structures in AS400,Read more

    The data structure is a structure of different data types. The user defines the storage region for the data structure, which is called the Subfields in the fields of the structure. The data structure can be used to subdivide and group the fields. There are various types of data structures in AS400, which are as follows:

    1. Externally described data structure
    2. Multiple occurrence data structure
    3. Data area data structure
    4. Qualified data structure
    5. File information data structure
    6. Indicator data structure
    7. Program status data structure
    8. In RPG, we can declare the data structure as follows:

      Fixed format declaration of data structure
      In Fixed format RPG, you can declare the data structure by putting DS in D specs (Definition Specifications) positions 24 through 25.
      DDS1 DS

      RPG Fully free declaration of data structure
      In a fully free RPG, you can declare a data structure by supplying the DCL-DS, which the name and keywords of the data structure should follow.

      DCL-DS DS1;
      SUBFIELD1 CHAR(1);
      END-DS;

      The data structure can be defined the same as other data structures using the LIKEDS keyword in the RPG program.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  7. Asked: October 10, 2024In: IBM i

    How to create csv file in as400?

    Admin
    Admin
    Added an answer on October 10, 2024 at 12:15 pm

    To create a CSV file in as400, we can use the command CPYTOIMPF. But, before creating a CSV file, we should at least know what a CSV file is. CSV file is a comma-separated values stream file. CSV files hold data from IBM i files, such as SQL tables or DDS physical files, which are separated by commaRead more

    To create a CSV file in as400, we can use the command CPYTOIMPF. But, before creating a CSV file, we should at least know what a CSV file is. CSV file is a comma-separated values stream file. CSV files hold data from IBM i files, such as SQL tables or DDS physical files, which are separated by commas. CSV file data:

    Name,Email,Id,Age,Address,PhoneNumber

    CSV files are mostly used when we transfer data between two different systems. CSV files are supported by several spreadsheet programs, such as Microsoft Excel and Google spreadsheets. Data on IBM i support EBCDIC format and CSV files in an integrated file system (IFS) must contain ASCII data before exporting it to a Windows computer. Let’s see how to create a CSV file in as400 ifs using the CPYTOIMPF command:

    First, create a physical file or SQL table.
    Fill some records into the file or SQL table.

    IDN NAME ADDR1 ADDR2 
    4 NAME4 ADDRESS4 "PART2 
    4 NAME4 ADDRESS4 "PART2 
    4 NAME4 ADDRESS4 "PART2 

    Run command CPYTOIMPF from the command line to copy data from the file and stream the file in ifs.

    CPYTOIMPF FROMFILE(TESTLIB/FILE1)
    TOSTMF('/home/developer/file1.csv')
    MBROPT(*REPLACE) FROMCCSID(*FILE)
    STMFCCSID(*PCASCII) RCDDLM(*CRLF)
     Copy To Import File (CPYTOIMPF) 
    
    Type choices, press Enter. 
    
    From file: FROMFILE 
    File . . . . . . . . . . . . . > FILE1 
    Library . . . . . . . . . . > TESTLIB
    Member . . . . . . . . . . . . *FIRST 
    To data base file: TOFILE 
    File . . . . . . . . . . . . . 
    Library . . . . . . . . . . *LIBL 
    Member . . . . . . . . . . . . *FIRST 
    To stream file . . . . . . . . . TOSTMF > '/HOME/DEVELOPER/FILE1.CSV' 
    
    Replace or add records . . . . . MBROPT *ADD 
    From CCSID . . . . . . . . . . . FROMCCSID *FILE 
    Stream file CCSID . . . . . . . STMFCCSID *STMF 
    Stream file authority . . . . . STMFAUT *DFT 
    Record delimiter . . . . . . . . RCDDLM > *LFCR 
    Record format of import file . . DTAFMT *DLM 
    String delimiter . . . . . . . . STRDLM > *NONE 
    Remove blanks . . . . . . . . . RMVBLANK *NONE 
    Field delimiter . . . . . . . . FLDDLM ',' 
    Null field indicator . . . . . . NULLIND *NO 
    Decimal point . . . . . . . . . DECPNT *PERIOD 
    Date format . . . . . . . . . . DATFMT *ISO 
    Time format . . . . . . . . . . TIMFMT *ISO 
    Order by . . . . . . . . . . . . ORDERBY *NONE 
    
    ... 
    Add column names . . . . . . . . ADDCOLNAM *NONE 

    This creates a stream file in the IFS home directory “/home/developer/file11.CSV” using the data from the physical file FILE1 in the library TESTLIB copy.

    Work with Links using the command WRKLNK to browse CSV files created in ifs.

                                 Work with Object Links                            
                                                                                   
     Directory  . . . . :   /home/DEVELOPER
                                                                                   
     Type options, press Enter.                                                    
       2=Edit   3=Copy   4=Remove   5=Display   7=Rename   8=Display attributes    
       11=Change current directory ...                                             
                                                                                   
     Opt   Object link            Type             Attribute    Text               
           openfile2              STMF                                             
           openfile3              STMF                                             
           pf21                   STMF                                             
           testdir                DIR                                              
           testfile1              STMF                                             
           file1.csv              STMF                                            
           txtfile1.txt           STMF                                             
           txtfile2.txt           STMF                                             
           txtfile3.csv           STMF 

    Take option 5 to display CSV file data.

    Browse : /home/DEVELOPER/FILE1.CSV
    Record : 1 of 3 by 18 Column : 1 97 by 131 
    Control : ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9.
    ************Beginning of data**************
    4 ,NAME4 ,ADDRESS4 ,"PART"
    24,NAME4 ,ADDRESS4 ,"PART"
    24 ,NAME4 ,ADDRESS4 ,"PART" 
    ************End of Data********************

    As you can see, there is a comma between each field. We see blank spaces between separated column values according to each column field size since the Remove Blank parameter on command CPYTOIMPF was set to *NONE.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  8. Asked: October 10, 2024In: IBM i

    why do we use EXTPGM keyword in RPG program?

    Admin
    Admin
    Added an answer on October 10, 2024 at 11:46 am

    The EXTPGM keyword is used to define the procedure prototype in the RPGLE program. Prototype informs the compiler of how the parameters are defined in the program or procedure. When we use the EXTPGM keyword, then the call will be an external program call that uses an external program object specifiRead more

    The EXTPGM keyword is used to define the procedure prototype in the RPGLE program. Prototype informs the compiler of how the parameters are defined in the program or procedure. When we use the EXTPGM keyword, then the call will be an external program call that uses an external program object specified by the EXTPGM keyword. The call becomes a dynamic external call if the prototype contains the term EXTPGM keyword; otherwise, it is a bound procedure call.
    Example of using EXTPGM keyword:

    • A program without any parameters in its prototype. The program’s external name is “PGM1”.Defining EXTPGM keyword in RPG Fixed format
      D PGM1 PR EXTPGM('PGM1')Defining EXTPGM keyword in RPG

      fully free format:
      DCL-PR PGM1 EXTPGM;
      END-PR;

    • A parameter program prototype. Program ‘PGM1’ is its external name.Defining EXTPGM keyword in RPG Fixed format
      D PGM1 PR EXTPGM('PGM1')
      D PARM1 10A CONST

      Defining EXTPGM keyword in RPG fully free format:
      DCL-PR PGM1 EXTPGM;
      PARM1 CHAR(10) CONST;
      END-PR;

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  9. Asked: October 10, 2024In: IBM i

    what is spool file and how to check spool files in AS400?

    Admin
    Admin
    Added an answer on October 10, 2024 at 11:28 am

    A spool file is used to store output data until it is ready for printing. Once the job that is running gets completed the job log can be written to the spool file QPJOBLOG. After writing the job log to the spool file, the job log gets deleted. You can use the WRKSPLF command to browse spool files inRead more

    A spool file is used to store output data until it is ready for printing. Once the job that is running gets completed the job log can be written to the spool file QPJOBLOG. After writing the job log to the spool file, the job log gets deleted.
    You can use the WRKSPLF command to browse spool files in the AS400 system based on specific users, jobs, etc. If you want to check the spool files generated by the current user, then run the following command.
    WRKSPLF SELECT(*CURRENT)

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  10. Asked: October 10, 2024In: IBM i

    how to check job log in as400?

    Admin
    Admin
    Added an answer on October 10, 2024 at 11:16 am

    To check the job log in as400, please write the DSPJOBLOG command on the command line and press Enter. After that Display Job log screen displays on the screen, Press F10 and then SHIFT + F6. This would bring you to the bottom of the job log. When a job’s job log has not yet been written, the DisplaRead more

    To check the job log in as400, please write the DSPJOBLOG command on the command line and press Enter. After that Display Job log screen displays on the screen, Press F10 and then SHIFT + F6. This would bring you to the bottom of the job log. When a job’s job log has not yet been written, the Display Job Log (DSPJOBLOG) command displays commands and related messages for the active job. It should be noted that the DSPJOBLOG command can also be used to track a job’s progress or any errors that arise while the job is being executed. We can also print a job log at any time using the same DSPJOBLOG command, and a job log spool file will be made available and can be accessed through the command WRKSPLF.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  11. Asked: October 10, 2024In: IBM i

    how to submit a batch job in as400?

    Admin
    Admin
    Added an answer on October 10, 2024 at 10:54 am

    SBMJOB command is used to submit a job in as400; moreover, an existing job can submit another job to a batch job queue (JOBQ) to be executed as a batch job at a later time by using the Submit Job (SBMJOB) command. To launch a program, we need to provide the JOB description (JOBD), the CL command orRead more

    SBMJOB command is used to submit a job in as400; moreover, an existing job can submit another job to a batch job queue (JOBQ) to be executed as a batch job at a later time by using the Submit Job (SBMJOB) command. To launch a program, we need to provide the JOB description (JOBD), the CL command or request data, and the routing data. Also, use the CMD option on SBMJOB to execute a single CL command in a batch job. It also performs syntax checking and permits prompting. Submit a job: Following the command, submit a job.

    SBMJOB CMD(CALL PGM(PGM1))
    JOB(USERJOB)
    JOBD(TESTLIB/TESTJOBD)
    JOBQ(*JOBD)
    OUTQ(TESTOUTQ)
    MSGQ(TESTMSGQ)

    The job description (JOBD) named TESTJOBD in the library TESTLIB would provide the majority of the job’s properties. TESTOUTQ would also be used as the output queue (OUTQ) and TESTMSGQ as the message queue (MSGQ) for the batch job named USERJOB. The command above submits a job. The job will be added to the JOBDs job queue.

    Submit a job to a job queue: The job is submitted to the QBATCH job queue.

    SBMJOB CMD(CALL PGM(PGM1))
    JOB(USERJOB)
    JOBD(TESTLIB/TESTJOBD)
    JOBQ(QBATCH)
    OUTQ(TESTOUTQ)
    MSGQ(TESTMSGQ)

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  12. Asked: October 10, 2024In: SEO

    How to resolve page with redirect error in Google Search Console instead of correct .htaccess file

    Admin
    Admin
    Added an answer on October 10, 2024 at 10:47 am

    Further, I came to know that this is not an error. This is information for you in the Google search console to let you know that the mentioned pages in the screenshot start with (http, http://www, https://www) for the website is being redirected to another URL so that you can verify that the redirecRead more

    Further, I came to know that this is not an error. This is information for you in the Google search console to let you know that the mentioned pages in the screenshot start with (http, http://www, https://www) for the website is being redirected to another URL so that you can verify that the redirect is correct which is done as per plan. You only have to care about your target page; please check if your target page, which is https://example.com, is indexed or not.

    If your target page is indexed, then you can ignore this redirect error in the Google search console, i.e. your audience will always see the target https version of the page.

    Type the below command in Google search and press Enter to confirm whether your target page is indexed or not.
    site:https://example.com

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  13. Asked: October 9, 2024In: SQL

    How to call sql stored procedure with output parameter from within a cl program?

    Admin
    Admin
    Added an answer on October 9, 2024 at 8:39 pm

    I have tried to call the SQL stored procedure with output parameter within a CL program using QZDFMDB2 to run SQL interactively in a CL program and I have succeeded a lot in that. Now, I can call the SQL stored procedure with the output parameter in the CL program, the only drawback that I face is IRead more

    I have tried to call the SQL stored procedure with output parameter within a CL program using QZDFMDB2 to run SQL interactively in a CL program and I have succeeded a lot in that. Now, I can call the SQL stored procedure with the output parameter in the CL program, the only drawback that I face is I am not getting the output parameter value returned in my CL program.

    To call the SQL stored procedure with output parameter in the CL program I have used the, so I created a SQL variable and passed that as a return parameter in the form of a command string to program QZDFMDB2 that allows to run SQL statements in CL program. This makes my first work done i.e. calling a SQL stored procedure in a CL program with output parameters which earlier seemed very difficult or almost impossible. So congrats for this success that we have achieved so far.

    Now, the turn is for receiving the return value in the output parameter which is  SQL variable here. So, it was sad but we are not getting return value from SQL stored procedure in our CL program. So, I decided to use some tricks and tweaks so that I would anyway receive the return value or value returned by the output parameter   SQL stored procedure in my CL program. Let me show you the code and steps that I followed to achieve this:

    1. Create a SQL variable using the CREATE VARIABLE statement from STRSQL.
      create or replace variable out char(1) default ' '
    2. Write a SQL stored procedure that returns the output parameter.
      CREATE OR REPLACE PROCEDURE STORED33(                    
              IN P_NAME CHAR(20),                              
              IN P_GENDER CHAR(1),                             
              OUT SUCCESS CHAR(1)                              
               )                                               
      SPECIFIC STORED33                                        
      BEGIN                                                    
      DECLARE SQLSTATE CHAR(5) DEFAULT ' ';                    
      DECLARE SQLCODE INTEGER DEFAULT 0;                       
                                                               
      DECLARE STMT CHAR(500) DEFAULT ' ';                      
                                                               
      INSERT INTO PF8_D(NAME,GENDER) VALUES(P_NAME,P_GENDER);  
      IF SQLCODE = 0 THEN                                      
        SET SUCCESS = '1';                                     
      SET STMT = 'CREATE OR REPLACE VARIABLE TESTLIB.OUT '  
                 CONCAT 'CHAR(1) DEFAULT ''1''';               
      EXECUTE IMMEDIATE STMT;                                  
      ELSE                                                     
       SET SUCCESS = '0';                                     
      SET STMT = 'CREATE OR REPLACE VARIABLE TESTLIB.OUT ' 
                 CONCAT 'CHAR(1) DEFAULT ''0''';              
      EXECUTE IMMEDIATE STMT;                                 
      END IF;                                                 
      END   

      In the SQL stored procedure code, a few lines are written intentionally such as we are writing create or replace SQL variables and setting their values as 1 or 0 according to SQL code value. Here, the SQL variable works as a return value for my CL program. Please note that SQL variable value is accessible to the same session in which its value is set by default during the create variable statement or SET statement.

    3. Compile the SQL stored procedure using the RUNSQLSTM command.
      RUNSQLSTM SRCFILE(TESTLIB/STOREDPROC) 
                SRCMBR(STORED33)               
                COMMIT(*NONE)                  
                DBGVIEW(*SOURCE)    
    4. Create a view in the qtemp library using the CREATE VIEW statement.
      create or replace view qtemp.rtnval   as (   
      select   testlib.out as                   
      rtn  from sysibm.sysdummy1 ) rcdfmt rtnvalf  
    5. Write a CL program calling SQL stored procedure with the output parameter.
      pgm                                                     
      dcl        var(&cmd) type(*char) len(200)               
      dcl        var(&in1) type(*char) len(20) value('name1') 
      dcl        var(&in2) type(*char) len(1)  value('M')     
      dcl        var(&sqlout) type(*char) len(1)              
      dcl        var(&LIB) type(*char) len(10) +              
                   value('TESTLIB')                        
      DCLF       FILE(rtnval)                                 
                                                              
      CHGVAR     VAR(&CMD) VALUE('create or replace variable +
                   testlib.out char(1) default '' ''')     
      call       pgm(qzdfmdb2) parm((&cmd))                   
                                                              
      CHGVAR     VAR(&CMD) VALUE('CALL +                      
                   testlib.STORED33(''' *CAT &IN1 *TCAT +  
                   ''' , ''' *CAT &IN2 *TCAT ''', ' +         
                   *TCAT &lib *TCAT '.OUT)')                  
      call       pgm(qzdfmdb2) parm((&cmd))   
                      
      RUNSQL     SQL('create or replace view qtemp/rtnval as + 
                   (select testlib.out as rtn from +        
                   sysibm.sysdummy1) rcdfmt rtnvalf') +        
                   COMMIT(*NONE)                               
      RCVF                                                     
      CHGVAR     VAR(&SQLOUT) VALUE(&RTN)    
                        
      return                                                   
      endpgm  

      Please, note that in step 1 we created a SQL variable named OUT in the TESTLIB library so that we can later create a view RTNVAL in qtemp library using that at step 4. For your knowledge as we have declared the view rtnval in my CL program so that I can populate that view with the value that was set by SQL stored procedure in SQL variable (SQL global variable).
      At the beginning of the program, we create an SQL variable out in testlib with a default blank value by passing the create or replace variable statement to the QZDFMDB2 program as a parameter in the string format.
      Then, we call the SQL stored procedure from within the CL program with input and output parameters by first building the &cmd string, and in, we pass the SQL variable instead of any CL program variable. Then we pass it to the QZDFMDB2 program as a parameter to run the SQL stored procedure. Now till this point, we have not received any return value from the SQL stored procedure call using QZDFMDB2. However, within the SQL stored procedure script, we did set the respective success/failure value in the SQL variable globally and now I am ready to receive that in my CL program which would be the actual return value by my SQL stored procedure call.
      So, I selected the global SQL variable value and output it in a view named rtnval, and after that, I just read the view using the RCVF command and evaluated the value from the view column &rtn to the cl program variable &sqlout. Therefore, &sqlout would not contain the return value or the output parameter value that should be returned by the actual SQL stored procedure call within the CL program with the output parameter

    See less
      • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  14. Asked: October 9, 2024In: IBM i

    How to retrieve iSeries system name in CL program?

    Admin
    Admin
    Added an answer on October 9, 2024 at 8:15 pm

    To retrieve the iSeries system name, you can call a simple CL program and retrieve the value in the output parameter. Here is a sample CL program source code: PGM PARM(&SYSNAME) DCL VAR(&SYSNAME) TYPE(*CHAR) LEN(10) RTVNETA SYSNAME(&SYSNAME) ENDPGM Here is the explanation of the programRead more

    To retrieve the iSeries system name, you can call a simple CL program and retrieve the value in the output parameter.

    Here is a sample CL program source code:

    PGM PARM(&SYSNAME)
    DCL VAR(&SYSNAME) TYPE(*CHAR) LEN(10)
    RTVNETA SYSNAME(&SYSNAME)
    ENDPGM

    Here is the explanation of the program

    Line 1: Begin the CL program with parameters. Based on program logic, each parameter can be input or output, whether we supply a value to be used in a program or get back a value from the program. Here, SYSNAME is an output parameter, i.e., this program will return the iSeries system name.
    Line 2: Declare a variable & SYSNAME of type character and length 10.
    Line 3: Use the Retrieve network attributes (RTVNETA) command with the optional parameter SYSNAME to retrieve the system name of the iSeries in variable & SYSNAME. This will return the iSeries system name in variable & SYSNAME.
    Line 4: End of CL program.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  15. Asked: October 9, 2024In: Wordpress

    How to resolve Ads.txt Status Not Found error reported by Google adsense for the wordpress site?

    Admin
    Admin
    Added an answer on October 9, 2024 at 4:13 pm

    You can create an ads.txt file in your WordPress website root directory by following these steps. Go to your WordPress website Dashboard. Click on Plugins in the WordPress menu. Click the Add New Plugin button at the top of the Plugins page. Type Filester in the Search Plugins area at the top rightRead more

    You can create an ads.txt file in your WordPress website root directory by following these steps.

    1. Go to your WordPress website Dashboard.
    2. Click on Plugins in the WordPress menu.
    3. Click the Add New Plugin button at the top of the Plugins page.
    4. Type Filester in the Search Plugins area at the top right corner. This will search the plugin and bring in the results of File Manager Pro -Filester, an advanced File Manager and code editor.
    5. Click on the Install Now button on the filester plugin.
    6. Once the plugin is installed, click on the Activate button. Your filester plugin will get activated on your WordPress website, and a new menu option File Managerwill appear in your WordPress website dashboard menu.
    7. Click on the File Manager option on the menu. This will open the Filester plugin page, and in that, you will notice the public_html folder in the left menu as a main option under other folders like .private, wp-admin, wp-content, and wp-includes and on the right side, you will see these folders and other files like .htaccess, index.php, robots.txt, and others.
    8. Right-click on the right side, where all the folders and files appear, and a dialog will appear. Select, and a new continuous dialog will appear next to the first dialog box. Select TXT: Plain text. This will create a NewFile.txt in your root directory.
    9. Rename the NewFile.txt to ads.txt during its creation or right-click on the NewFile.txt and select the option Rename on the appearing dialog box.
    10. Once the file is renamed to ads.txt, Right-click on the ads.txt file and open the file in edit mode by selecting the option Edit File, and then TextArea editor, the ads.txt will be opened in edit mode.
    11. Now, you can copy the default ads.txt code mentioned in point 5 by visiting the Ads.txt Guide page.
    12. For your convenience, I am writing that code here as well. Here, pub-0000000000000000 is your publisher ID. google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
    13. Replace pub-0000000000000000 with your publisher ID, Therefore to find your publisher ID then go to your AdSense account. Click on the Account option on the left menu. The Account option will get expanded and you will see the Settings option under it, click on that, and the Setting option will further expand and you will see the Account Information option under it. Click on that option and the first thing you will see next to the menu options is your publisher-ID.
    14. Once the code is pasted to the ads.txt file. Click on Save. Now your ads.txt file is ready and the next time when Google bot crawls your website it will find the ads.txt file on your website and will change your ads.txt status.
    15. You can also verify the ads.txt presence on your website by just adding /ads.txt to your website URL on the browser and pressing enter. You will see the code that you added to the ads.txt file.https://mywebsitename.com/ads.txt
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  16. Asked: October 9, 2024In: IBM i

    How do we call qcmdexc api in rpg free format?

    Admin
    Admin
    Added an answer on October 9, 2024 at 3:45 pm

    QCMDEXC API is an IBM-supplied program that can run a single command. This API can be called from an HLL program like an RPG or CL program. It calls another program or command that needs to be passed in the first parameter of the qcmdexc API. Here, we show how we code qcmdexc in rpgle-free format. FRead more

    QCMDEXC API is an IBM-supplied program that can run a single command. This API can be called from an HLL program like an RPG or CL program. It calls another program or command that needs to be passed in the first parameter of the qcmdexc API. Here, we show how we code qcmdexc in rpgle-free format. First, you must declare the procedure prototype of qcmdexc API in your program to use this API.

    Declaring qcmdexc prototype in rpgle free format

    dcl-pr qcmdexc extpgm;  *n char(500) options(*varsize) const;
     *n packed(15:5) const;
    end-pr;

    qcmdexc API takes 2 input parameters first is the program call parameter of varying characters and the second is the length of the first parameter in packed decimal. Therefore, you must declare two variables in your program to hold the command and its length to be passed to the qcmdexc api. Declaring a standalone variable in rpgle free format.

    dcl-s command varchar(500);
    dcl-s length packed(15:5);

    Here, we declare a standalone variable varchar command and packed decimal length. Later in the program, we can evaluate some commands and calculate their length to be passed to qcmdexc api. Eval in rpgle free format.

    command = 'ADDLIBLE LIB(TESTLIB)';
    length  =  %len(%trimr(command));

    Here, we first evaluate the addlible command in the command variable and then pass the length of the command parameter by trimming the right side data and passing the actual length of the command to be executed. Now, we call qcmdexc api in rpgle free format.

    qcmdexc(command:length);
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  17. Asked: October 9, 2024In: IBM i

    What is qualified data structure in RPG AS400

    Admin
    Admin
    Added an answer on October 9, 2024 at 8:09 am

    The data structure can be qualified using the QUALIFIED keyword in rpgle. The term QUALIFIED indicates that data structure subfields are addressed with qualified notation. If the QUALIFIED keyword is provided for data structure userDS with a subfield userid, we can access a data structure subfield uRead more

    The data structure can be qualified using the QUALIFIED keyword in rpgle. The term QUALIFIED indicates that data structure subfields are addressed with qualified notation. If the QUALIFIED keyword is provided for data structure userDS with a subfield userid, we can access a data structure subfield using the data structure name followed by a period and the subfield name, i.e. userDS.userid.
    Syntax of qualified data structure in fixed format RPG.
    D userDS DS QUALIFIED
    D userid 10P 0
    D name 20A

    Syntax of qualified data structure in free format RPG (fully free RPG).
    **FREE
    dcl-ds userDS QUALIFIED;
    userid packed(10:0);
    name char(20);
    end-ds userDS;

    Sample RPG program in the fixed format using a qualified data structure

         D DS1             DS                  QUALIFIED                 
         D subfld1                       10                              
         D subfld2                        5                              
         D subfld3                        5                                                                                                              
                                                                         
         C                   EVAL      DS1.subfld1 = 'DS1_1'             
         C                   EVAL      DS1.subfld2 = 'DS1_2'             
         C                   EVAL      DS1.subfld3 = 'DS1_3'             
         C     DS1           DSPLY                                                                                       
         C                   SETON                   

    Sample RPG program in the free format using a qualified data structure

         D DS1             DS                  QUALIFIED      
         D subfld1                       10                   
         D subfld2                        5                   
         D subfld3                        5                                                                                 
          /Free                                               
           DS1.subfld1 = 'DS1_1';                             
           DS1.subfld2 = 'DS1_2';                             
           DS1.subfld3 = 'DS1_3';                             
           DSPLY DS1;                                                                 
           *INLR = *ON;                
          /End-Free              

    Sample RPG program in the fully free format using a qualified data structure

    **FREE                       
    dcl-ds ds1 qualified;        
     subfld1 char(10);           
     subfld2 char(5);            
     subfld3 char(5);            
    end-ds;                                          
                                 
    DS1.subfld1 = 'DS1_1';       
    DS1.subfld2 = 'DS1_2';       
    DS1.subfld3 = 'DS1_3';       
    DSPLY DS1;                    
    *INLR = *ON;               
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  18. Asked: October 9, 2024In: IBM i

    How to retrieve call stack information in RPG program?

    Admin
    Admin
    Added an answer on October 9, 2024 at 7:51 am

    We can retrieve call stack information using the retrieve call stack (QWVRCSTK) api. We use this retrieve call stack api whenever we want to find the calling program name. We use this api when we want to execute or skip some logic in the current program in the call stack based upon the calling progrRead more

    We can retrieve call stack information using the retrieve call stack (QWVRCSTK) api. We use this retrieve call stack api whenever we want to find the calling program name. We use this api when we want to execute or skip some logic in the current program in the call stack based upon the calling program means who called this program. The thread’s most recent call is indicated by the first call stack record that is returned. Here is the sample program that retrieves the call stack information and finds the calling program name.

        d psds           sds                                      
         d  curpgmname       *PROC                                 
         d  curjobname           244    253                        
         d  userid               254    263                        
         d  jobnumber            264    269                        
                                                                   
         d retrievecallstack...                                    
         d                 PR                  Extpgm('QWVRCSTK')  
         d recvar                     32767a                       
         d lenrecvar                     10I 0                     
         d fmtrcvvar                      8a   CONST               
         d jobidinfo                     56a                       
         d fmtjobidinfo                   8a   CONST               
         d errorcode                     15a                       
                                                                   
         d recvar          DS         32767                        
         d  BytesAvl                     10I 0                     
         d  BytesRtn                     10I 0                     
         d  Entries                      10I 0                     
         d  Offset                       10I 0                     
         d  EntryCount                   10I 0                     
                                                                   
         d jobidinfo       DS                                      
         d  JobName                      26a   Inz('*')            
         d  Jobid                        16a                       
         d  Reserved                      2a   Inz(*loval)         
         d  ThreadInd                    10I 0 Inz(1)              
         d  ThreadId                      8a   Inz(*loval)         
                                                                   
          *  Call Stack Program Names                              
         d Entry           DS           256                        
         d  EntryLen                     10I 0                     
         d  ReqstLvl                     10I 0 Overlay(Entry:21)   
         d  PgmName                      10a   Overlay(Entry:25)   
         d  PgmLib                       10a   Overlay(Entry:35)   
                                                                   
         d recvarlen       s             10I 0 Inz(%size(recvar))  
         d errorcode       s             15a                       
         d callerpgm       s             10a       
         d loop            s             10I 0     
          /free                                    
            retrievecallstack(recvar:              
                              recvarLen:           
                              'CSTK0100':          
                              jobidinfo:           
                              'JIDF0100':          
                              errorcode);          
                                                   
            For loop = 1 to EntryCount;            
               Entry = %subst(recvar:Offset + 1);  
               If (curPgmName  <> Pgmname);        
                  callerpgm = PgmName;             
                  leave;                           
               Endif;                              
               Offset = Offset + EntryLen;         
            Endfor;                                
                                                   
            dsply callerpgm;                       
                     
            return;  
          /end-free  

    Here, psds is declared to fetch the current job and program information. Jobname is passed as *, indicating the current job. You can change the following check If (curPgmName Pgmname); in the program to check the provided program’s call stack entry or the call stack entry preceding it, which is the caller of the supplied program. So we can change conditions like If (Pgmname = ‘TESTPGM’); which means you are checking for the specified program in the call stack entry.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  19. Asked: October 7, 2024In: SQL

    How to use declare global temporary table statement in RPGLE?

    Admin
    Admin
    Added an answer on October 7, 2024 at 11:32 am

    Declare global temporary table statement defines a temporary table for the current session. The temporary table when declared then it is created in the work file database and its description is not populated in the system catalog files. This global temporary table cannot be shared with other sessionRead more

    Declare global temporary table statement defines a temporary table for the current session. The temporary table when declared then it is created in the work file database and its description is not populated in the system catalog files. This global temporary table cannot be shared with other sessions. Once the session ends, the global temporary table is dropped.

    Sample fully free sqlrpgle program to declare global temporary table.

    **free                                          
    exec sql                                        
     drop table session.gtm1;                       
                                                    
    exec sql                                        
     declare global temporary table session.gtm1 as 
     (select * from pf1) with data;                 
    return;     

    Compiling and running this code will create a file GTM1 in the QTEMP library.
    select * from qtemp.gtm1

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  20. Asked: October 7, 2024In: IBM i

    How to convert timestamp to date in RPGLE?

    Admin
    Admin
    Added an answer on October 7, 2024 at 11:24 am

    You can use the %DATE built-in function (bif) that converts timestamp to date. The syntax of the %DATE bif is as follows: %DATE(expression:date-format) Here, %DATE bif has 2 optional parameters namely expression which can be character, numeric, or timestamp data, and date-format for character and nuRead more

    You can use the %DATE built-in function (bif) that converts timestamp to date.

    The syntax of the %DATE bif is as follows:

    %DATE(expression:date-format)

    Here, %DATE bif has 2 optional parameters namely expression which can be character, numeric, or timestamp data, and date-format for character and numeric input in expression.

    If the first parameter expression is not specified then it returns the current system date and if the second parameter date format is not specified for character and numeric expression then the default format of the date returned is *ISO.

    If the first parameter is a timestamp, *DATE, or UDATE then please do not specify the second parameter. The system already knows the input format in these cases.

    Here is the source code that makes use of %date bif to convert timestamp to date in the rpgle program.

         Dtimestamp1       s               Z                       
         Ddate1            s               D                       
          /free                                                    
           timestamp1 = %timestamp('2024-03-16-15.10.40.456465');  
           date1 = %date(timestamp1);   // 2024-03-16                                                                     
           date1 = %date(%timestamp('2024-03-16-15.10.40.456465')); // 2024-03-16                                            
           date1 = %date(%timestamp()); // 2024-09-02                                                                       
           timestamp1 = %timestamp();                              
           date1 = %date(timestamp1);  //2024-09-02                                                                                                                                    
           return;                                                 
          /end-free 

    Line 1: Declaring a timestamp variable timestamp1.
    Line 2: Declaring a date variable date1.
    Line 3 & 11: /free and /end-free block for rpg free code.
    Line 4: Converting the timestamp value in character to timestamp data using %timestamp() bif and evaluating in timestamp1 variable of type timestamp.
    Line 5: Passing the timestamp value held in variable timestamp1 as a parameter to the %date bif to convert the timestamp to the date and evaluating in date1 variable of type date. Therefore, the return date to date1 variable would be 2024-03-16.
    Line 6: Passing the timestamp value in character format to the %timestamp bif to first convert it to timestamp data type value and then passing that to %date bif to convert timestamp type value to date type value and evaluating in date1 variable of type date. Therefore, the return date to date1 variable would be 2024-03-16.
    Line 7: Passing the Current timestamp value using %timestamp() bif to %date bif to convert the current timestamp to date and evaluate in the date1 variable. Date1 variable would hold 2024-09-02 which is the current date.
    Line 8: Evaluating the current timestamp value using %timestamp() bif to timestamp1 variable of type timestamp.
    Line 9: Passing the timestamp value held in variable timestamp1 as a parameter to the %date bif to convert the timestamp to the date and evaluating in date1 variable of type date. Therefore, the return date to date1 variable would be 2024-09-02 which is the current date.
    Line 10: return from the program.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  21. Asked: October 6, 2024In: IBM i

    Why do we use OVERLAY keyword in data structure subfields in RPGLE?

    Admin
    Admin
    Added an answer on October 6, 2024 at 9:37 pm

    You can also allocate storage of subfields with Keywords DIM and OVERLAY. Here is an example. D DS D word 20A D letter 1A DIM(20) OVERLAY(word:1) /Free word = 'abcdefghijklmnopqrst'; return; /End-Free Explanation of the above source code: Line 1: Declared an unnamed DS. Line 2: Declared subfield worRead more

    You can also allocate storage of subfields with Keywords DIM and OVERLAY. Here is an example.

         D                 DS
         D word                          20A 
         D  letter                        1A   DIM(20) OVERLAY(word:1)
          /Free
           word = 'abcdefghijklmnopqrst';
           return;
          /End-Free  

    Explanation of the above source code:

    Line 1: Declared an unnamed DS.
    Line 2: Declared subfield word of length 2o characters.
    Line 3: Declared another subfield letter of length 1 character and used DIM(20) keyword to make it an array of 20 elements and also used OVERLAY keyword with parameter word to allocate storage of subfield word from start position 1.
    Line 4: Start of /Free block so I can write the code in free-form RPG.
    Line 5: Evaluate the DS subfield word as abcdefghijklmnopqrst.
    Line 6: return from the program.
    Line 7: End of /free block using /end-free block to specify the end of writing the RPG-free code.

    Final Outcome:
    Since ds subfield word = ‘abcdefghijklmnopqrst’ therefore, the subsequent subfield letter of length 1 and 20 array elements are overlaid on the word subfield and it would contain:

    > Eval letter
      letter(1) = 'a'
      letter(2) = 'b'
      letter(3) = 'c'
      letter(4) = 'd'
      letter(5) = 'e'
      letter(6) = 'f'
      letter(7) = 'g'
      letter(8) = 'h'
      letter(9) = 'i'
      letter(10) = 'j'
      letter(11) = 'k'
      letter(12) = 'l'
      letter(13) = 'm'
      letter(14) = 'n'
      letter(15) = 'o'
      letter(16) = 'p'
      letter(17) = 'q'
      letter(18) = 'r'
      letter(19) = 's'
      letter(20) = 't'
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  22. Asked: October 6, 2024In: IBM i

    What are the available data types in RPGLE program. Please list them out.

    Admin
    Admin
    Added an answer on October 6, 2024 at 9:24 pm

    Data types are used to store different types of data. There are various internal data types supported by rpgle. Mapping RPGLE internal data types in fixed form RPG: Data Type Category Data Type Description Example Syntax in Fixed form RPG Character A Character or Alphanumeric d var1            S    Read more

    Data types are used to store different types of data. There are various internal data types supported by rpgle.
    Mapping RPGLE internal data types in fixed form RPG:

    Data Type Category Data Type Description Example Syntax in Fixed form RPG
    Character A Character or Alphanumeric d var1            S             10A   inz(‘test’)
    Character N Indicator d var1            S               N   inz(*OFF)
    Character G Graphic – double-byte characters d var1            S             10G   ccsid(65535) inz(‘TEST’)
    Character C UCS-2 – double-byte characters – ccsid 13488(UCS-2) or 1200 (*UTF16) d var1            S             10C   ccsid(1200) inz(‘TEST’)
    Character A Using VARYING keyword d var1            S             10A   inz(‘test’) varying
    Character G Using VARYING keyword d var1            S             10G   ccsid(65535) inz(‘TEST’) varying
    Character C Using VARYING keyword d var1            S             10C   ccsid(1200) inz(‘TEST’) varying
    Numeric B Binary Decimal d var1            S              9B 2 inz(10)
    Numeric F Float d var1            S              8F   inz(10)
    Numeric I Integer d var1            S              5I 0 inz(10)
    Numeric P Packed decimal d var1            S              3P 1 inz(10)
    Numeric U Unsigned d var1            S              5U 0 inz(10)
    Numeric S Zoned decimal d var1            S              3S 1 inz(10)
    Date D Date d var1            S               D   DATFMT(*ISO)
    Time T Time d var1            S               T   TIMFMT(*ISO)
    Timestamp Z Timestamp d var1            S               Z
    Object O Java object D var1            S               O   CLASS(*JAVA:’java.lang.String’)
    Basing pointer * Pointer D ptr             S               *   inz(*NULL)
    Procedure pointer * Procedure pointer D ptr             S               *   PROCPTR inz(*NULL)
    SQL Type Character large objects – can be defined in SQLRPGLE source member only – can store up to 2GB data i.e. Large text documents. D var1            S                   SQLTYPE(CLOB:500)
    SQL Type Double byte Character large objects – can be defined in SQLRPGLE source member only – can store DBCS data documents. D var1            S                   SQLTYPE(DBCLOB:500)
    SQL Type Binary large objects – can be defined in SQLRPGLE source member only – used to store audio, video, and image files. D var1            S                   SQLTYPE(BLOB:500)

    Mapping RPGLE internal data types in fully free RPG:

    Data Type Category In Fully free RPG Description Example Syntax in Fully Form RPG
    Character Char Character or Alphanumeric DCL-S var1 CHAR(10) INZ(‘TEST’);
    Character Ind Indicator DCL-S var1 ind INZ(‘0’);
    Character Graph Graphic – double-byte characters DCL-S var1 GRAPH(10) INZ(‘TEST’);
    Character UCS2 UCS-2 – double-byte characters – ccsid 13488(UCS-2) or 1200 (*UTF16) DCL-S var1 UCS2(10) INZ(‘TEST’);
    Character Varchar Using VARYING keyword DCL-S var1 VARCHAR(10) INZ(‘TEST’);
    Character Vargraph Using VARYING keyword DCL-S var1 VARGRAPH(10) INZ(‘TEST’) CCSID(65535);
    Character UCS2 Using VARYING keyword DCL-S var1 VARUCS2(10) INZ(‘TEST’) CCSID(1200);
    Numeric BINDEC Binary Decimal DCL-S VAR1 BINDEC(9:2) inz(10);
    Numeric FLOAT Float DCL-S VAR1 FLOAT(8) inz(10);
    Numeric INT Integer DCL-S VAR1 INT(5) inz(10);
    Numeric PACKED Packed decimal DCL-S VAR1 PACKED(3:1) inz(10);
    Numeric UNS Unsigned DCL-S VAR1 UNS(5) inz(10);
    Numeric ZONED Zoned decimal DCL-S VAR1 ZONED(3:1) inz(10);
    Date Date Date DCL-S VAR1 DATE(*ISO);
    Time Time Time DCL-S VAR1 TIME(*ISO);
    Timestamp Timestamp Timestamp DCL-S VAR1 TIMESTAMP;
    Object Object Java object DCL-S var1 OBJECT(*JAVA : ‘java.lang.String’);
    Basing pointer Pointer Pointer DCL-S ptr POINTER inz(*NULL);
    Procedure pointer Pointer(*PROC) Procedure pointer DCL-S ptr POINTER(*PROC) inz(*NULL);
    SQL Type Character large objects – can be defined in SQLRPGLE source member only – can store up to 2GB data i.e. Large text documents. DCL-S var1 sqltype(CLOB:500)
    SQL Type Double byte Character large objects – can be defined in SQLRPGLE source member only – can store DBCS data documents. DCL-S var1 sqltype(DBCLOB:500)
    SQL Type Binary large objects – can be defined in SQLRPGLE source member only – used to store audio, video, and image files. DCL-S var1 sqltype(BLOB:500)
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  23. Asked: October 6, 2024In: IBM i

    Why do we use Z-ADD opcode in RPGLE

    Admin
    Admin
    Added an answer on October 6, 2024 at 9:08 pm

    In Z-ADD, Factor 2 is added to a field of zeros. The result field contains the total. There is no use of Factor 1. Factor 2 and the result field must be in the numeric range and may include an array, an array element, a field, a named constant, a literal, a figurative constant, a subfield, or a tablRead more

    In Z-ADD, Factor 2 is added to a field of zeros. The result field contains the total. There is no use of Factor 1. Factor 2 and the result field must be in the numeric range and may include an array, an array element, a field, a named constant, a literal, a figurative constant, a subfield, or a table name. Sample code using Z-ADD in rpgle.

         Dnumber           S              9P 0 inz(54)
         Dresult           S              9P 0                
         C                   Z-ADD(H)  number        result   
          * the result becomes 54
         C     result        dsply                            
         C                   return        
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  24. Asked: October 6, 2024In: IBM i

    Why do we use operation extender Half adjust with z-add opcode in rpgle?

    Admin
    Admin
    Added an answer on October 6, 2024 at 9:04 pm

    Z-Add(H) is nothing but its Z-ADD with operation extender H added to Z-ADD which makes the result half-adjusted i.e. It rounds up the results. Factor 2 is added to a field of zeros. The result field contains the total. There is no use of Factor 1. Factor 2 and the result field must be in the numericRead more

    Z-Add(H) is nothing but its Z-ADD with operation extender H added to Z-ADD which makes the result half-adjusted i.e. It rounds up the results. Factor 2 is added to a field of zeros. The result field contains the total. There is no use of Factor 1. Factor 2 and the result field must be in the numeric range and may include an array, an array element, a field, a named constant, a literal, a figurative constant, a subfield, or a table name. Sample code using Z-ADD(H) in rpgle.

         Dnumber           S              9P 6 inz(110.456789)
         Dresult           S              8P 5                
         C                   Z-ADD(H)  number        result   
          * the result becomes 110.45679
         C     result        dsply                            
         C                   return    

    Due to the presence of operation extended (H) with Z-ADD the result field gets rounded up. The result field would contain 110.4579 which is the rounded result of 110.456789 since the result field is (8P,5) which is lesser than the number field (9P,6).

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  25. Asked: October 6, 2024In: IBM i

    Why do we use %xlate in RPG program?

    Admin
    Admin
    Added an answer on October 6, 2024 at 8:59 pm

    We can use %xlate in RPGLE to translate values according to from, to, and start positions. Therefore, we can either translate from lower to upper case or from upper case to lower case. The first parameter of %xlate contains characters to be replaced, the second parameter contains their replacement vRead more

    We can use %xlate in RPGLE to translate values according to from, to, and start positions. Therefore, we can either translate from lower to upper case or from upper case to lower case.

    The first parameter of %xlate contains characters to be replaced, the second parameter contains their replacement values, the third parameter is the string to be translated, and the fourth parameter is the starting position for the translation and is optional to pass. The default value is 1 for the fourth parameter if it is not passed, the fifth parameter is again optional and here we can pass values either *NATURAL or *STDCHARSIZE.
    %XLATE(from: to: string : startpos : *NATURAL | *STDCHARSIZE)

    If the first parameter is longer than the second, any extra characters in the first parameter are ignored. The first three parameters can be of type character, graphic, or UCS-2 and all first three parameters must have the same type.

    Translate from lower to upper case using %xlate in RPGLE:

         D lower           c                   'abcdefghijklmnopqrstuvwxyz' 
         D upper           c                   'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 
         Dstring           s             20A   INZ('hello world')           
          /Free                                                             
               string  = %xlate(lower:upper:string);  
               // string becomes HELLO WORLD'                      
               dsply string;     
               *INLR  = *ON; 
          /End-Free                             

    Translate from upper to lower case using %xlate in RPGLE:

         D lower           c                   'abcdefghijklmnopqrstuvwxyz' 
         D upper           c                   'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 
         Dstring           s             20A   INZ('HELLO WORLD')           
          /Free                                                             
               string  = %xlate(upper:lower:string); 
               // string becomes 'hello world'                       
               dsply string;                                                
               *INLR  = *ON;      
          /End-Free               
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  26. Asked: October 6, 2024In: Wordpress

    How do I disallow specific page from robots.txt

    Admin
    Admin
    Added an answer on October 6, 2024 at 8:53 pm

    You can edit your robots.txt file in WordPress by following the below steps: Install the FileSter plugin. Once the FileSter plugin is installed and the File Manager option is created in the WordPress dashboard menu. Click on it to open the FileSter plugin. This will show you the root folder files liRead more

    You can edit your robots.txt file in WordPress by following the below steps:

    1. Install the FileSter plugin.
    2. Once the FileSter plugin is installed and the File Manager option is created in the WordPress dashboard menu. Click on it to open the FileSter plugin.
    3. This will show you the root folder files like .Htaccess, robots.txt, etc.
    4. Double-click the robots.txt file and open it with textarea.
    5. Now edit the robots.txt file and add the following code to the robots.txt file and save it:[Disallow: /?s=*]
      User-agent: *
      Disallow:/wp-admin/
      Disallow:/wp-includes/
      Disallow: /*?show
      Disallow: /*search?search
      Disallow: /?s=*
    6. Now, visit the Google Search console pages section, go to the soft 404 error, and start validation again. This time this page will be ignored.

    Hi, You can also refer to Google’s robot.txt file at any time to understand how this file works.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  27. Asked: October 6, 2024In: SEO

    Missing field 'name' (in 'mainEntity.suggestedAnswer.author') in google search console for Q&A pages

    Admin
    Admin
    Added an answer on October 6, 2024 at 8:41 pm

    Tried checking the schema here, When a product/something has a Missing field ‘name ‘ error, there’s no “author” for the review, hence the missing “name” field. I think you could add an author or a name of that specific profile (based on the screenshot attached – the name is blank).  You can also cheRead more

    Tried checking the schema here, When a product/something has a Missing field ‘name ‘ error, there’s no “author” for the review, hence the missing “name” field. I think you could add an author or a name of that specific profile (based on the screenshot attached – the name is blank). 

    You can also check any forums regarding that. 

    Missing Field “name”
    So, please check if you’ve added the Name of your business and organization image at the settings available at WordPress dashboard > SEO > Settings – > General – > Site Basics. You can read more about it here: Website name, alternate website name, and alternate organization name.

    Furthermore, kindly please clear the cache from caching plugins, the server, and a CDN like Cloudflare (if you are using any). If you are not sure how to clear the cache from a plugin, please contact the plugin author.

    If you’d like to clear the cache from the server, please speak to your host provider. After that, kindly check any product page via the Google Rich Results testing tool https://search.google.com/test/rich-results.

    I did assign a name to the user as “Unknown” from the WordPress backend and the schema was correctly generated.

    Unknown
    The issue is now passed in the Google search console.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  28. Asked: October 6, 2024In: SEO

    how can i do seo using Yoast Premium for Q&A website

    Admin
    Admin
    Added an answer on October 6, 2024 at 8:34 pm

    This was the discussion between me and the support. Support Can you please let us know more details about your setup? Are you using any LMS like LearnDash? Are you using a custom post type for such a setup? Admin Let me brief my question would the Yoast plugin be enabled for comments on the post orRead more

    This was the discussion between me and the support.

    Support
    Can you please let us know more details about your setup? Are you using any LMS like LearnDash? Are you using a custom post type for such a setup?
    Admin
    Let me brief my question would the Yoast plugin be enabled for comments on the post or Q&A website?

    Support
    It seems the issue is with the plugin that creates the Questions and Answers. The questions are created as publicly accessible custom post types, which is why you have a Yoast SEO meta box for them.
    However, the associated answers are not custom post types or taxonomies but treated as regular WordPress comments. As such, you cannot get the Yoast SEO meta box for the comments. Also, there’s no need for the meta box under comments because there’s no SEO value added to optimizing comments.
    Admin
    Yes, you are right. Then how would I do SEO for the questions post for questions only the Yoast SEO is visible and based upon a question that would be hardly any text of line or a paragraph sometimes or mostly the title only. For this Yoast SEO always be red for me as I won’t be able to do SEO for the questions and answers (treated as comments) post.
    Also, sometimes the question can be asked by other users directly on the website, not from the backend of WordPress. Any idea?

    Support
    How would I do SEO for the questions post for questions only the Yoast SEO is visible?
    Your question is unclear. Doesn’t the Yoast SEO meta box show under the Questions post type anymore?
    Admin
    That’s visible. But let’s treat question and answer both as a single page where for questions Yoast meta box is visible but for answers are treated as comments on questions so for them Yoast meta box is unavailable.
    Now the question here is, if I do SEO for a post then, I can optimize my post using Yoast meta box as it tells me all the issues with SEO. However, the same is not with questions and answers posts, where one user posts questions on the website from the website UI and other several users answer that question. Now if I open that question(post) in the WordPress backend and I see that question asked by one of the users assume the question only contains the worst “How can I draw a cat” and nothing else and its answer is supposed to present in the form of comments on the same question.
    The Yoast meta box indicators show me huge issues with SEO since my question post only contains the question “How can I draw a cat” and not its answers(comments from other users). How do I do SEO in this case as I cannot write content in the original question asked by some users that might be of 1 line to n number of lines?

    Support
    You cannot optimize a single line of text like your question.

    Please note that Google wants more text so that people can understand your website better.

    Search engines are not very good at understanding single-line questions and answers. It would help if you wrote more text to make it more understandable.

    If your content is only a single-line question and people will answer it, then SEO does not apply to your page.

    We suggest optimizing your other pages, like your About page, instead. You don’t need to optimize every single page you have.

    There are several free courses, including the WordPress for Beginners course, SEO for beginners, Yoast SEO for WordPress, and All-around SEO, available so that you can watch the videos and learn from them quickly.

    And of course, our beginner’s guide to Yoast SEO
    You can check out the video for how to set up the Yoast SEO plugin -WordPress SEO for beginners.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  29. Asked: October 6, 2024In: SEO

    Missing field 'mainEntity' error in Google Search Console for QA page schema

    Admin
    Admin
    Added an answer on October 6, 2024 at 8:19 pm
    This answer was edited.

    This was the discussion between me and the support to resolve this issue. Support: You will get the  Missing field “mainEntity” error if you set a page as an FAQ page and you don’t use the Yoast SEO FAQ block. So, you need to use the Yoast FAQ block on that particular page. This guide explains moreRead more

    This was the discussion between me and the support to resolve this issue.

    Support:

    You will get the  Missing field “mainEntity” error if you set a page as an FAQ page and you don’t use the Yoast SEO FAQ block. So, you need to use the Yoast FAQ block on that particular page. This guide explains more on how you can use the Yoast SEO FAQ block: https://yoast.com/how-to-build-an-faq-page/#how.

    Admin:
    No, I did not set FAQ. I set it as a QA page. This is the Yoast setting at my end.

    Support:
    If you set the page to be a QA page, there needs to be a Yoast FAQ block on the page to fill the schema. Not having this will result in an incomplete/invalid Schema graph. Please refer to: https://yoast.com/how-to-build-an-faq-page/
    Just adding the FAQ block with your questions and answers would make the plugin output the correct information too.

    Admin:
    My website is a Question and Answer based website where one can ask questions on the website itself and anyone can answer and any number of answers are allowed. There is no option there to use the FAQ block on UI. If I go to WordPress and try to write the blog at the back end, then I can select FAQ block only. I hope you are getting what I am trying to say.
    You will see that no backend is involved in this Question and Answers (treated as comments). I need to set it as a QA page only.

    Also, If you look at my website you will observe that the WordPress backend is not involved anymore since users can ask questions on the website UI using the Ask a Question button and Answers will be given there by multiple users located at different places. So, I am not writing a blog at my backend on WordPress. Questions and Answers are governed by the website user interface.

    Since each page contains one question and multiple answers (a type of discussion) on the question on each page.

    Please understand that I want to set this as the QA Page that corresponds to web pages that contain data in a question-and-answer format, which is one question followed by answers.
    Please suggest how to resolve this issue as I intentionally set the pages as QA pages and I got this issue. If I was putting questions from the WordPress backend then I was able to use your FAQ block. Also, I am not using FAQ page type instead using QA page type.

    Support:
    Let me explain this this way: the QA schema will only show its complete schema pieces if the FAQ block is used. Since this isn’t the case, the QA schema will be incomplete, thus triggering the main entity error. That said, you can select the webpage schema instead to avoid further errors. If you need to change the schema behavior, you can customize the plugin’s schema output. You can use the Schema API that allows developers to customize the Schema output of each of our plugins. Please refer to our Schema API documentation here: https://developer.yoast.com/features/schema/api/.

    Admin:
    Ok. I will check the API, but I cannot switch back to Webpage schema as earlier by default it was set as webpage scheme and there was no such error. But my website is based on Q&A where everything happens on UI whether it’s asking questions or answering them.

    I have used the discy theme. They also used the QA page as schema type.
    See I cannot use the FAQ block as that is only available when I create a new page from WordPress and then I can use your toast FAQ block. This is not the case at my end.
    Now Discy whose theme I purchased used the same QAPage schema and they seem to have the correct schema on their (view-source:https://2code.info/demo/themes/Discy/Main/question/is-this-statement-i-see-him-last-night-can-be-understood-as-i-saw-him-last-night/) page and the one which is outputted by Yoast plugin at my end showing error
    However, I can see the “mainEntity” field missing in my schema and instead, see the “mainEntityOfPage” field.
    Please don’t recommend me to switch back to Webpage schema as I will never do that. I have to be on the QA page schema type only. Please help me with the detailed steps to resolve it on my website.

    What is the difference between the FAQ page and the QA page?
    FAQ page is where we have multiple questions and multiple answers in a block, then that is fine i should use your FAQ block for this type of page I will create by myself at the back end means from WordPress create page option.
    However, the QA page is a page where we have one question and multiple answers that’s what my page is. From UI, one can ask questions and once the question is submitted, a page is created and there is no point in using the Yoast FAQ block here from website UI. Now anyone can answer, or reply from the UI itself any number of times.
    Since, I have set the schema page as a QA page not as a FAQ page, your Yoast plugin should be able to add the field “MainEntity” on my page without making any check for the Yoast FAQ block used or not.
    The Yoast plugin did not populate the “MainEntity” field on my page and that caused the parsing error in the Google search console please try to understand that this is a critical error on my website.
    In case any new page added to the website when anyone asks a question on the website then this happens to those pages as well which will be going to be created on my domain.
    Now once the Google bot crawls again it may throw the same critical error for all my pages on the website. Please help to resolve it.

    Support:
    Looking at the page, I can confirm that your theme natively supports the QAPage schema. For the schema from your theme to work correctly, I recommend that you first change the schema type in the Yoast Metabox to WebPage. After updating this schema, your page will show the QAPage schema without any warning. With the Yoast schema, you will be getting 2 QAPage schemas. It shows the duplicate QAPage schema. You only need 1 schema so should you use the WebPage schema so you won’t be getting any warning regarding the QAPage schema.

    Admin:
    Thanks for the clarification. I have set up the page type schema as Webpage as Discy theme by default support QA page schema. After that, the Missing field ‘mainEntity’ error is passed in the Google search console. Missing field ‘mainEntity’ validation passed in the Google search console after setting up the webpage type schema in the Yoast premium plugin.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  30. Asked: October 6, 2024In: SQL

    How to call sql stored procedure in cl program?

    Admin
    Admin
    Added an answer on October 6, 2024 at 7:52 pm

    We can call SQL stored procedure from within the CL program using the QZDFMDB2 program which is the datalink file manager DB2 CLP program present in the QSYS library. pgm dcl var(&cmd) type(*char) len(200) dcl var(&in1) type(*char) len(20) value('test') dcl var(&in2) type(*char) len(1) vRead more

    We can call SQL stored procedure from within the CL program using the QZDFMDB2 program which is the datalink file manager DB2 CLP program present in the QSYS library.

    pgm                                                     
    dcl        var(&cmd) type(*char) len(200)               
    dcl        var(&in1) type(*char) len(20) value('test') 
    dcl        var(&in2) type(*char) len(1)  value('F')                                                                                                                               
                   
    CHGVAR     VAR(&CMD) VALUE('CALL +                      
                 testlib.STORED33B(''' *CAT &IN1 *TCAT +  
                 ''' , ''' *CAT &IN2 *TCAT ''')')                  
    call       pgm(qzdfmdb2) parm((&cmd))   
                      
    return                                                   
    endpgm  

    We need to build the command string which is the SQL stored procedure CALL statement with the required parameter. Later we pass that command string to the program qzdfmdb2 which executes SQL interactively from within the CL program.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  31. Asked: October 6, 2024In: SQL

    SQL0469 on calling a SQL procedure containing an INOUT parameter

    Admin
    Admin
    Added an answer on October 6, 2024 at 7:46 pm

    When we call a SQL stored procedure using a constant value instead of a parameter marker (?) sqlcode -469 is returned. You can call a SQL stored procedure by passing a parameter marker in an INOUT parameter like this. call testlib.STORED33A('name1','M','?') However, you cannot even call using a paraRead more

    When we call a SQL stored procedure using a constant value instead of a parameter marker (?) sqlcode -469 is returned.

    You can call a SQL stored procedure by passing a parameter marker in an INOUT parameter like this.

    call testlib.STORED33A('name1','M','?')

    However, you cannot even call using a parameters marker in the STRSQL session on an IBM i machine as the Use of parameter marker, NULL, or UNKNOWN is not valid.

    However, You can call it by passing any value to the OUT or INOUT parameter from the Run SQL script like
    call testlib.STORED33A('name1','M',NULL);
    call testlib.STORED33A('name1','M',' ');
    call testlib.STORED33A('name1','M',5);
    call testlib.STORED33A('name1','M',?);

    You will get the return output.

    [ 26/08/2024, 01:11:27 am ]  Run Selected...
    call testlib.STORED33A('name1','M',NULL)
    Return Code = 0
    Output Parameter #3 (SUCCESS) = 1
    Statement ran successfully   (339 ms)
    
    [ 26/08/2024, 01:14:45 am ]  Run Selected...
    call testlib.STORED33A('name1','M',' ')
    Return Code = 0
    Output Parameter #3 (SUCCESS) = 1
    Statement ran successfully   (294 ms)
    
    [ 26/08/2024, 01:16:55 am ]  Run Selected...
    call testlib.STORED33A('name1','M',5)
    Return Code = 0
    Output Parameter #3 (SUCCESS) = 1
    Statement ran successfully   (295 ms)
    
    [ 26/08/2024, 01:30:05 am ]  Run Selected...
    call testlib.STORED33A('name1','M',?)
    Return Code = 0
    Output Parameter #3 (SUCCESS) = 1
    Statement ran successfully   (293 ms)

    No such issue will occur when you call the SQL stored procedure from the Run SQL Script. This issue will only occur in the STRSQL session. Therefore, to call it from the STRSQL session you first have to create a SQL global variable using CREATE VARIABLE statement like below.

    create variable testlib.sqlout char(1) default ' '

    The variableSQLOUT was created in testlib. It’s an *SRVPGM object type of attribute CLE.

    Now again try to call the SQL stored procedure from the STRSQL session on IBM i but this time passed the SQL global variable for the OUT or INOUT parameter in the procedure as below.

    call testlib.STORED33A('name1','M',testlib.sqlout)

    CALL statement complete. SQL7985 which means Call to procedure STORED33A completed successfully.

    You can check the return value in the SQL global variable as follows:

    select testlib.sqlout from sysibm.sysdummy1

    the output return value in SQL global variable from SQL stored procedure call.

    SQLOUT 
    1 
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  32. Asked: October 6, 2024In: SQL

    What are the equivalent SQL data types to ile rpg data types?

    Admin
    Admin
    Added an answer on October 6, 2024 at 7:28 pm
    This answer was edited.

    ILE RPG data types mapped to SQL data types: ILE RPG data type Description SQL data type DS Data structure Char Zoned(digits:decimal places) Zoned data Numeric(digits, decimal places) Packed(digits:decimal places) Packed data Decimal(digits, decimal places) Bindec(digits) 2-byte binary with 0 decimaRead more

    ILE RPG data types mapped to SQL data types:

    ILE RPG data type Description SQL data type
    DS Data structure Char
    Zoned(digits:decimal places) Zoned data Numeric(digits, decimal places)
    Packed(digits:decimal places) Packed data Decimal(digits, decimal places)
    Bindec(digits) 2-byte binary with 0 decimal places smallint
    2-byte binary with 0 decimal places 4-byte binary with 0 decimal places Integer
    Int(5) 2-byte integer smallint
    Int(10) 4-byte integer Integer
    Int(20) 8-byte integer Bigint
    Float(4) Short float Float(single precision)
    Float(8) Long float Float(double precision)
    Char(length) Character Char(length)
    Varchar(length) Character varying length Varchar(length)
    Graph(length) Graphic Graphic(length)
    Vargraph(length) Varying graphic Vargraphic(length)
    Ucs2(length) UCS-2 Graphic(length) with ccsid 13488 or ccsid 1200
    Varucs2(length) UCS-2 VarGraphic(length) with ccsid 13488 or ccsid 1200
    Date or Date(format-separator) Date Date Datfmt(format) Datsep(separator)
    Time or Time(format-separator) Time Time Timfmt(format) Timsep(separator)
    Timestamp Timestamp Timestamp
    DS Data structure Char
    CLOB is not supported in RPG. SQLTYPE keyword is used to declare CLOB in the RPG program CLOB
    DBCLOB is not supported in RPG. SQLTYPE keyword is used to declare DBCLOB in the RPG program DBCLOB
    BLOB is not supported in RPG. SQLTYPE keyword is used to declare BLOB in the RPG program BLOB
    BINARY is not supported in RPG. SQLTYPE keyword is used to declare BINARY in the RPG program BINARY
    VARBINARY is not supported in RPG. SQLTYPE keyword is used to declare VARBINARY in the RPG program VARBINARY
    XML is not supported in RPG. SQLTYPE keyword is used to declare XML in the RPG program XML
    ROWID is not supported in RPG. SQLTYPE keyword is used to declare ROWID in the RPG program ROWID
    Result Set Locator is not supported in RPG. SQLTYPE keyword is used to declare the Result Set Locator in the RPG program Result Set Locator
    DATALINK is not supported in RPG. DATALINK
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  33. Asked: October 6, 2024In: IBM i

    Can VARCHAR sub-fields be used with DS OVERLAY?

    Admin
    Admin
    Added an answer on October 6, 2024 at 7:18 pm

    We should avoid overlay varchar subfields over other varchar subfields.

    We should avoid overlay varchar subfields over other varchar subfields.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  34. Asked: October 6, 2024In: IBM i

    Date, Time or Timestamp value is not valid (C G D F)

    Admin
    Admin
    Added an answer on October 6, 2024 at 7:08 pm

    In this case, you are passing the timestamp value in character format to the %date built-in function which is incorrect. Try converting the timestamp value in character format to timestamp type and then pass it to the %date bif as a parameter that will work. This is the correct RPGLE source code conRead more

    In this case, you are passing the timestamp value in character format to the %date built-in function which is incorrect. Try converting the timestamp value in character format to timestamp type and then pass it to the %date bif as a parameter that will work.

    This is the correct RPGLE source code converting timestamp to date and now you won’t encounter the error Date, Time or Timestamp value is not valid (C G D F).

          Ddate1            s               D 
           /free                              
            date1 = %date(%timestamp('2024-03-16-15.10.40.456465'));  
            return;
           /end-free 

    Line 3: Converting the ‘2024-03-16-15.10.40.456465' timestamp value in character type to timestamp type by using %timestamp bif i.e. %timestamp(‘2024-03-16-15.10.40.456465') and then pass this value to the %date bif as %date(%timestamp(‘2024-03-16-15.10.40.456465')). This will return the date as ‘2024-03-16’ out of the timestamp value in the date1 variable.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  35. Asked: October 6, 2024In: IBM i

    RPGLE program compile severity 30 error *RNF7416. How to resolve it?

    Admin
    Admin
    Added an answer on October 6, 2024 at 7:00 pm

    In this case, you are trying to evaluate a timestamp value in character format into a timestamp variable at line 3 timestamp1 = '2024-03-16-15.10.40.456465'; in your RPG program which is incorrect and you, therefore, are getting the error severity 30 error *RNF7416 during the compilation of your RPGRead more

    In this case, you are trying to evaluate a timestamp value in character format into a timestamp variable at line 3 timestamp1 = '2024-03-16-15.10.40.456465'; in your RPG program which is incorrect and you, therefore, are getting the error severity 30 error *RNF7416 during the compilation of your RPG program in the program compile listing.

    Try to convert the character value to timestamp value using %timestamp built-in function timestamp1 = %timestamp('2024-03-16-15.10.40.456465'); and then evaluate to a timestamp variable.

    The following code will resolve the issue *RNF7416 error during program compilation.

         Dtimestamp1       s               Z                                           
          /free                                                   
           timestamp1 = %timestamp('2024-03-16-15.10.40.456465');                                          
           return;                                                
          /end-free                              
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  36. Asked: October 6, 2024In: IBM i

    How to increase logging level of a job?

    Admin
    Admin
    Added an answer on October 6, 2024 at 6:52 pm

    You can increase the logging level of a job by doing the change job. Just follow these steps to change the job and then you can log the maximum amount of information in the job log specific to the running job. Type the following command and press F4. CHGJOB LOG(4 00 *SECLVL) LOGCLPGM(*YES) In the abRead more

    You can increase the logging level of a job by doing the change job. Just follow these steps to change the job and then you can log the maximum amount of information in the job log specific to the running job.

    1. Type the following command and press F4.
      CHGJOB LOG(4 00 *SECLVL) LOGCLPGM(*YES)
      In the above Change job (CHGJOB) command, the LOG parameter is known as the message logging parameter where you specify the message logging values which is then used to determine the amount and type of information sent to the job log by this job.
      The parameter has three elements: the message or logging level, the message severity, and the level of message text.
      element 1: the possible logging levels are 0-4.
      element 2: the possible value for message logging severity is (0-99).
      element 3: the possible values for message text are *MSG, *SECLVL, and *NOLIST.In the above command, we set the level as 4, Severity as 00, and Text as *SECLVL. Also, the LOGCLPGM parameter is set to *YES to log the CL program commands.
    2. Press Enter to change your job.
    3. If you are trying to change any other specific job running in batch mode or any other user job then you may also need to input Job details such as Job name, Job number, and Job user to this command and then press Enter.
      CHGJOB JOB(number/jobuser/jobname) LOG(4 00 *SECLVL) LOGCLPGM(*YES)
      Note: The above command will ensure that the maximum amount of information gets logged in the specific user job log.
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  37. Asked: October 6, 2024In: SQL

    How to check for locks on a file or table using SQL?

    Admin
    Admin
    Added an answer on October 6, 2024 at 6:43 pm

    You can check for locks on a file/table using the system catalog view QSYS2.OBJ_LOCK. It can also be called as OBJECT_LOCK_INFO. You can embed the SQL query below in your sqlrpgle program and check for locks on a file/table. select count(*) from qsys2.object_lock_info where system_object_schema = 'TRead more

    You can check for locks on a file/table using the system catalog view QSYS2.OBJ_LOCK. It can also be called as OBJECT_LOCK_INFO. You can embed the SQL query below in your sqlrpgle program and check for locks on a file/table.

    select count(*) from qsys2.object_lock_info 
    where 
    system_object_schema = 'TESTLIB'
    and system_object_name = 'TABLE1' 
    and object_type = '*FILE' 
    and lock_state = '*EXCL'

    In the above SQL query, we are checking locks for files/tables Table1 in the library TESTLIB the important check here is the LOCK_STATE column. Since, when we run the program, it opens all the files and you might get shared locks which is fine for us we need to check for exclusive locks only what has been checked in the above SQL query. You can write the above SQL query in your RPG program like this:

         DlockCnt          S             10i 0 inz
          /free  
           Exec Sql
           select count(*) into :lockCnt from qsys2.object_lock_info 
           where 
           system_object_schema = 'TESTLIB' 
           and system_object_name = 'TABLE1' 
           and object_type = '*FILE' 
           and lock_state = '*EXCL';
    
           If lockCnt > 0;
             // Lock present on file/table
             // Code to handle for Lock situation
             dsply('Lock present on file'); 
             return; 
           endif;
           return;
          /end-free

    To test this code, you can put a lock on the file/table using the ALCOBJ command in one of your IBM i sessions and then you need to run this code on the same file from another session.
    ALCOBJ OBJ((TESTLIB/TABLE1 *FILE *EXCL))

    Later, after your testing, you can remove the exclusive on that same file using the DLCOBJ command.
    DLCOBJ OBJ((TESTLIB/TABLE1 *FILE *EXCL))

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  38. Asked: October 6, 2024In: IBM i

    How to check if a PTF is applied on an IBM I machine?

    Admin
    Admin
    Added an answer on October 6, 2024 at 6:36 pm

    You can check if a PTF is applied on an IBM i machine. There are various ways to check it. There is a GO PTF command that you can use to work with the PTF-related things. You need to type it on the command line and press Enter. You can check for specific PTF using option 5 display Program temporaryRead more

    You can check if a PTF is applied on an IBM i machine. There are various ways to check it.

    1. There is a GO PTF command that you can use to work with the PTF-related things. You need to type it on the command line and press Enter. You can check for specific PTF using option 5 display Program temporary fixes (PTF) information. Option 5 triggers the DSPPTF command and displays the command screen where you have to provide more details to be able to find information about the PTF.
    2. If you have a PTF number available with you then you can use this SQL query to check if PTF is applied on your IBM i machine or not.
      Select ptf_identifier, ptf_loaded_status 
      from qsys2/ptf_info 
      where ptf_identifier = 'SI71091'

      If the above query does not return any row then that means PTF is not applied. If it returns a row then we need to check for loaded status if the loaded status is PERMANENTLY APPLIED then PTF is applied on your IBM i machine and if the loaded status is SUPERSEDED then as per the IBM page that means A later PTF existed on the system, but it may not be applied. If this PTF has been superseded, display the PTF details to determine the PTF number that supersedes this PTF, and then display the PTF to determine its status. You can get the latest superseding PTF details by also selecting the column PTF_SUPERSEDED_BY_PTF from QSYS2/PTF_INFO and then you need to check Loaded Status of PTF for this superseding PTF to confirm if the PTF is applied on your IBM i machine.

      Select ptf_identifier, ptf_loaded_status,
      ptf_superseded_by_ptf 
      from qsys2/ptf_info 
      where ptf_identifier = 'SI71091'
    3. You can also use api QPZRTVFX to retrieve the PTF information. However, this api returns PTF loaded status in the form of numbers ranging from 0 to 6 instead to text because statuses are translatable text instead of special values.
      0: the PTF has never been loaded.
      1: the PTF has been loaded.
      2: the PTF has been applied.
      3: the PTF has been applied permanently.
      4: the PTF has been permanently removed.
      5: the PTF is damaged. An error occurred while applying the PTF. It needs to be reloaded and applied.
      6: the PTF is superseded, meaning another PTF with more recent changes has been loaded on the system. The ptf id that has been loaded can be found in the superseded by ptf id field.
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  39. Asked: October 6, 2024In: SQL

    how to replace hex values in a file field using SQL?

    Admin
    Admin
    Added an answer on October 6, 2024 at 6:25 pm

    You can use this SQL to replace the carriage return and line feed characters (X’0D25′) with spaces (X’4040′). update libname/filename set fieldname = replace(fieldname, X'0D25', X'4040') where fieldname like '%' concat X'0D25' concat '%' Note: Please take a backup of your file before running the updRead more

    You can use this SQL to replace the carriage return and line feed characters (X’0D25′) with spaces (X’4040′).

    update libname/filename
    set fieldname = replace(fieldname, X'0D25', X'4040')
    where fieldname like '%' concat X'0D25' concat '%'

    Note: Please take a backup of your file before running the update to verify your results and in case any issue occurs you may then be able to restore your original file data.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  40. Asked: October 6, 2024In: IBM i

    How to create an IFS file with a specific ccsid?

    Admin
    Admin
    Added an answer on October 6, 2024 at 6:21 pm

    There are two ways to create a file on the ifs with a specific ccsid. One way is to use the c api open() to create and open the ifs file with a specific ccsid.Syntax of open() api in RPG: D open PR 10I 0 extproc('open') D ifspath * value options(*string) *ifs path D oflag 10I 0 value *string of 32 bRead more

    There are two ways to create a file on the ifs with a specific ccsid.

    1. One way is to use the c api open() to create and open the ifs file with a specific ccsid.Syntax of open() api in RPG:
           D open            PR            10I 0 extproc('open')                                            
           D ifspath                         *   value options(*string)               *ifs path             
           D oflag                         10I 0 value                                *string of 32 bits    
           D mode                          10U 0 value options(*nopass)               * 9 bits              
           D codepage                      10U 0 value options(*nopass)               *      

      Here, in the codepage parameter, you need to specify the ccsid for the ifs file and there you can pass 1208.

    2. Another way is to use the command line in a Qshell.On IBM i green screen type QSH and press Enter to open the QSH Command Entry screen and use the following command:

      touch -C 1208 /ifspath/filename.txt

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  41. Asked: October 6, 2024In: IBM i

    how to zip IFS folder from the green screen?

    Admin
    Admin
    Added an answer on October 6, 2024 at 6:16 pm

    You can run this command from the command line on IBM i green screen to zip your IFS folder. strqsh cmd('jar cfM /home/admin/workfiles.zip /home/admin/workfiles/*') This will create a zip file named workfiles.zip in the /home/admin/ folder that contains everything inside /home/admin/workfiles/.

    You can run this command from the command line on IBM i green screen to zip your IFS folder.
    strqsh cmd('jar cfM /home/admin/workfiles.zip /home/admin/workfiles/*')

    This will create a zip file named workfiles.zip in the /home/admin/ folder that contains everything inside /home/admin/workfiles/.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  42. Asked: October 6, 2024In: IBM i

    how can i find the ip address of my IBM i?

    Admin
    Admin
    Added an answer on October 6, 2024 at 6:14 pm

    You can determine your IP address in the following ways: Since you know the domain name you can PING your IBM I machine from your PC. To do this go to Start -> Run then enter CMD and press Enter. Type PING followed by your domain name in the command prompt. For Example: ping pub400.com. You can aRead more

    You can determine your IP address in the following ways:

    1. Since you know the domain name you can PING your IBM I machine from your PC. To do this go to Start -> Run then enter CMD and press Enter. Type PING followed by your domain name in the command prompt. For Example: ping pub400.com.
    2. You can also check on your IBM i using the CFGTCP command and taking option 1.
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  43. Asked: October 6, 2024In: IBM i

    how can i copy a CSV file into an IBM i physical file?

    Admin
    Admin
    Added an answer on October 6, 2024 at 6:10 pm

    We copy a CSV file into a physical file or table on the IBM i using the CPYFRMIMPF command. CPYFRMIMPF FROMSTMF('/ifsfolder/filename.csv') TOFILE(libname/filename) RCDDLM(*CR) Note: The physical file/table must exist before copying the CSV file to it. Also, the table or file structure should match tRead more

    We copy a CSV file into a physical file or table on the IBM i using the CPYFRMIMPF command.
    CPYFRMIMPF FROMSTMF('/ifsfolder/filename.csv') TOFILE(libname/filename)
    RCDDLM(*CR)

    Note: The physical file/table must exist before copying the CSV file to it. Also, the table or file structure should match the fields in your CSV file which you would receive in the IFS folder.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  44. Asked: October 6, 2024In: IBM i

    how can i change IFS object ownership from a command line?

    Admin
    Admin
    Added an answer on October 6, 2024 at 6:01 pm

    You can change the ownership of an IFS object using the command CHGOWN. The CHGOWN command will allow you to change the owner of IFS objects. For the CHGOWN command, the parameters are as follows: OBJ: object path(include object type and ASP name is eligible) NEWOWN: User profile of new owner name RRead more

    You can change the ownership of an IFS object using the command CHGOWN. The CHGOWN command will allow you to change the owner of IFS objects.

    For the CHGOWN command, the parameters are as follows:

    OBJ: object path(include object type and ASP name is eligible)
    NEWOWN: User profile of new owner name
    RVKOLDAUT: Similar to CUROWNAUT
    SUBTREE: It applies to directories
    SYMLNK: It applies to symbolic IFS links

    QSYS/CHGOWN OBJ(FullyQualifiedpathofIFSobject)
    NEWOWN(NewOwnerUserProfileName)
    RVLOLDAUT(*NO) SUBTREE(*NONE) SYMLNK(*NO)

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  45. Asked: October 6, 2024In: IBM i

    How to restrict users to limited number of sessions?

    Admin
    Admin
    Added an answer on October 6, 2024 at 5:51 pm

    We can set the maximum number of sessions a user can open at a time by the limit device sessions (QLMTDEVSSN) system value. The default value is 0 which means do not limit the sessions If you set 1-9, the user is limited to the specified number of device sessions. From the IBM i green screen commandRead more

    We can set the maximum number of sessions a user can open at a time by the limit device sessions (QLMTDEVSSN) system value.

    The default value is 0 which means do not limit the sessions
    If you set 1-9, the user is limited to the specified number of device sessions.

    From the IBM i green screen command line, you can type the following IBM i command and press Enter.
    WRKSYSVAL SYSVAL(QLMTDEVSSN)
    Take option 2 to change.

    Note: QLMTDEVSSN is a global setting and if you want to limit a specific user to open a specified number of sessions only then set the LMTDEVSSN value for a specific user profile. For Example, Type the below command on the IBM i green screen and press Enter.
    WRKUSRPRF USRPRF(user-profile)
    Take option 2 to change.

    You can set the following values for the LMTDEVSSN parameter of the WRKUSRPRF command :

    *SYSVAL: The QLMTDEVSSN system value is used.
    *NO: The user may be signed on to more than one device session at the same time.
    *YES: The user may not be signed on to more than one device session at the same time.
    0: The user is not limited to a specific number of device sessions. Same as *NO.
    1: The user is limited to a single device session. Same as *YES.
    2-9: The user is limited to the specified number of device sessions.

    Please also note that You must be  security officer or a security administrator to add, change, copy, or remove users. Otherwise, you are not authorized to make a change request. Once, the limit is set for the specific user then the following message will be shown to the user if the user has reached the maximum number of sessions: CPF1220 User XYZ has reached the device session limit.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  46. Asked: October 6, 2024In: SQL

    Can i download the results as a file using the run sql script option on the ACS software?

    Admin
    Admin
    Added an answer on October 6, 2024 at 4:16 pm

    the Save Results… option is by default disabled and you cannot download those results to an Excel spreadsheet by default because it only loads some rows at a time and you may have to press PAGE DOWN until you get all the data. This is a tedious task. You will see a message like 100 rows retrieved (mRead more

    the Save Results… option is by default disabled and you cannot download those results to an Excel spreadsheet by default because it only loads some rows at a time and you may have to press PAGE DOWN until you get all the data. This is a tedious task. You will see a message like 100 rows retrieved (more data available) on the bottom left corner of the Run SQL Script screen. You can enable the Save Results… option in a few steps that allow you to download the SQL result in an Excel spreadsheet using ACS Run SQL Script.

    1. Enable the Save Results… option that appears on Right-click on the SQL Result area which allows you to download data to Excel spreadsheets. For this, go to the Edit section in the top left corner click on that and that starts showing further options under the Edit section. Now click on the Preferences option under the Edit section. This will open the Preferences screen. Under the General Tab and below the New Connections heading check the Enable Saving of results option checkbox and click on Apply and OK.
    2. It will prompt a dialog saying Preferences Saved. The settings for the current connection differ from those specified for new connections. Do you want to apply these settings on the current connection? Click on Yes.
    3. Close the Run SQL script window and open it again. Run the SQL query again. That SQL query only fetched some rows of the table and more data is available to be loaded. So, please click on the little box in the bottom right corner of the Run SQL Script window to retrieve all rows.
    4. Since you have reopened the Run SQL Script and also ran the SQL query you will now see a download option named Save Results… is enabled under the Right click menu on the results area.
    5. Click on the Save Results… download option and download these SQL results as an Excel spreadsheet.
      Note: You can download results in other file formats as well such as .txt, .csv, .ods, .dsr, and tab-delimited text format.
    6. Once you click OK, the Excel spreadsheet file is downloaded/saved to the specified location, and an Inquiry message dialog box appears mentioning file has been saved successfully Would you like to open it. Click Yes to open the downloaded Excel spreadsheet file from the ACS Run SQL Script utility.
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  47. Asked: October 6, 2024In: IBM i

    How can i FTP to an iASP on my IBM i?

    Admin
    Admin
    Added an answer on October 6, 2024 at 3:58 pm
    This answer was edited.

    Here are all the possible ways you can do the FTP to an IASP instead of *SYSBAS on your IBM i machine. FTP from a Non-IASP machine to the IASP device on an IBM i machine using the PUT command: Please follow the following steps. On the Non-IASP machine command line, type FTP systemname and press EnteRead more

    Here are all the possible ways you can do the FTP to an IASP instead of *SYSBAS on your IBM i machine.
    FTP from a Non-IASP machine to the IASP device on an IBM i machine using the PUT command:

    Please follow the following steps.
    On the Non-IASP machine command line, type FTP systemname and press Enter.
    Here, systemname is the name of the IASP machine. Now use the following FTP commands to FTP from a non-asp machine to an IASP on an IBM i machine using the PUT command.

    Using namefmt 1:

    UserId  -- Userid of the IASP machine --
    Password  -- password of the IASP machine --
    --Once logged on to the IASP machine--
    bin
    namefmt 1
    quote rcmd setaspgrp aspgrp(IASP1) -- replace IASP1 with your asp device--
    put /qsys.lib/libnameOnNonAspMachine.lib/SavefileNameOnNonAspMachine.savf
      /qsys.lib/libnameOnAspDevice.lib/SavefileName.savf

    Using namefmt 0:
    Create a save file in the respective library on the IASP device first, then try the below FTP commands.

    UserId  -- Userid of the IASP machine --
    Password  -- password of the IASP machine --
    --Once logged on to the IASP machine--
    bin
    namefmt 0
    quote rcmd setaspgrp aspgrp(IASP1) -- replace IASP1 with your asp device--
    cd /qsys.lib/libnameonaspdevice.lib
    put libnameOnNonAspMachine/SavefileNameOnNonAspMachine.savf
      SavefileName.savf (replace

    FTP from a Non-IASP machine to the IASP device on an IBM i machine using GET command:
    Please follow the following steps.

    On the IASP machine command line, First type SETASPGRP ASPGRP(IASP1) and press Enter. — (Replace IASP1 with your ASP device). Second, type FTP systemname and press Enter.
    Here, systemname is the name of the Non-IASP machine. Now use the following FTP commands to FTP from a non-asp machine to an IASP on an IBM i machine using GET command.

    Using namefmt 1:

    UserId  -- Userid of the IASP machine --
    Password  -- password of the IASP machine --
    --Once logged on to the IASP machine--
    bin
    namefmt 1
    get /qsys.lib/libnameOnNonAspMachine.lib/SavefileNameOnNonAspMachine.savf
      /qsys.lib/libnameOnAspDevice.lib/SavefileName.savf (replace

    Using namefmt 0:
    Create a save file in the respective library on the IASP device first then try the below FTP commands.

    UserId  -- Userid of the IASP machine --
    Password  -- password of the IASP machine --
    --Once logged on to the IASP machine--
    bin
    namefmt 0
    cd /qsys.lib/libnameonNonaspMachine.lib
    get SavefileNameOnNonAspMachine.savf libnameonAspdevice/SavefileName.savf 
         (replace         
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  48. Asked: October 6, 2024In: IBM i

    How can i find programs compiled using debug turned on?

    Admin
    Admin
    Added an answer on October 6, 2024 at 3:17 pm

    You can run the DSPPGM command on a program to get the debug info. This will vary and depend upon the program type such as: For OPM programs with CLP and RPG program attributes: debug info is not available Observable information.......................*UNOBS debug info is available Observable informaRead more

    You can run the DSPPGM command on a program to get the debug info. This will vary and depend upon the program type such as:

    For OPM programs with CLP and RPG program attributes:

    debug info is not available
    Observable information.......................*UNOBS

    debug info is available
    Observable information.......................*ALL

    For ILE programs with CLLE and RPGLE attributes:

    You can check it under the DETAIL *MODULE

    Debug Information is not available
    Creation optimization debug
    Module library attribute date level data
    PGM1 TESTLIB RPGLE 09/12/24 *NONE *NO

    Debug Information is available
    Creation optimization debug
    Module library attribute date level data
    PGM1 TESTLIB RPGLE 09/12/24 *NONE *YES

    Also, when you run the STRDBG command on a program if that program has debug info, then source code gets displayed for that program otherwise, nothing will be displayed.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  49. Asked: October 6, 2024In: IBM i

    How to transfer save file from desktop to an IBM i system?

    Admin
    Admin
    Added an answer on October 6, 2024 at 3:11 pm

    You can follow the below FTP steps to upload or transfer the save file from the desktop to the IBM i library: Open a command prompt window. Change to the directory where the save file is located for example cd desktop. Type the FTP systemname or FTP IP address where SYSTEMNAME or IP address is of thRead more

    You can follow the below FTP steps to upload or transfer the save file from the desktop to the IBM i library:

    • Open a command prompt window.
    • Change to the directory where the save file is located for example cd desktop.
    • Type the FTP systemname or FTP IP address where SYSTEMNAME or IP address is of the IBM i system.
    • Type the User ID and password.
    • Type BIN to change the binary mode and press the Enter key.
    • To change the host and client naming convention to 1 type the QUOTE SITE NAMEFMT 1 and press the Enter key.
    • Type PUT savefileNameOndesktop.savf /qsys.lib/libname.lib/savefilename.savf and press the Enter key to start transferring the save file from the desktop to the IBM i library.
    cd desktop
    ftp systemname
    userid
    password
    bin
    quote site namefmt 1
    put savefileNameOndesktop.savf /qsys.lib/libname.lib/savefilename.savf
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  50. Asked: October 6, 2024In: SQL

    How can i derive the week from a YYYYMMDD formatted date?

    Admin
    Admin
    Added an answer on October 6, 2024 at 3:03 pm

    We can extract the week from a YYYYMMDD formatted date using the week() function and substr() function. Please use the below SQL query to achieve this. select week(substr(char(datefield),1,4) concat '-' concat substr(char(datefield),5,2) concat '-' concat substr(char(datefield),7,2)) as weeknumber fRead more

    We can extract the week from a YYYYMMDD formatted date using the week() function and substr() function. Please use the below SQL query to achieve this.

    select week(substr(char(datefield),1,4) concat '-' concat
                substr(char(datefield),5,2) concat '-' concat
                substr(char(datefield),7,2)) as weeknumber
    from libraryname/filename

    or you can simply run the SQL query to test one of the values using a dummy table.

    select week(substr(char(20240909),1,4) concat '-' concat
                substr(char(20240909),5,2) concat '-' concat
                substr(char(20240909),7,2)) as weeknumber
    from sysibm.sysdummy1

    The output week is 37.

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
1 2 3

Sidebar

Statistics

  • Questions 143
  • Answers 177
  • Comments 0
  • Popular
  • Answers
  • Admin

    Why do we use OVERLAY keyword in data structure subfields ...

    • 12 Answers
  • Admin

    How to call sql stored procedure with output parameter from ...

    • 6 Answers
  • Admin

    How to use declare global temporary table statement in RPGLE?

    • 5 Answers
  • Admin
    Admin added an answer CPF4131 is a record format level check error. This indicates… October 18, 2024 at 1:58 am
  • Admin
    Admin added an answer To open the command prompt with administrator rights you can… October 17, 2024 at 12:27 am
  • Admin
    Admin added an answer In AS400, "AS" stands for Application system. This article discusses… October 13, 2024 at 12:49 pm

Trending Tags

.htaccess (1) as400 (123) bing-webmaster (2) control-language (12) db2 (33) ftp (8) google-adsense (1) google-search-console (3) https-redirect (1) iasp (4) ifs (22) jar (4) operations (3) php-my-admin (1) qshell (3) robots.txt (4) rpg (26) stored-procedure (3) stroed procedure (1) triggers (1) yoast (4)

Explore

  • Home
  • Categories
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags

Footer

BrainChime

BrainChime is a blog that posts question-and-answer-based format articles on diverse topics and engages in discussions by allowing people to provide answers/comments without the need to register and log in.

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • FAQs
  • Categories
  • Tags

© 2024 BrainChime. All Rights Reserved
by BrainChime.