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.
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
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.
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.
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.
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:
Externally described data structure
Multiple occurrence data structure
Data area data structure
Qualified data structure
File information data structure
Indicator data structure
Program status data structure
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.
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.
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.
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
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)
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.
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.
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.
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
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:
Create a SQL variable using the CREATE VARIABLE statement from STRSQL.
create or replace variable out char(1) default ' '
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.
Compile the SQL stored procedure using the RUNSQLSTM command.
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
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.
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.
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.
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 right corner. This will search the plugin and bring in the results of File Manager Pro -Filester, an advanced File Manager and code editor.
Click on the Install Now button on the filester plugin.
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.
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.
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.
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.
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.
Now, you can copy the default ads.txt code mentioned in point 5 by visiting the Ads.txt Guide page.
For your convenience, I am writing that code here as well. Here, pub-0000000000000000 is your publisher ID. google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
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.
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.
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
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.
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.
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.
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.
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
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.
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
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.
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:
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.
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
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).
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
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:
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 like .Htaccess, robots.txt, etc.
Double-click the robots.txt file and open it with textarea.
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=*
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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
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.
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.
Press Enter to change your job.
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.
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))
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.
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.
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'
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.
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.
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.
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.
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:
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/.
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:
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 also check on your IBM i using the CFGTCP command and taking option 1.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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
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
What is SEU in AS400 and why do we use it?
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.
What is the multi-format logical file in AS400?
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
DDS source for PF2
Let’s write the DDS source for multi-format logical files using PF1 and PF2 with record formats RFMT1 and RFMT2.
what is PR and PI in rpgle?
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 lesswhat is message queue in as400 and why do we use it?
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:
Important points to consider:
What is data area in AS400 and why do we use it. What are its different types?
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 theCRTDTAARA
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,Points to remember:
We can use the following commands w.r.t the data area object.
RTVDTAARA DTAARA(TESTLIB/DTAARA1 *ALL)
RTNVAR(&VAR1)
CHGDTAARA DTAARA(TESTLIB/DTAARA1 *ALL)
VALUE('NEXTVALUE')
DSPDTAARA DTAARA(libname/DTAARA1)
to view the value stored in a data area object.DLTDTAARA DTAARA(libname/DTAARA1)
to delete the data area object in a specified library from the IBM I machine.what is data structure and what are the different types of DS in RPG program?
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: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.
How to create csv file in as400?
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:
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.
Run command CPYTOIMPF from the command line to copy data from the file and stream the file in ifs.
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.
Take option 5 to display CSV file 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 lesswhy do we use EXTPGM keyword in RPG program?
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 theEXTPGM
keyword, then the call will be an external program call that uses an external program object specified by theEXTPGM
keyword. The call becomes a dynamic external call if the prototype contains the termEXTPGM
keyword; otherwise, it is a bound procedure call.Example of using EXTPGM keyword:
D PGM1 PR EXTPGM('PGM1')
Defining EXTPGM keyword in RPGfully free format:
DCL-PR PGM1 EXTPGM;
END-PR;
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;
what is spool file and how to check spool files in AS400?
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
See lessspool 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 fileQPJOBLOG
. 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 onspecific users
,jobs
, etc. If you want to check the spool files generated by the current user, then run the following command.WRKSPLF SELECT(*CURRENT)
how to check job log in as400?
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
See lessjob log
in as400, please write theDSPJOBLOG
command on the command line and press Enter. After that Display Job log screen displays on the screen, PressF10
and thenSHIFT + 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 theDSPJOBLOG
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 sameDSPJOBLOG
command, and a job log spool file will be made available and can be accessed through the commandWRKSPLF
.how to submit a batch job in as400?
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
), theCL command or request data
, and therouting data
. Also, use theCMD option
onSBMJOB
toexecute a single CL command in a batch job
. It also performssyntax checkin
g and permitsprompting
. 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) namedTESTJOBD
in the libraryTESTLIB
would provide the majority of the job’s properties.TESTOUTQ
would also be used as theoutput queue
(OUTQ) andTESTMSGQ
as themessage queue
(MSGQ) for the batch job namedUSERJOB
. 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.
See lessSBMJOB CMD(CALL PGM(PGM1))
JOB(USERJOB)
JOBD(TESTLIB/TESTJOBD)
JOBQ(QBATCH)
OUTQ(TESTOUTQ)
MSGQ(TESTMSGQ)
How to resolve page with redirect error in Google Search Console instead of correct .htaccess file
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 ishttps://example.com
, is indexed or not.If your target page is indexed, then you can ignore this
redirect error
in theGoogle search console
, i.e. your audience will always see the targethttps
version of the page.Type the below command in Google search and press Enter to confirm whether your target page is indexed or not.
See lesssite:https://example.com
How to call sql stored procedure with output parameter from within a cl program?
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
theSQL stored procedure with output parameter
within aCL program
usingQZDFMDB2
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 areturn parameter
in the form of a command string to programQZDFMDB2
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 parameterSQL stored procedure
in my CL program. Let me show you the code and steps that I followed to achieve this:SQL variable
using theCREATE VARIABLE
statement from STRSQL.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 orSET
statement.RUNSQLSTM
command.CREATE VIEW
statement.Please, note that in
step 1
we created aSQL variable
namedOUT
in theTESTLIB
library so that we can later create a viewRTNVAL
inqtemp
library using that atstep 4
. For your knowledge as we have declared the viewrtnval
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
intestlib
with a default blank value by passing the create or replace variable statement to theQZDFMDB2
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 theSQL variable
instead of any CL program variable. Then we pass it to theQZDFMDB2
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 usingQZDFMDB2
. 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 theRCVF
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 parameterHow to retrieve iSeries system name in CL program?
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:
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,
See lessSYSNAME
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 parameterSYSNAME
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.
How to resolve Ads.txt Status Not Found error reported by Google adsense for the wordpress site?
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.
Dashboard
.Plugins
in the WordPress menu.Add New Plugin
button at the top of the Plugins page.Filester
in the Search Plugins area at the top right corner. This will search the plugin and bring in the results ofFile Manager Pro -Filester, an advanced File Manager and code editor
.Install Now
button on thefilester
plugin.Activate
button. Yourfilester
plugin will get activated on your WordPress website, and a new menu optionFile Manager
will appear in your WordPress website dashboard menu.File Manager option
on the menu. This will open theFilester
plugin page, and in that, you will notice thepublic_html folder
in the left menu as a main option under other folders like.private
,wp-admin
,wp-content
, andwp-includes
and on the right side, you will see these folders and other files like.htaccess
,index.php
,robots.txt
, and others.TXT: Plain text
. This will create aNewFile.txt
in your root directory.NewFile.txt
toads.txt
during its creation or right-click on theNewFile.txt
and select the option Rename on the appearing dialog box.ads.txt
, Right-click on theads.txt
file and open the file in edit mode by selecting the option Edit File, and thenTextArea editor
, theads.txt
will be opened in edit mode.ads.txt
code mentioned in point 5 by visiting the Ads.txt Guide page.pub-0000000000000000
is yourpublisher ID
.google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0
pub-0000000000000000
with yourpublisher ID
, Therefore to find yourpublisher ID
then go to yourAdSense account
. Click on theAccount option
on the left menu. The Account option will get expanded and you will see theSettings option
under it, click on that, and the Setting option will further expand and you will see theAccount Information option
under it. Click on that option and the first thing you will see next to the menu options is yourpublisher-ID
.ads.txt
file. Click onSave
. Now yourads.txt
file is ready and the next time when Google bot crawls your website it will find theads.txt
file on your website and will change yourads.txt
status.ads.txt
presence on your website by just adding/ads.txt
to yourwebsite URL
on thebrowser
and pressing enter. You will see the code that you added to theads.txt
file.https://mywebsitename.com/ads.txt
How do we call qcmdexc api in rpg free format?
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 theqcmdexc
API. Here, we show how we codeqcmdexc
in rpgle-free format. First, you must declare the procedure prototype ofqcmdexc
API in your program to use this API.Declaring qcmdexc prototype in rpgle free format
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 theqcmdexc
api. Declaring a standalone variable in rpgle free format.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.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 callqcmdexc
api in rpgle free format.What is qualified data structure in RPG AS400
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 termQUALIFIED
indicates that data structure subfields are addressed with qualified notation. If theQUALIFIED
keyword is provided for data structureuserDS
with a subfielduserid
, 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
Sample RPG program in the free format using a qualified data structure
Sample RPG program in the fully free format using a qualified data structure
How to retrieve call stack information in RPG program?
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.Here,
See lesspsds
is declared to fetch the current job and program information. Jobname is passed as*
, indicating the current job. You can change the following checkIf (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 likeIf (Pgmname = ‘TESTPGM’);
which means you are checking for the specified program in the call stack entry.How to use declare global temporary table statement in RPGLE?
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.
Compiling and running this code will create a file GTM1 in the QTEMP library.
See lessselect * from qtemp.gtm1
How to convert timestamp to date in RPGLE?
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
, orUDATE
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.Line 1: Declaring a timestamp variable
See lesstimestamp1
.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 intimestamp1
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 be2024-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 be2024-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 thedate1
variable.Date1
variable would hold2024-09-02
which is the current date.Line 8: Evaluating the current timestamp value using
%timestamp()
bif totimestamp1
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 indate1
variable of type date. Therefore, the return date to date1 variable would be2024-09-02
which is the current date.Line 10: return from the program.
Why do we use OVERLAY keyword in data structure subfields in RPGLE?
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
andOVERLAY
. Here is an example.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 usedDIM(20)
keyword to make it an array of 20 elements and also usedOVERLAY
keyword with parameterword
to allocate storage of subfieldword
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
asabcdefghijklmnopqrst
.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 subfieldletter
of length 1 and 20 array elements are overlaid on theword
subfield and it would contain:What are the available data types in RPGLE program. Please list them out.
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:
Mapping RPGLE internal data types in fully free RPG:
Why do we use Z-ADD opcode in RPGLE
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 usingZ-ADD
in rpgle.Why do we use operation extender Half adjust with z-add opcode in rpgle?
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 itsZ-ADD
withoperation 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.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 lessWhy do we use %xlate in RPG program?
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:
Translate from upper to lower case using %xlate in RPGLE:
How do I disallow specific page from robots.txt
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 inWordPress
by following the below steps:FileSter
plugin..Htaccess
,robots.txt
, etc.robots.txt
file and open it withtextarea
.robots.txt
file and add the following code to therobots.txt
file and save it:[Disallow: /?s=*]
User-agent: *
Disallow:/wp-admin/
Disallow:/wp-includes/
Disallow: /*?show
Disallow: /*search?search
Disallow: /?s=*
soft 404
error, andstart 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 lessMissing field 'name' (in 'mainEntity.suggestedAnswer.author') in google search console for Q&A pages
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.
See lessUnknown
The issue is now passed in the Google search console.
how can i do seo using Yoast Premium for Q&A website
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
See lessYou can check out the video for how to set up the Yoast SEO plugin -WordPress SEO for beginners.
Missing field 'mainEntity' error in Google Search Console for QA page schema
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:
See lessThanks 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 ispassed
in theGoogle search console
.Missing field ‘mainEntity’
validation passed in the Google search console after setting up the webpage type schema in the Yoast premium plugin.How to call sql stored procedure in cl program?
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 thedatalink file manager DB2 CLP program
present in theQSYS
library.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
See lessqzdfmdb2
which executes SQL interactively from within the CL program.SQL0469 on calling a SQL procedure containing an INOUT parameter
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
aSQL stored procedure
using aconstant value
instead of aparameter marker
(?)sqlcode -469
is returned.You can
call
aSQL stored procedure
by passing aparameter marker
in anINOUT 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 theUse of parameter marker, NULL, or UNKNOWN is not valid
.However, You can call it by passing any value to the
OUT
orINOUT parameter
from theRun SQL script
likecall 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.
No such issue will occur when you call the
SQL stored procedure
from theRun SQL Script
. This issue will only occur in theSTRSQL
session. Therefore, to call it from theSTRSQL
session you first have to create aSQL global variable
usingCREATE VARIABLE
statement like below.The variableSQLOUT
was created intestlib
. It’s an*SRVPGM
object type of attributeCLE
.Now again try to call the
SQL stored procedure
from theSTRSQL
session on IBM i but this time passed theSQL global variable
for theOUT or INOUT parameter
in the procedure as below.CALL statement complete.
SQL7985
which means Call to procedureSTORED33A
completed successfully
.You can check the return value in the SQL global variable as follows:
the output return value in SQL global variable from SQL stored procedure call.
What are the equivalent SQL data types to ile rpg data types?
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:
Can VARCHAR sub-fields be used with DS OVERLAY?
We should avoid overlay varchar subfields over other varchar subfields.
We should avoid
See lessoverlay varchar subfields
over othervarchar subfields
.Date, Time or Timestamp value is not valid (C G D F)
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)
.Line 3: Converting the
See less‘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 thedate1
variable.RPGLE program compile severity 30 error *RNF7416. How to resolve it?
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 errorseverity 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 functiontimestamp1 = %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.How to increase logging level of a job?
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.
CHGJOB LOG(4 00 *SECLVL) LOGCLPGM(*YES)
In the above Change job (
CHGJOB
) command, theLOG parameter
is known as themessage 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
: themessage or logging level
, themessage severity
, and thelevel of message text
.element 1
: the possible logging levels are0-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 thelevel as 4
,Severity as 00
, andText as *SECLVL
. Also, theLOGCLPGM
parameter is set to*YES
to log the CL program commands.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.
How to check for locks on a file or table using SQL?
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.In the above SQL query, we are checking locks for files/tables
Table1
in the libraryTESTLIB
the important check here is theLOCK_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 forexclusive locks
only what has been checked in the above SQL query. You can write the above SQL query in your RPG program like this: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
See lessDLCOBJ
command.DLCOBJ OBJ((TESTLIB/TABLE1 *FILE *EXCL))
How to check if a PTF is applied on an IBM I machine?
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.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 usingoption 5
display Program temporary fixes (PTF) information. Option 5 triggers theDSPPTF
command and displays the command screen where you have to provide more details to be able to find information about the PTF.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.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 isPERMANENTLY APPLIED
thenPTF is applied
on your IBM i machine and if the loaded status isSUPERSEDED
then as per the IBM page that meansA 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 columnPTF_SUPERSEDED_BY_PTF
fromQSYS2/PTF_INFO
and then you need to checkLoaded Status
of PTF for this superseding PTF to confirm if the PTF is applied on your IBM i machine.QPZRTVFX
to retrieve the PTF information. However, this api returnsPTF loaded status
in the form of numbers ranging from0 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. Theptf id
that has been loaded can be found in the superseded byptf id
field.how to replace hex values in a file field using SQL?
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
andline feed
characters (X’0D25′
) with spaces (X’4040′
).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 lessHow to create an IFS file with a specific ccsid?
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.
open()
to create and open the ifs file with a specific ccsid.Syntax of open() api in RPG:Here, in the codepage parameter, you need to specify the ccsid for the ifs file and there you can pass 1208.
QSH
and press Enter to open theQSH Command Entry screen
and use the following command:touch -C 1208 /ifspath/filename.txt
how to zip IFS folder from the green screen?
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
See lessworkfiles.zip
in the/home/admin/
folder that contains everything inside/home/admin/workfiles/
.how can i find the ip address of my IBM i?
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:PING
your IBM I machine from your PC. To do this go toStart -> Run
thenenter CMD
andpress Enter
. Type PING followed by your domain name in the command prompt. For Example:ping pub400.com
.CFGTCP
command and takingoption 1
.how can i copy a CSV file into an IBM i physical file?
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 aphysical file
or table on the IBM i using theCPYFRMIMPF
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 lesshow can i change IFS object ownership from a command line?
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
. TheCHGOWN
command will allow you to change the owner of IFS objects.For the
CHGOWN
command, theparameters
are as follows:OBJ
: object path(include object type and ASP name is eligible)NEWOWN
: User profile of new owner nameRVKOLDAUT
: Similar to CUROWNAUTSUBTREE
: It applies to directoriesSYMLNK
: It applies to symbolic IFS links
See lessQSYS/CHGOWN OBJ(FullyQualifiedpathofIFSobject)
NEWOWN(NewOwnerUserProfileName)
RVLOLDAUT(*NO) SUBTREE(*NONE) SYMLNK(*NO)
How to restrict users to limited number of sessions?
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 sessionsIf 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 theLMTDEVSSN
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
: TheQLMTDEVSSN
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
See lesssecurity officer
or asecurity 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
.Can i download the results as a file using the run sql script option on the ACS software?
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 isby 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 pressPAGE DOWN
until you get all the data. This is a tedious task. You will see a message like100 rows retrieved (more data available)
on thebottom left corner
of theRun SQL Script
screen. You canenable
theSave Results…
option in a few steps that allow you todownload
theSQL result
in anExcel spreadsheet
using ACSRun SQL Script
.Enable
theSave 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 theEdit
section in the top left corner click on that and that starts showing further options under theEdit
section. Now click on thePreferences
option under theEdit
section. This will open thePreferences
screen. Under theGeneral
Tab and below theNew Connections
heading check theEnable Saving of results
option checkbox and click onApply
andOK
.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 onYes
.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 thelittle box in the bottom right corner
of theRun SQL Script
window to retrieve all rows.Run SQL Script
and also ran the SQL query you will now see a download option namedSave Results…
isenabled
under theRight click
menu on the results area.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
, andtab-delimited text format
.OK
, theExcel spreadsheet
file is downloaded/saved to the specified location, and an Inquiry message dialog box appears mentioningfile has been saved successfully Would you like to open it
. ClickYes
to open the downloaded Excel spreadsheet file from the ACS Run SQL Script utility.How can i FTP to an iASP on my IBM i?
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 anIASP
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, typeFTP systemname
and press Enter.Here,
systemname
is the name of theIASP machine
. Now use the following FTP commands toFTP from a non-asp machine to an IASP on an IBM i machine using the PUT command
.Using namefmt 1:
Using namefmt 0:
Create a
save file
in the respective library on theIASP device
first, then try the below FTP commands.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 typeSETASPGRP ASPGRP(IASP1)
and press Enter. — (Replace IASP1 with your ASP device). Second, typeFTP systemname
and press Enter.Here,
systemname
is the name of theNon-IASP machine
. Now use the following FTP commands toFTP from a non-asp machine to an IASP on an IBM i machine using GET command
.Using namefmt 1:
Using namefmt 0:
Create a save file in the respective library on the IASP device first then try the below FTP commands.
How can i find programs compiled using debug turned on?
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 thedebug 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
See lessSTRDBG
command on a program if that program has debug info, then source code gets displayed for that program otherwise, nothing will be displayed.How to transfer save file from desktop to an IBM i system?
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:command prompt
window.cd desktop
.FTP systemname
orFTP IP address
whereSYSTEMNAME
orIP address
is of the IBM i system.User ID
andpassword
.BIN
to change the binary mode and press the Enter key.QUOTE SITE NAMEFMT 1
and press the Enter key.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.How can i derive the week from a YYYYMMDD formatted date?
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
theweek
from aYYYYMMDD
formatteddate
using theweek()
function andsubstr()
function. Please use the below SQL query to achieve this.or you can simply run the SQL query to test one of the values using a dummy table.
The output
See lessweek is 37
.