An authorization list defines the user authority for the objects in the list. When an object is created associate it with the authorization list so that we should not create individual objects with private authorities and should be getting authority based on the authorization list. It controls the iRead more
An authorization list defines the user authority for the objects in the list. When an object is created associate it with the authorization list so that we should not create individual objects with private authorities and should be getting authority based on the authorization list. It controls the individual and *PUBLIC authority to all the objects in the authorization list.
Authorization list commands:
CRTAUTL: This command creates the authorization list. CRTAUTL AUTL(ListName)
GRTOBJAUT: This command allows you to associate the authorization list with the files. GRTOBJAUT OBJ(libname/*ALL) OBJTYPE(*FILE) AUTL(listname)
If you run the above command, you are going to add all the files in the specified library to the authorization list ListName.
ADDAUTLE: This command allows you to grant users authority to the lists. ADDAUTLE AUTL(ListName) USER(ADMIN) AUT(*USE)
If you run the above command, you are going to provide *USE authority to user ADMIN for the authorization list ListName.
EDTAUTL: This command allows you to add and remove users from the list and specify their authority to the list.
DLTAUTL: This command allows you to delete an authorization list.
DSPAUTL: This command allows you to display an authorization list.
WRKAUTL: This command allows you to work with authorization lists. Using this command you can display, delete, edit, display the list objects, or change the text for an authorization list. WRKAUTL AUTL(*ALL)
The above command displays all of the authorization lists that you own or have the authority to view.
You may first open the command prompt on your Windows PC and run the following commands: cd desktop to change the current directory to the desktop so that your file can be downloaded on the desktop. FTP systemname (system name or IP address of your IBM i machine) User id (of the IBM i machine) PasswRead more
You may first open the command prompt on your Windows PC and run the following commands:
cd desktop to change the current directory to the desktop so that your file can be downloaded on the desktop.
FTP systemname (system name or IP address of your IBM i machine)
Valid supported characters by 128 bar codes are: Code 128A: 0-9, A-Z, special characters Code 128B: 0-9, A-Z, a-z, special characters Code 128C: 0-9 only
Valid supported characters by 128 bar codes are: Code 128A: 0-9, A-Z, special characters Code 128B: 0-9, A-Z, a-z, special characters Code 128C: 0-9 only
To perform a substring on a date field, you will first have to cast the field to a string. This can be done using %char. The below example will convert the date field to ISO DATEFMT first and then cast it to the character. After that, the substring (%sst) function is applied. %sst(%char(datefield "IRead more
To perform a substring on a date field, you will first have to cast the field to a string. This can be done using %char.
The below example will convert the date field to ISO DATEFMT first and then cast it to the character. After that, the substring (%sst) function is applied.
Here, As you mentioned the restore to the library was found on an auxiliary storage pool (ASP) different than the one specified by the RSTASPDEV and RSTASP parameters. Therefore, you need to pass the correct value for these RSTASPDEV and RSTASP parameters so that the RSTLIB gets successful in restorRead more
Here, As you mentioned the restore to the library was found on an auxiliary storage pool (ASP) different than the one specified by the RSTASPDEV and RSTASP parameters.
Therefore, you need to pass the correct value for these RSTASPDEV and RSTASP parameters so that the RSTLIB gets successful in restoring the library from the ASP device to *SYSBAS.
So, what you can do is you can either specify the name of the ASP device to restore the library using the RSTASPDEV() parameter or you can specify the ASP device number using the RSTASP() parameter.
RSTASPDEV() parameter us the ASP device name and that may be on some other system. Therefore, you may not want to use this parameter. You can find out the ASP device name the library was saved from just taking F16 i.e. SHIFT + F4 from the DSPSAVF command and look at the header information after pressing PAGE dOWN one time. ASP info is present under the Data Saved.
To restore to *SYSBAS i.e. *SYSTEM asp you can specify the ASP number in the RSTASP() parameter which is 1.
when the specified ASP number is 1, then the specified objects are restored to the system ASP, and when the specified ASP is 2 through 32, then objects are restored to the basic user ASP specified.
You can find any locks on an IFS object using the QP0FPTOS API. You can run this API from the command line with QSECOFR or any profile with *SERVICE special authority. CALL PGM(QP0FPTOS) PARM(*LSTOBJREF 'ifspathofObject' *FORMAT2) This command will output a spool file that tells any locks held for tRead more
You can find any locks on an IFS object using the QP0FPTOS API. You can run this API from the command line with QSECOFR or any profile with *SERVICE special authority.
This command will output a spool file that tells any locks held for the object. After the program runs you will see the message: The dump request has completed. The latest spooled file QSYSPRT with user data QP0FDUMP has the dump.
You can do this from Qshell on IBM i. To start the QSHELL, type STRQSH from the command line, and the QSH command entry screen will open. Now you can use the following command to search an IFS folder for a string within documents or files. QSH IFS search command: grep -F -R -i "search string" /ifsfoRead more
You can do this from Qshell on IBM i. To start the QSHELL, type STRQSH from the command line, and the QSH command entry screen will open. Now you can use the following command to search an IFS folder for a string within documents or files.
QSH IFS search command:
grep -F -R -i "search string" /ifsfolder
grep command searches for a pattern in a file and writes each matching line to standard output. -F tells it to search for a flat string as opposed to a regular expression. -R tells it to search all files and subdirectories of the directory given. -i mean case-insensitive. Leave this if you want to match the upper or lower case exactly. You can get more info about the grep command here.
If you want to get the list of all the files in a library with a field whose value is automatically generated by an identity, i.e., an identity column defined, then you can use the following SQL query. select table_schema, table_name, column_name, data_type, length, numeric_scale, identity_generatioRead more
If you want to get the list of all the files in a library with a field whose value is automatically generated by an identity, i.e., an identity column defined, then you can use the following SQL query.
select table_schema, table_name, column_name, data_type, length,
numeric_scale, identity_generation
from syscolumns
where table_schema = 'LibName' and is_identity = 'YES'
You can then create a cursor out of this query in your SQLRPGLE program and perform your further tasks.
I once came across a Jar file for viewing the IBM i save files on your Windows PC namely _jSAVF JAR file which is a tool created for handling IBM i save files (SAVF) on a PC. It allows us to view, extract, and manage the contents of the save files directly from the desktop. Please note that _JSAVF iRead more
I once came across a Jar file for viewing the IBM i save files on your Windows PC namely _jSAVF JAR file which is a tool created for handling IBM i save files (SAVF) on a PC. It allows us to view, extract, and manage the contents of the save files directly from the desktop.
Please note that _JSAVF is not an official IBM product, therefore it may not be available directly from IBM’s website. It may be often distributed through community resources or forums related to IBM i (AS400) or third-party vendors. You might get this JAR available on the internet.
But if you get this JAR by any means then you can easily run it and you have to ensure that the Java runtime environment (JRE) is installed before running this Jar file as it’s a Java application.
You can run it either by the _jSAVF JAR GUI and you can use it to open the SAVF files and view their contents on the desktop.
You can also run it from the command prompt or terminal window. First, navigate to the directory where you downloaded the _jSAVF JAR file, and then execute the JAR file using the following command. java -jar _jSAVF.jar
please make sure to check the documentation that comes with the _jSAVF JAR file for the instructions to use.
You can share using Operations Navigator. Let’s suppose we have created an IFS folder sharedfiles, and I want to share it so that it will be available on my Windows PC. Sharing using the operations navigator: Open the Operations Navigator. Expand My Connections. expand the IBM i system (pub400.com oRead more
You can share using Operations Navigator.
Let’s suppose we have created an IFS folder sharedfiles, and I want to share it so that it will be available on my Windows PC.
Sharing using the operations navigator:
Open the Operations Navigator.
Expand My Connections.
expand the IBM i system (pub400.com or xxx.xxx.xx.xxx).
Expand File Systems
Right-click on File Shares under Integrated File System.
Select New and then Select File Share….
A dialog to create the new file share will be prompted.
Enter a share name sharedfiles.
Change the Access to Read/Write.
Set the Path name such as /home/admin/sharedfiles.
Click the OK button.
A share name entry will be created.
How to map the folder to the Windows PC:
Select the Start button.
Search for file explorer.
Right-click on it and select Map Network Drive.
The dialog will appear.
Choose one Drive letter that is not used. Assume we selected the drive letter Z.
For the Folder enter the path to the IFS folder which is /home/admin/sharedfiles.
Uncheck the Reconnect at sign-in checkbox since Windows and IBM i sign-on details may be different.
Check the Connect using different credentials checkbox.
Click on the Finish button.
The Enter Network Password dialog appears.
Enter your IBM i username and password here and you may check Remember my credentials at your convenience.
Click OK.
Finally, Z: drive is mapped to the IFS folder /home/admin/sharedfiles.
You can set the QMAXSPLF system value to 999999. You can see the QMAXSPLF system value by using the command DSPSYSVAL QMAXSPLF. You can change the QMAXSPLF system value by using the command CHGSYSVAL SYSVAL(QMAXSPLF) VALUE(999999).
You can set the QMAXSPLF system value to 999999.
You can see the QMAXSPLF system value by using the command DSPSYSVAL QMAXSPLF.
You can change the QMAXSPLF system value by using the command CHGSYSVAL SYSVAL(QMAXSPLF) VALUE(999999).
Because there is no external description for system36 files. Thus, all of that data is contained in a single field when you access the file in SQL. Therefore, when you want to use SQL to access data from a system36 file you need to substring the data you want from the field. For Example, if the SystRead more
Because there is no external description for system36 files. Thus, all of that data is contained in a single field when you access the file in SQL. Therefore, when you want to use SQL to access data from a system36 file you need to substring the data you want from the field.
For Example, if the System36 file name is FILE1, and its single field is FLD1 then you can use the below SQL to get data from system36 files, You can change substring positions at your end as per your system36 file.
Select substr(fld1, 5, 4), substr(fld1,10,5) from FILE1
where substr(fld1,1,4) = 'A001'
Please note that you can get the field name of the system6 file by typing SQL select * from file1 and taking F4 to prompt the SQL query and then prompt the select fields.
You can use the RUNSQLSTM command instead of the STRSQL command over a text file stored in IFS and a source member present in the source file in a library. Please note that the queries that are not returning any result set should be placed inside the text files/source file members. If the SQL querieRead more
You can use the RUNSQLSTM command instead of the STRSQL command over a text file stored in IFS and a source member present in the source file in a library. Please note that the queries that are not returning any result set should be placed inside the text files/source file members.
If the SQL queries are written inside the source member present in the source physical file in a library, then use the RUNSQLSTM command as follows to execute the SQL queries at once.
If the SQL queries are present in the text file on the IFS path, then use the RUNSQLSTM command as follows to execute the SQL queries at once from the text file on the IFS. RUNSQLSTM SRCSTMF(/home/admin/query_file.sql)
COMMIT(*NONE)
You can use the following commands to save and restore an IFS object to and from the save file. Save IFS objects to save file (SAVF): SAV DEV('/qsys.lib/libname.lib/savefilename.file') OBJ(('/home/admin/files/test1.txt') ('/home/admin/files/test2.txt')) Here, We use the Save object (SAV) command andRead more
You can use the following commands to save and restore an IFS object to and from the save file.
Save IFS objects to save file (SAVF): SAV DEV('/qsys.lib/libname.lib/savefilename.file')
OBJ(('/home/admin/files/test1.txt') ('/home/admin/files/test2.txt'))
Here, We use the Save object (SAV) command and specify the save file name with the fully qualified path in the DEV parameter, In the OBJ parameter specifies the files test1.txt and test2.txt to be saved in the save file specified in the DEV parameter.
Restore IFS objects from the save file (SAVF) to the same IFS path from where it Saved:
Here, We use the Restore object (RST) command and specify the save file name with the fully qualified path in the DEV parameter, In the OBJ parameter specifies the files test1.txt and test2.txt to be restored from the save file specified in the DEV parameter. Also, the CRTPRNDIR parameter is *YES so that it would create a parent folder if not already exist.
Restore IFS objects from the save file (SAVF) to the different IFS path from where it Saved: RST DEV('/qsys.lib/libname.lib/savefilename.file')
OBJ(('/home/admin/files/test1.txt' *INCLUDE
'/home/admin/files/restore/test1.txt')
('/home/admin/files/test2.txt' *INCLUDE
'/home/admin/files/newfolder/test2.txt'))
CRTPRNDIR(*YES)
Here, We use the Restore object (RST) command and specify the save file name with the fully qualified path in the DEV parameter, In the OBJ parameter specifies the files test1.txt and after *INCLUDE specified the new object name/path and test2.txt and after *INCLUDE specified the new object name/path to be restored from the save file specified in the DEV parameter. Also, the CRTPRNDIR parameter is *YES so that it would create a parent folder if not already exist.
Note: The new object/path will be created by the command RST itself. So, no need for new folders to exist before running the RST command.
You can run this command on the IBM i command line: DSPRDBDIRE. The entry name corresponds to the Remote Location value of *LOCAL is the name of the database on your IBM i machine.
You can run this command on the IBM i command line: DSPRDBDIRE.
The entry name corresponds to the Remote Location value of *LOCAL is the name of the database on your IBM i machine.
In that situation, you can use System i Navigator. You can follow the below steps to run SQL queries using System i Navigator instead of STRSQL. Start System i Navigator and log in with the user ID and password. Go to My Connections -> Your System->Databases->Schemas. In the bottom rightRead more
In that situation, you can use System i Navigator. You can follow the below steps to run SQL queries using System i Navigator instead of STRSQL.
Start System i Navigator and log in with the user ID and password.
Go to My Connections -> Your System->Databases->Schemas.
In the bottom right panel of Databases tasks, you will see the option Run an SQL script.
Click on it. The Untitled -Run SQL scripts- system name window opens and there you can type your SQL queries and run them. Please note that you must use .(dot) instead of /(slash) to qualify the library name with the file.
Commitment control is by default enabled in IBM DB2 since the following statement cannot update a file update libname/filename set fld1 = 'test' where id = 1;. You need to add with NC to the end of the above statement to disable the commitment control and commit the update operation on the table immRead more
Commitment control is by default enabled in IBM DB2 since the following statement cannot update a file
update libname/filename set fld1 = 'test' where id = 1;.
You need to add with NC to the end of the above statement to disable the commitment control and commit the update operation on the table immediately.
update libname/filename set fld1 = 'test' where id = 1 with NC;
For using commitment control you need to enable journalling on the files first. You can follow the below steps to enable the journalling of files.
CRTJRNRCV: Create a journal reciever named jrnrcv0001 using this command. CRTJRNRCV JRNRCV(libname/JRNRCV0001)
CRTJRN: Create a journal named JRN0000001 and attach the journal receiver JRNRCV0001 using this command. CRTJRN JRN(libname/JRN0000001) JRNRCV(libname/JRNRCV0001)
STRJRNPF: Start journalling of files using a journal JRN0000001. STRJRNPF FILE(libname/filename) JRN(JRN0000001) IMAGES(*AFTER)
Once the journalling is started on files and then if you perform any update to this file through your program, you must either commit or roll back the update before your program ends. If you do not do this then the lock on the file will remain present after the program ends. You can use COMMIT command to commit the changes and ROLLBACK command to roll back the last commit or simply rollback call for the operation done so far that were not yet committed.
Using SQL we can create a user-defined function (UDF) for calculating the number of business/working dates between two dates, similar to the NETWORKDAYS function for Microsoft Excel. Creating the SQL function: We can execute the following SQL code to create our SQL function. You can either run the bRead more
Using SQL we can create a user-defined function (UDF) for calculating the number of business/working dates between two dates, similar to the NETWORKDAYS function for Microsoft Excel.
Creating the SQL function:
We can execute the following SQL code to create our SQL function. You can either run the below scripts from the Run SQL script option from IBM i Access client solutions (ACS) or on IBM i green screen, write the script within a source member of source type SQL at the location libname/srcpfname and then use RUNSQLSTM SRCFILE(libname/srcpfname) SRCMBR(srcmbrname) COMMT(*NONE) DFTRDBCOL(libname) DBGVIEW(*SOURCE) command to execute this script to create SQL function.
create or replace function libname.workingday(startdate DATE,
enddate DATE)
returns INTEGER
language SQL
is deterministic
begin
declare workingday INTEGER default 0;
declare tempdate DATE;
set tempdate = startdate;
while days(tempdate) <= days(enddate) do
if dayofweek_iso(tempdate) <> 6 and
dayofweek_iso(tempdate) <> 7 then
set workingday = workday + 1;
end if;
set tempdate = date(days(tempdate) + 1);
end while;
return workingday;
end;
Explanation of the code:
Line 1 -2: Create and replace function workingday that accepts two parameters startdate and enddate of type date.
Line 3: The SQL function returns an integer value which is the number of business/working days.
Line 4-5: Language is SQL and it is deterministic i.e. it returns the same value on the same input dates each time.
Line 6: begin of the function
Line 7: Declare workingday variable of type integer and initialize with value 0.
Line 8: Declare tempdate variable of type date.
Line 9: set the value of tempdate as startdate.
Line 10-16: Run the while loop until days of tempdate <= days of enddate. Days() function returns the integer representation of the date i.e. for Jan 1, 0001(0001-01-01) it returns 1, for (0001-01-02) it returns 2 and so on. Then we check if tempdate is not the 6th and 7th day of the week using DAYOFWEEK_ISO() function then we set the workingday as workingday + 1 i.e. increment by 1 and no increment when tempdate is the 6th and 7th day of the week. After end if; we increment the tempdate by 1 i.e. increment the number of days extracted from tempdate and convert back to date date(days(tempdate) + 1)and while loop end.
Line 17: Return the workingday value.
Line 18: end of function. Important Point:
Once the function was created an object of the type *SRVPGM and attribute CLE was created in the specified library.
How to call SQL function from Run SQL script ACS or STRSQL session on IBM i:
select libname.workingday('2024-09-05','2024-09-10) from sysibm.sysdummy1
the number of business/working days returned is 4. Since the 5th is Thursday and the 10th is Tuesday and there are total days in between these two dates are 6 and non-working days are 2 i.e. 7th and 8th (Saturday and Sunday) therefore working days are only 4.
You can run SQL queries on files present in the library in an ASP device using 2 ways: Start the Schemas tool in IBM i Access client solutions (ACS) and run your SQL scripts from a specific database(ASP device) since each ASP device is a separate database. You need to right-click on the ASP device aRead more
You can run SQL queries on files present in the library in an ASP device using 2 ways:
Start the Schemas tool in IBM i Access client solutions (ACS) and run your SQL scripts from a specific database(ASP device) since each ASP device is a separate database. You need to right-click on the ASP device and select the option Run SQL Scripts and now you can run your SQL scripts on the selected ASP device on the IBM i machine.
Another way is to start the Run SQL Scripts tools in IBM i Access client solutions (ACS) and under the Connections menu, select Connect to Database… dialog box appears, and select the database from the drop-down. There you notice all of your ASP devices present in the drop-down list. Select your ASP device and click OK. Run the SQL Script utility and start creating the new connection to the ASP device and now you will be able to run your SQL query and select file data from the library present on the selected iASP device.
You can use hexadecimal numbers to pass a numeric(integer) value to a parameter in the RPG program when calling it from the command line. Passing numeric value to a packed decimal numeric field in RPG: CALL PGM(PGM1) PARM((x'0001F') (x'00010F')) Here, the first parameter is a 3-length numeric fieldRead more
You can use hexadecimal numbers to pass a numeric(integer) value to a parameter in the RPG program when calling it from the command line.
Passing numeric value to a packed decimal numeric field in RPG:
CALL PGM(PGM1) PARM((x'0001F') (x'00010F'))
Here, the first parameter is a 3-length numeric field and passing value 1. The second parameter is a 4-length numeric field with and passing value of 10.
To pass a hexadecimal field you must start with x after X within quotes, there must be an even number of positions including the F.
So, passing value 1 to the numeric length 3 would be x’001F’ where F denotes a positive number and it is a signed bit. And as I remember we pass D for negative numbers.
However, passing value 10 to numeric length 4 is not x'0010F' since inside single quotes 0010F is an odd number of digits. So the correct value would be x'00010F i.e. add an extra zero in front of the number to make it an even number of positions within single quotes including F after X.
Just refer to some examples to understand it a little bit more,
If you trying to pass value 5.2 to the decimal (3,1) field and 543 value to the decimal (3) field. CALL PGM(PGM1) PARM((5.2) (543)) CALL PGM(PGM1) PARM((x'052F') (x'543F'))
If you trying to pass value 254674 to the numeric parameter of length 6 field. CALL PGM(PGM1) PARM((254674) CALL PGM(PGM1) PARM((x'0254674F')) Add an extra 0 at the start of the number after x and within quotes so that to make it an even number of digits in the hex value being passed.
Passing 4-byte integer value to integer (10I) field field in RPG:
If you try to pass 1 and 10 respectively CALL PGM(PGM1) PARM((x'00000001') (x'0000000A'))
Just refer to some other examples to understand it a little more:
Passing value for 3I and 5I and 10I and 20I parameters in RPG
passing value 10 to each 3I and 5I and 10I and 20I parameters in RPG CALL PGM(PGM1) PARM((X'0A') (X'000A') (X'0000000A') (X'000000000000000A'))
passing value 1 to each 3I and 5I and 10I and 20I parameters in RPG CALL PGM(PGM1) PARM((X'01') (X'0001') (X'00000001') (X'0000000000000001'))
passing value 18 to each 3I and 5I and 10I and 20I parameters in RPG CALL PGM(PGM1) PARM((X'12') (X'0012') (X'00000012') (X'0000000000000012'))
Sample program
This is the sample program that you can create at your end and test the above calls for passing Integer values in 3I, 5I, 10I, and 20I parameters in the RPG program:
D main PR EXTPGM('PGM1')
D 3I 0
D 5I 0
D 10I 0
D 20I 0
D main PI
D num1 3I 0
D num2 5I 0
D num3 10I 0
D num4 20I 0
/Free
dsply num1;
dsply num2;
dsply num3;
dsply num4;
*INLR = *ON;
/End-Free
We can move the JAR file to the IBM i using the Integrated File System (IFS) on Access Client Solutions (ACS). Go to ACS. Open IFS. Navigate to the IFS directory where you want to upload/place the JAR from Windows PC. Right-click on the file listing area and click Upload. Select your JAR from the WiRead more
We can move the JAR file to the IBM i using the Integrated File System (IFS) on Access Client Solutions (ACS).
Go to ACS.
Open IFS.
Navigate to the IFS directory where you want to upload/place the JAR from Windows PC.
Right-click on the file listing area and click Upload.
Select your JAR from the Windows PC and Click OK on the Upload dialog. This will start uploading the selected JAR to IBM i IFS.
You can follow the below steps to update the last modification date for all posts, questions, and pages on your WordPress site sitemap.xml at once. Using SQL Query for bulk update: You can use SQL queries to update the post_modified and post_modified_gmt fields in the WordPress database. Please backRead more
You can follow the below steps to update the last modification date for all posts, questions, and pages on your WordPress site sitemap.xml at once.
Using SQL Query for bulk update:
You can use SQL queries to update the post_modified and post_modified_gmt fields in the WordPress database.
Please back up your database before making any changes using SQL query.
Access your WordPress database from your hosting provider site using a tool like phpMyAdmin.
Run the following SQL query to update the modification date to the current date and time for all posts, pages, and questions on your site. UPDATE wp_posts
SET post_modified = NOW(),
post_modified_gmt = UTC_TIMESTAMP()
WHERE post_type in ('post', 'page','question')
AND post_status = 'publish';This SQL query updates the post_modified date, which Yoast uses to generate the tag in your sitemap.
When you use the Yoast SEO plugin with a theme like Discy that has its own QA schema, there can be some conflicts occur in the schema: If both the Yoast SEO plugin and Discy theme are adding article and QA schema data respectively to the same question pages, it could lead to conflict and duplicationRead more
When you use the Yoast SEO plugin with a theme like Discy that has its own QA schema, there can be some conflicts occur in the schema:
If both the Yoast SEO plugin and Discy theme are adding article and QA schema data respectively to the same question pages, it could lead to conflict and duplication and make it even worse. Google might find it harder to find which schema data to prioritize whether Article or QA schema which can hurt your page’s ranking on SERP.
You have to disable Yoast schema and retain Discy’s theme schema since the Discy theme has the native QA schema which is specifically designed for Q&A websites, and its schema should be optimal for those purposes.
To disable Yoast schema, You can follow the below steps:
Add a new plugin Customization for WP SEO on the WordPress site. Install and Activate it.
Once activated, Goto Settings in the left menu panel in WordPress and select Customization for WP SEO.
There you will see the option Disable Schema Output. Check this option to disable all Yoast SEO’s schema output and click Save Changes.
You are all done and now Yoast schema output is disabled on your WordPress site. You can again validate any of your site’s existing page schema using the Schema Markup Validator tool.
You can execute the following SQL query to get the number of records and file size of each file/table in your library. select system_table_name, number_rows, data_size from qsys2.systablestat where system_table_schema = 'Libname' Here in this SQL query, we are selecting data from the IBM i catalog sRead more
You can execute the following SQL query to get the number of records and file size of each file/table in your library.
select system_table_name, number_rows, data_size from
qsys2.systablestat where system_table_schema = 'Libname'
Here in this SQL query, we are selecting data from the IBM i catalog systablestat present in the QSYS2 library.
You can follow these steps to copy the job log into a flat file: Create a PF named job log in the qtemp library using the CRTPF command crtpf file(qtemp/joblog) rcdlen (150) ccsid(65535) Print the Joblog using the DSPJOBLOG command dspjoblog job(job number/user profile/job name) output(*print) CopyRead more
You can follow these steps to copy the job log into a flat file:
Create a PF named job log in the qtemp library using the CRTPF command crtpf file(qtemp/joblog) rcdlen (150) ccsid(65535)
Print the Joblog using the DSPJOBLOG command dspjoblog job(job number/user profile/job name) output(*print)
Copy the job log spool file QPJOBLOG to temp. file created in step 1. cpysplf file(qpjoblog) tofile(qtemp/joblog) splnbr(*last)
Your flat file is ready with job log data of the provided job in DSPJOBLOG command and now you can save this flat file in a Save file and share it.
You can execute the RUNJVA command on the IBM i which is used to run Java commands on the IBM i machine. When you run RUNJVA CLASS(*VERSION), it will display the installed Java version on your IBM i machine. The output of this command would look like: Java Shell Display java version "1.8.0_411" JavaRead more
You can execute the RUNJVA command on the IBM i which is used to run Java commands on the IBM i machine.
When you run RUNJVA CLASS(*VERSION), it will display the installed Java version on your IBM i machine.
The output of this command would look like:
Java Shell Display
java version "1.8.0_411"
Java(TM) SE Runtime Environment (build 8.0.8.25 - pap6480sr8fp25-20240328_01(SR8 FP25))
IBM J9 VM (build 2.9, JRE 1.8.0 OS/400 ppc64-64-Bit Compressed References 20240305_66992 (JIT enabled, AOT enabled)
OpenJ9 - e3126d7
OMR - f2f50a8
IBM - b81b1e2)
JCL - 20240322_01 based on Oracle jdk8u411-b09
Java program completed
Here, as per the above output, the Java version is 1.8.0_411 which is a specific build of Java 1.8 (Java 8).
We can do this by running the QSHELL command ls on the IBM i green screen by invoking the Qshell environment using the STRQSH command. ls /qsys.lib/libname.lib/Q*SRC.FILE/srcmbrname.MBR ls command will list out files and directories. For example: I want to search for source member name file1 in allRead more
We can do this by running the QSHELL command ls on the IBM i green screen by invoking the Qshell environment using the STRQSH command.
ls /qsys.lib/libname.lib/Q*SRC.FILE/srcmbrname.MBR
ls command will list out files and directories.
For example: I want to search for source member name file1 in all of the source files available in the library TESTLIB, if it finds the source member the command will list out that member and if it does not find that source member then it gives error.
Ran the following QSH command after running STRQSH on the command line, ls /qsys.lib/testlib.lib/Q*SRC.FILE/file1.MBR
Source member found and its output is: /qsys.lib/testlib.lib/QDDSSRC.FILE/file1.MBR
The source member FILE1 is present in the QDDSSRC source file in the library TESTLIB.
Now, run the following QSH command after running STRQSH on the command line, ls /qsys.lib/testlib.lib/Q*SRC.FILE/filea.MBR
Source member not found and its output is: ls: 001-2113 Error found getting information for object /qsys.lib/testlib.lib/Q*SRC.FILE/filea.MBR. No such path or directory.
You have to change your session job ccsid from 65535 to 37 only no need to change system level ccsid. This will fix your issue. Just execute chgjob ccsid(37) command in your logged-in IBM i session.
You have to change your session job ccsid from 65535 to 37 only no need to change system level ccsid. This will fix your issue.
Just execute chgjob ccsid(37) command in your logged-in IBM i session.
You can query an IBM DB2 catalog table LIBRARY_LIST_INFO available in the QSYS2 library on the IBM i system to get your session library list information using SQL. Just run this query and you will get your result: select listagg(sys_name,',') from qsys2.library_list_info Here, I am using the LISTAGGRead more
You can query an IBM DB2 catalog table LIBRARY_LIST_INFO available in the QSYS2 library on the IBM i system to get your session library list information using SQL. Just run this query and you will get your result:
select listagg(sys_name,',') from qsys2.library_list_info
Here, I am using the LISTAGG aggregate function to concatenate values from multiple rows into a single string with a comma separator between the values.
Looking at both errors SQL0204 and SQL5016 it is clear that the *SQL Naming convention is set as default in your STRSQL session attributes. With the *SQL Naming convention being set on your STRSQL session you cannot use the qualifier slash(/) and instead, you have to only rely on using dot(.) as a qRead more
Looking at both errors SQL0204 and SQL5016 it is clear that the *SQL Naming convention is set as default in your STRSQL session attributes.
With the *SQL Naming convention being set on your STRSQL session you cannot use the qualifier slash(/) and instead, you have to only rely on using dot(.) as a qualifier. Also, with the *SQL naming convention it will search for the file/table in the schema name same as the user profile on the IBM i system.
Therefore, both errors SQL0204 i.e. PF in DEVELOPER type *FILE not found, and SQL5016 i.e. Qualified object name PF1 not valid. are valid errors and they are more of a type of Diagnostic error.
Therefore, to fix this problem use both slash(/) and dot(.) as a qualifier and run SQL queries without the need to qualify file/table with library name and instead search in the set library list in the same session you need to change the STRSQL session attribute namely Naming convention. So, please change the Naming convention attribute from *SQL to *SYS. You can do so by these steps:
On STRSQL session press F13 (shift + F1). It will show the following options:
Interactive SQL Session Services
Select one of the following:
1. Change session attributes
2. Print current session
3. Remove all entries from current session
4. Save session in source file
Selection
1
Take option 1 to change session attributes. It will show the following menu:
Now add the library to the library list from the command line using the command ADDLIBLE LIB(DEVLIB). Go back to the STRSQL session and run SQL queries without qualifying the library name with file/table name or even using any qualifier either slash(/) or dot(.) if you are qualifying the file/table name.
It works. You can provide space between the colon(:) and the host variable used in embedded SQL in the RPG program. Refer to the below snippet code where we have space in between the colon(:) and host variable l_name. D l_name S 10A /Free clear l_name; exec sql select name into : l_name from clpf1Read more
It works. You can provide space between the colon(:) and the host variable used in embedded SQL in the RPG program.
Refer to the below snippet code where we have space in between the colon(:) and host variable l_name.
D l_name S 10A
/Free
clear l_name;
exec sql
select name into : l_name
from clpf1 where rollno = 26;
*inlr = *on;
/End-Free
You can save the JAR file stored at the IFS path to the save file using the command SAV. Please follow these steps to save the JAR file to save file. Create a save file in your devlib by running the CRTSAVF command from the command line on IBM i green screen. For Example, crtsavf file(testlib/savf1)Read more
You can save the JAR file stored at the IFS path to the save file using the command SAV. Please follow these steps to save the JAR file to save file.
Create a save file in your devlib by running the CRTSAVF command from the command line on IBM i green screen. For Example, crtsavf file(testlib/savf1).
Locate the IFS path and JAR file name on IFS and note it down. Assuming your JAR file is located at /home/developer/files/jar1.jar.
Execute the SAV command from the command line to save the JAR file to save file. SAV DEV('/qsys.lib/testlib.lib/savf1.file')
OBJ(('/home/developer/files/jar1.jar'))
This command will save the JAR filejar1.jar to the save filesavf1. You can then view the save file contents using the command dspsavf testlib/savf10 there you will see the directory from where this JAR file is saved to this save file.
You can run the RST command from the command line to extract/restore the JAR file from the save file back to the IFS folder. To restore to the same directory location from where it was saved initially saved but on your IBM i IFS location. You can run this command. RST DEV('/qsys.lib/devlib.lib/ptfsaRead more
You can run the RST command from the command line to extract/restore the JAR file from the save file back to the IFS folder.
To restore to the same directory location from where it was saved initially saved but on your IBM i IFS location. You can run this command.
Here, the only difference is we have *INCLUDE to specify the new path name of the JAR file to restore on IFS. Provided the new path to restore ‘/home/ckets/files/jarfiles/‘.
You can map your keyboard on the IBM i ACS 5250 emulator to use CTRL + C and CTRL + V keys by following these steps: Open ACS 5250 emulator window. Click on Edit menu option on top and from Preferences select the Keyboard... option. Keyboard dialog box appears that opens the IBMi.kmp file from the eRead more
You can map your keyboard on the IBM i ACS 5250 emulator to useCTRL + CandCTRL + Vkeys by following these steps:
Open ACS5250emulator window.
Click onEditmenu option on top and fromPreferencesselect theKeyboard...option.
Keyboarddialog box appears that opens theIBMi.kmpfile from the emulator location on your Windows PC.
On this dialog, you will see theKey Assignmenttab. Be on it.
Below that you will see a drop-down box for the optionCategory. Click on it and selectMenu Commandsfrom the drop-down box.
BelowCategory, you will now notice thelist of Menu commandsand theirKey valueis being displayed.
Scroll down themenu commands listand locate theCopycommand and select it. The selectedCOPYmenu command will get a bluehighlight indicating its selection.
Once theCopycommand is selected from the menu commands list,Assign a keybutton below the list gets enabled. Click on it. This will show the message above that the messagePress a key.
Then I press and hold theCTRLkey first and then pressCand it enters the assignment value in thekey columnagainst the Copy command in the Menu command list. Pleasenotethat if you press the first keyCTRLand release, it gets assigned as a value to the key column againCopycommand right away without waiting for the second key.
You can find the libraries created by you on the IBM i system by following these steps: Run the DSPOBJD command to list out all libraries for all users on the IBM i machine and create an outfile in the qtemp library. dspobjd obj(*allusr) objtype(*lib) output(*outfile) outfile(qtemp/libsfile) Now, yoRead more
You can find the libraries created by you on the IBM i system by following these steps:
Run the DSPOBJD command to list out all libraries for all users on the IBM i machine and create an outfile in the qtemp library.
First, open the command prompt on your Windows machine. Navigate to your folder where you want to clone the forked repo assuming you have forked the original repo under your username. Suppose, you want to clone the fork repo to the desktop of your Windows PC then you execute cd desktop to navigate tRead more
First, open the command prompt on your Windows machine. Navigate to your folder where you want to clone the forked repo assuming you have forked the original repo under your username. Suppose, you want to clone the fork repo to the desktop of your Windows PC then you execute cd desktop to navigate to the desktop.
After that run the git clone fork-repo-url to clone the fork repo to the local Windows machine.
Once cloning is done, you can then run dir to see if the clone directory is created on the desktop. If created then run cd javacode to navigate to your cloned folder. Once you are in your cloned folder run the command dir again to see files cloned from the Github fork repo inside your desktop clone folder.
After cloning, we need to set up a remote by running the following command on cmd.
git remote -v
This will list out the origin of the remote for this project which is from the fork.
Now, set up a remote to the main remote repo which allows syncing of the fork repo with the main repo. for this, we need the URL of the original repo.
You can get this main original repo URL by clicking on the link after your “repo forked from the link” and there under Code –> under HTTPS -> copy the original repo URL to the clipboard.
Now under the command prompt window type the command to add remote to the main original repo.
Now try to open this cloned project on IntelliJ make changes commit and push to your fork repo it will be successful and you will be able to see your changes inside the GitHub forked repo. Now, if you want, you can request the original author to pull your changes using a pull request on GitHub.
I can see the recommended action suggested by Bing: Recommended action: Remove redundant h1 tags from the page source, so that only one h1 tag exists. These pages have more than one h1 tag. Multiple h1 header tags might confuse search engine bots and website users. It is recommended to use only oneRead more
I can see the recommended action suggested by Bing:
Recommended action:
Remove redundant h1 tags from the page source, so that only one h1 tag exists.
These pages have more than one h1 tag. Multiple h1 header tags might confuse search engine bots and website users. It is recommended to use only one h1 tag per page.
I have enabled Prevent crawling of internal site search URL settings for the Advanced Crawl optimization; however, I cannot see the added directives to my robots.txt file. Enabling the settings Prevent crawling of internal site search URLs Add a disallow rule to my robots.txt file to prevent the craRead more
I have enabled Prevent crawling of internal site search URL settings for the Advanced Crawl optimization; however, I cannot see the added directives to my robots.txt file.
Enabling the settings Prevent crawling of internal site search URLs
Add a disallow rule to my robots.txt file to prevent the crawling of URLs like ?s=, /search/ and /page/*/?s=.”, this should add the following directives in the robots.txt file:
However, I observed that the crawl directives would not be added to my defaultrobots.txt file. Instead, it has already been added to the staticrobots.txt file here: https://example.com/?robots=1.
the code added to static robots.txt which is the Yoast output.
I have disabled the meta-description output generated by Yoast as follows: Login to the WordPress site admin Accessed Yoast SEO -> Settings -> Content Types -> Questions and blanked out the text inside the meta description content box and Save Changes. You can follow this to change this onRead more
I have disabled the meta-description output generated by Yoast as follows:
Login to the WordPress site admin
Accessed Yoast SEO -> Settings -> Content Types -> Questions and blanked out the text inside the meta description content box and Save Changes.
You can follow this to change this on other pages like Posts, Pages, Asked questions, categories, tags, etc whatever pages you have.
This will remove the meta description output generated by Yoast premium plugin and you will be left with only one meta description tag on your website pages. but in case your theme does not generate a meta description tag then please allow Yoast output to generate one meta description tag for your pages.
robots.txt file is placed in the root directory of your WordPress site that provides instructions to the web crawler as to which part of the site is crawled or not. For example, you can always block certain directories, web pages, or other resources on your website from getting indexed by search engRead more
robots.txt file is placed in the root directory of your WordPress site that provides instructions to the web crawler as to which part of the site is crawled or not.
For example, you can always block certain directories, web pages, or other resources on your website from getting indexed by search engines like Google or Bing.
You can see the contents of the robots.txt file by going to the page https://example.com/robots.txt.
On the other hand, meta robots tag ?robots=1 is used at a page level to control whether individual pages should be indexed or followed.
When you visit a page on your website with the ?robots=1 query parameter, then you can check the robots meta tags settings for that specific page.
You can see how indexing instructions like index, noindex, follow, and nofollow are applied to your specific page.
This is the default output generated by the Yoast SEO plugin is installed on the WordPress site which is a standard rule for indexing a complete site. # START YOAST BLOCK # --------------------------- User-agent: * Disallow: Sitemap: https://example.com/sitemap_index.xml # --------------------------Read more
This is the default output generated by the Yoast SEO plugin is installed on the WordPress site which is a standard rule for indexing a complete site.
Lines 1, 2, and 8,9: Comments Line 3: User-agent: * The rules apply to all web crawlers, such as Googlebot, Bingbot, DuckDuckbot, Slurp, Yandexbot, Baiduspider, etc. Line 4: Disallow: As we can see, nothing is specified after the Disallow specification, meaning no pages are blocked from being crawled by the web crawler. They can crawl the complete site. Line 6: Sitemap: https://example.com/sitemap_index.xml This is the sitemap location of your WordPress site which search engine refers to index the web pages on your site.
Here is the explanation of the meta robots tag ?robots=1 rules generated by the Yoast plugin for individual website pages.
Lines 1, 2, and 11,12: Comments Line 3: User-agent: * means the rules apply to all web crawlers. Line 4: Disallow: /?s= This rule does not allow the web crawlers to crawl internal website search result pages starting with the/?s= query parameter. Line 5: Disallow: /page/*/?s= This rule does not allow the web crawlers to crawl paginated search result pages starting with /page/*/?s= query parameter. Line 6: Disallow: /search/ This rule does not allow the web crawlers to crawl alternative search result pages starting with /search/ query parameter. Line 7: Disallow: /wp-json/ This rule does not allow the web crawlers to crawl WordPress REST API at /wp-json/. Line 8: Disallow: /?rest_route= This rule does not allow the web crawlers to crawl the routes that are part of the REST API. Line 10: Sitemap: https://example.com/sitemap_index.xml This is the sitemap location of your WordPress site which search engine refers to index the web pages on your site.
What is Authorization list. What are the command of authorization list?
An authorization list defines the user authority for the objects in the list. When an object is created associate it with the authorization list so that we should not create individual objects with private authorities and should be getting authority based on the authorization list. It controls the iRead more
An
authorization list
defines the user authority for the objects in the list. When an object is created associate it with theauthorization list
so that we should not create individual objects with private authorities and should be getting authority based on theauthorization list
. It controls the individual and *PUBLIC authority to all the objects in the authorization list.Authorization list commands:
CRTAUTL: This command creates the
authorization list
.CRTAUTL AUTL(ListName)
GRTOBJAUT: This command allows you to associate the
authorization list
with the files.GRTOBJAUT OBJ(libname/*ALL) OBJTYPE(*FILE) AUTL(listname)
If you run the above command, you are going to add all the files in the specified library to the authorization list
ListName
.ADDAUTLE: This command allows you to grant users authority to the lists.
ADDAUTLE AUTL(ListName) USER(ADMIN) AUT(*USE)
If you run the above command, you are going to provide
*USE authority
to userADMIN
for the authorization listListName
.EDTAUTL: This command allows you to add and remove users from the list and specify their authority to the list.
DLTAUTL: This command allows you to delete an
authorization list
.DSPAUTL: This command allows you to display an
authorization list
.WRKAUTL: This command allows you to work with
See lessauthorization lists
. Using this command you candisplay
,delete
,edit
,display the list objects
, orchange the text
for anauthorization list
.WRKAUTL AUTL(*ALL)
The above command displays all of the
authorization lists
that you own or have the authority to view.How to download a zip file from IFS to desktop using the command prompt?
You may first open the command prompt on your Windows PC and run the following commands: cd desktop to change the current directory to the desktop so that your file can be downloaded on the desktop. FTP systemname (system name or IP address of your IBM i machine) User id (of the IBM i machine) PasswRead more
You may first open the command prompt on your Windows PC and run the following commands:
cd desktop
to change the current directory to the desktop so that your file can be downloaded on the desktop.FTP systemname
(system name or IP address of your IBM i machine)quote site namefmt 1
get /ifspath/Zipfile.zip
Why am I getting error CPF2407 when running IBM i code coverage command CODECOV?
Please add the QDEVTOOLS library to your library list at the top. Then try to run your program again. ADDLIBLE LIB(QDEVTOOLS) POSITION(*FIRST)
Please add the
See lessQDEVTOOLS
library to your library list at the top. Then try to run your program again.ADDLIBLE LIB(QDEVTOOLS) POSITION(*FIRST)
What are the characters that are supported by 128 bar codes?
Valid supported characters by 128 bar codes are: Code 128A: 0-9, A-Z, special characters Code 128B: 0-9, A-Z, a-z, special characters Code 128C: 0-9 only
Valid supported characters by
See less128 bar codes
are:Code 128A: 0-9, A-Z, special characters
Code 128B: 0-9, A-Z, a-z, special characters
Code 128C: 0-9 only
How to use OPNQRYF to perform a substring on a date field?
To perform a substring on a date field, you will first have to cast the field to a string. This can be done using %char. The below example will convert the date field to ISO DATEFMT first and then cast it to the character. After that, the substring (%sst) function is applied. %sst(%char(datefield "IRead more
To perform a
substring on a date field
, you will first have to cast the field to a string. This can be done using%char
.The below example will convert the date field to ISO DATEFMT first and then cast it to the character. After that, the substring (
%sst
) function is applied.%sst(%char(datefield "ISO") 1 4) *EQ '1980'
Now use it with OPNQRYF
See lessOPNQRYF
FILE(libname/filename)
QRYSLT((%sst(%char(datefield "ISO") 1 4) *EQ '1980'))
Why am I getting error ASP device *SAVASPDEV not correct when running RSTLIB comamnd?
Here, As you mentioned the restore to the library was found on an auxiliary storage pool (ASP) different than the one specified by the RSTASPDEV and RSTASP parameters. Therefore, you need to pass the correct value for these RSTASPDEV and RSTASP parameters so that the RSTLIB gets successful in restorRead more
Here, As you mentioned the restore to the library was found on an auxiliary storage pool (
ASP
) different than the one specified by theRSTASPDEV
andRSTASP
parameters.Therefore, you need to pass the correct value for these
RSTASPDEV
andRSTASP
parameters so that the RSTLIB gets successful in restoring the library from theASP device
to*SYSBAS
.So, what you can do is you can either specify the name of the
ASP device
to restore the library using theRSTASPDEV()
parameter or you can specify theASP device number
using theRSTASP()
parameter.RSTASPDEV()
parameter us theASP device name
and that may be on some other system. Therefore, you may not want to use this parameter. You can find out theASP device name
the library was saved from just takingF16
i.e.SHIFT + F4
from theDSPSAVF
command and look at theheader information
after pressingPAGE dOWN
one time.ASP info
is present under theData Saved
.To restore to
*SYSBAS
i.e.*SYSTEM asp
you can specify theASP number
in theRSTASP()
parameter which is1
.RSTLIB SAVLIB(libraryonASPdevice)
DEV(*SAVF)
SAVF(testlib/savf1)
RSTLIB(LibraryonSysbas)
RSTASP(1)
when the specified
See lessASP number
is 1, then the specified objects are restored to thesystem ASP
, and when the specified ASP is 2 through 32, then objects are restored to the basic user ASP specified.How to find IFS object locks?
You can find any locks on an IFS object using the QP0FPTOS API. You can run this API from the command line with QSECOFR or any profile with *SERVICE special authority. CALL PGM(QP0FPTOS) PARM(*LSTOBJREF 'ifspathofObject' *FORMAT2) This command will output a spool file that tells any locks held for tRead more
You can find any locks on an IFS object using the
QP0FPTOS
API. You can run this API from the command line withQSECOFR
or any profile with*SERVICE special authority
.CALL PGM(QP0FPTOS) PARM(*LSTOBJREF 'ifspathofObject' *FORMAT2)
This command will output a spool file that tells any locks held for the object. After the program runs you will see the message:
See lessThe dump request has completed
. The latest spooled fileQSYSPRT
with user dataQP0FDUMP
has the dump.How to search an IFS folder for a string within documents?
You can do this from Qshell on IBM i. To start the QSHELL, type STRQSH from the command line, and the QSH command entry screen will open. Now you can use the following command to search an IFS folder for a string within documents or files. QSH IFS search command: grep -F -R -i "search string" /ifsfoRead more
You can do this from
Qshell
on IBM i. To start theQSHELL
, typeSTRQSH
from the command line, and theQSH command entry screen
will open. Now you can use the following command to search an IFS folder for a string within documents or files.QSH IFS search command:
grep -F -R -i "search string" /ifsfolder
See lessgrep
command searches for a pattern in a file and writes each matching line to standard output.-F
tells it to search for a flat string as opposed to a regular expression.-R
tells it to search all files and subdirectories of the directory given.-i
meancase-insensitive
. Leave this if you want to match the upper or lower case exactly. You can get more info about the grep command here.How to identify the files that have the value for a field automatically generated by an identity?
If you want to get the list of all the files in a library with a field whose value is automatically generated by an identity, i.e., an identity column defined, then you can use the following SQL query. select table_schema, table_name, column_name, data_type, length, numeric_scale, identity_generatioRead more
If you want to get the list of all the files in a library with a field whose value is automatically generated by an identity, i.e., an identity column defined, then you can use the following SQL query.
select table_schema, table_name, column_name, data_type, length,
numeric_scale, identity_generation
from syscolumns
where table_schema = 'LibName' and is_identity = 'YES'
You can then create a cursor out of this query in your SQLRPGLE program and perform your further tasks.
See lessIs there any JAR file for viewing IBM i save files on your PC?
I once came across a Jar file for viewing the IBM i save files on your Windows PC namely _jSAVF JAR file which is a tool created for handling IBM i save files (SAVF) on a PC. It allows us to view, extract, and manage the contents of the save files directly from the desktop. Please note that _JSAVF iRead more
I once came across a Jar file for viewing the IBM i save files on your Windows PC namely
_jSAVF
JAR file which is a tool created for handling IBM i save files (SAVF
) on a PC. It allows us to view, extract, and manage the contents of the save files directly from the desktop.Please note that
_JSAVF
is not an official IBM product, therefore it may not be available directly from IBM’s website. It may be often distributed throughcommunity resources
orforums
related to IBM i (AS400) orthird-party vendors
. You might get this JAR available on the internet.But if you get this JAR by any means then you can easily run it and you have to ensure that the Java runtime environment (
JRE
) is installed before running this Jar file as it’s a Java application.You can run it either by the
_jSAVF
JAR GUI and you can use it to open the SAVF files and view their contents on the desktop.You can also run it from the command prompt or terminal window. First, navigate to the directory where you downloaded the
See less_jSAVF
JAR file, and then execute the JAR file using the following command.java -jar _jSAVF.jar
please make sure to check the documentation that comes with the
_jSAVF
JAR file for the instructions to use.How to share the IFS folder?
You can share using Operations Navigator. Let’s suppose we have created an IFS folder sharedfiles, and I want to share it so that it will be available on my Windows PC. Sharing using the operations navigator: Open the Operations Navigator. Expand My Connections. expand the IBM i system (pub400.com oRead more
You can share using
Operations Navigator
.Let’s suppose we have created an IFS folder
sharedfiles
, and I want to share it so that it will be available on my Windows PC.Sharing using the operations navigator:
Operations Navigator
.My Connections
.IBM i system
(pub400.com or xxx.xxx.xx.xxx).File Systems
File Shares
underIntegrated File System
.New
and then Select FileShare…
.new file share
will be prompted.sharedfiles
.Access
to Read/Write.Path name
such as/home/admin/sharedfiles
.OK
button.share name entry
will be created.How to map the folder to the Windows PC:
Start button
.file explorer
.Map Network Drive
.Drive letter
that is not used. Assume we selected thedrive letter Z
.Folder
enter the path to theIFS folder
which is/home/admin/sharedfiles
.Reconnect at sign-in
checkbox since Windows and IBM i sign-on details may be different.Connect using different credentials
checkbox.Finish button
.Enter Network Password
dialog appears.Remember my credentials
at your convenience.OK
.Z: drive
is mapped to the IFS folder/home/admin/sharedfiles
.Why batch job on IBM i system stops with MSGW if can't create more spool files?
You can set the QMAXSPLF system value to 999999. You can see the QMAXSPLF system value by using the command DSPSYSVAL QMAXSPLF. You can change the QMAXSPLF system value by using the command CHGSYSVAL SYSVAL(QMAXSPLF) VALUE(999999).
QMAXSPLF
system value to999999
.QMAXSPLF
system value by using the commandDSPSYSVAL QMAXSPLF
.QMAXSPLF
system value by using the commandCHGSYSVAL SYSVAL(QMAXSPLF) VALUE(999999)
.How can i access system36 files using SQL?
Because there is no external description for system36 files. Thus, all of that data is contained in a single field when you access the file in SQL. Therefore, when you want to use SQL to access data from a system36 file you need to substring the data you want from the field. For Example, if the SystRead more
Because there is no external description for
system36
files. Thus, all of that data is contained in a single field when you access the file in SQL. Therefore, when you want to use SQL to access data from asystem36
file you need to substring the data you want from the field.For Example, if the
System36
file name isFILE1
, and its single field isFLD1
then you can use the below SQL to get data fromsystem36
files, You can change substring positions at your end as per yoursystem36
file.Select substr(fld1, 5, 4), substr(fld1,10,5) from FILE1
where substr(fld1,1,4) = 'A001'
Please note that you can get the field name of the system6 file by typing SQL
See lessselect * from file1
and takingF4
to prompt the SQL query and then prompt the select fields.How to run SQL queries from text files using RUNSQLSTM?
You can use the RUNSQLSTM command instead of the STRSQL command over a text file stored in IFS and a source member present in the source file in a library. Please note that the queries that are not returning any result set should be placed inside the text files/source file members. If the SQL querieRead more
You can use the
RUNSQLSTM
command instead of theSTRSQL
command over a text file stored in IFS and a source member present in the source file in a library. Please note that the queries that are not returning any result set should be placed inside the text files/source file members.If the SQL queries are written inside the source member present in the source physical file in a library, then use the
RUNSQLSTM
command as follows to execute the SQL queries at once.RUNSQLSTM SRCFILE(libname/srcpfName)
SRCMBR(srcmbrName)
COMMIT(*NONE)
DFTRDBCOL(libname)
DBGVIEW(*SOURCE)
If the SQL queries are present in the text file on the IFS path, then use the
See lessRUNSQLSTM
command as follows to execute the SQL queries at once from the text file on the IFS.RUNSQLSTM SRCSTMF(/home/admin/query_file.sql)
COMMIT(*NONE)
How can i save and restore IFS objects to and from save files?
You can use the following commands to save and restore an IFS object to and from the save file. Save IFS objects to save file (SAVF): SAV DEV('/qsys.lib/libname.lib/savefilename.file') OBJ(('/home/admin/files/test1.txt') ('/home/admin/files/test2.txt')) Here, We use the Save object (SAV) command andRead more
You can use the following commands to save and restore an IFS object to and from the save file.
Save IFS objects to save file (SAVF):
SAV DEV('/qsys.lib/libname.lib/savefilename.file')
OBJ(('/home/admin/files/test1.txt') ('/home/admin/files/test2.txt'))
Here, We use the Save object (
SAV
) command and specify the save file name with the fully qualified path in the DEV parameter, In theOBJ
parameter specifies the filestest1.txt
andtest2.txt
to be saved in the save file specified in theDEV
parameter.Restore IFS objects from the save file (SAVF) to the same IFS path from where it Saved:
RST DEV('/qsys.lib/libname.lib/savefilename.file')
OBJ(('/home/admin/files/test1.txt')
('/home/admin/files/test2.txt'))
CRTPRNDIR(*YES)
Here, We use the Restore object (
RST
) command and specify the save file name with the fully qualified path in theDEV
parameter, In theOBJ
parameter specifies the filestest1.txt
andtest2.txt
to be restored from the save file specified in theDEV
parameter. Also, theCRTPRNDIR
parameter is*YES
so that it would create a parent folder if not already exist.Restore IFS objects from the save file (SAVF) to the different IFS path from where it Saved:
RST DEV('/qsys.lib/libname.lib/savefilename.file')
OBJ(('/home/admin/files/test1.txt' *INCLUDE
'/home/admin/files/restore/test1.txt')
('/home/admin/files/test2.txt' *INCLUDE
'/home/admin/files/newfolder/test2.txt'))
CRTPRNDIR(*YES)
Here, We use the Restore object (
RST
) command and specify the save file name with the fully qualified path in theDEV
parameter, In theOBJ
parameter specifies the filestest1.txt
and after*INCLUDE
specified the new object name/path andtest2.txt
and after*INCLUDE
specified the new object name/path to be restored from the save file specified in the DEV parameter. Also, theCRTPRNDIR
parameter is*YES
so that it would create a parent folder if not already exist.Note: The new object/path will be created by the command
See lessRST
itself. So, no need for new folders to exist before running theRST
command.How do i find the database name on the IBM i?
You can run this command on the IBM i command line: DSPRDBDIRE. The entry name corresponds to the Remote Location value of *LOCAL is the name of the database on your IBM i machine.
You can run this command on the IBM i command line:
See lessDSPRDBDIRE
.The entry name corresponds to the
Remote Location
value of*LOCAL
is the name of the database on your IBM i machine.How can i use SQL if the IBM i does not have STRSQL installed?
In that situation, you can use System i Navigator. You can follow the below steps to run SQL queries using System i Navigator instead of STRSQL. Start System i Navigator and log in with the user ID and password. Go to My Connections -> Your System->Databases->Schemas. In the bottom rightRead more
In that situation, you can use
System i Navigator
. You can follow the below steps torun SQL queries using System i Navigator
instead of STRSQL.System i Navigator
and log in with the user ID and password.My Connections
->Your System
->Databases
->Schemas
.Databases tasks
, you will see the optionRun an SQL script
.Untitled -Run SQL scripts- system name
window opens and there you can type your SQL queries and run them. Please note that you must use.
(dot) instead of/
(slash) to qualify the library name with the file.How to use commitment control with DB2 SQL on IBM i?
Commitment control is by default enabled in IBM DB2 since the following statement cannot update a file update libname/filename set fld1 = 'test' where id = 1;. You need to add with NC to the end of the above statement to disable the commitment control and commit the update operation on the table immRead more
Commitment control
is by default enabled inIBM DB2
since the following statement cannot update a fileupdate libname/filename set fld1 = 'test' where id = 1;
.You need to add
with NC
to the end of the above statement todisable the commitment control
andcommit
the update operation on the table immediately.update libname/filename set fld1 = 'test' where id = 1 with NC;
For using
commitment control
you need to enablejournalling
on the files first. You can follow the below steps to enable thejournalling
of files.journal reciever
namedjrnrcv0001
using this command.CRTJRNRCV JRNRCV(libname/JRNRCV0001)
journal
namedJRN0000001
and attach the journal receiverJRNRCV0001
using this command.CRTJRN JRN(libname/JRN0000001) JRNRCV(libname/JRNRCV0001)
journalling
of files using a journalJRN0000001
.STRJRNPF FILE(libname/filename) JRN(JRN0000001) IMAGES(*AFTER)
Once the journalling is started on files and then if you perform any update to this file through your program, you must either commit or roll back the update before your program ends. If you do not do this then the lock on the file will remain present after the program ends. You can use
See lessCOMMIT
command to commit the changes andROLLBACK
command to roll back the last commit or simply rollback call for the operation done so far that were not yet committed.How to create an SQL function for calculating the number of business days between two dates?
Using SQL we can create a user-defined function (UDF) for calculating the number of business/working dates between two dates, similar to the NETWORKDAYS function for Microsoft Excel. Creating the SQL function: We can execute the following SQL code to create our SQL function. You can either run the bRead more
Using SQL we can create a user-defined function (UDF) for calculating the number of business/working dates between two dates, similar to the NETWORKDAYS function for Microsoft Excel.
Creating the SQL function:
We can execute the following SQL code to create our
SQL function
. You can either run the below scripts from theRun SQL script
option from IBM iAccess client solutions
(ACS) or on IBM i green screen, write the script within a source member of source type SQL at the locationlibname/srcpfname
and then useRUNSQLSTM SRCFILE(libname/srcpfname) SRCMBR(srcmbrname) COMMT(*NONE) DFTRDBCOL(libname) DBGVIEW(*SOURCE)
command to execute this script tocreate SQL function
.Explanation of the code:
Line 1 -2:
Create and replace function workingday
that accepts two parametersstartdate
andenddate
of type date.Line 3: The
SQL function returns an integer value
which is the number of business/working days.Line 4-5:
Language is SQL
and it isdeterministic
i.e. it returns the same value on the same input dates each time.Line 6: begin of the function
Line 7: Declare
workingday
variable of type integer and initialize with value 0.Line 8: Declare
tempdate
variable of type date.Line 9: set the value of
tempdate
asstartdate
.Line 10-16: Run the
while loop
until days oftempdate <= days of enddate
.Days() function
returns the integer representation of the date i.e. forJan 1, 0001(0001-01-01)
itreturns 1
, for(0001-01-02)
itreturns 2
and so on. Then we check iftempdate
is not the 6th and 7th day of the week usingDAYOFWEEK_ISO() function
then we set theworkingday
asworkingday + 1
i.e. increment by 1 and no increment whentempdate
is the 6th and 7th day of the week. Afterend if
; we increment thetempdate
by 1 i.e. increment the number of days extracted fromtempdate
and convert back to datedate(days(tempdate) + 1)
andwhile loop end
.Line 17: Return the
workingday
value.Line 18: end of function.
Important Point:
Once the function was created an object of the type
*SRVPGM
and attributeCLE
was created in the specified library.How to call SQL function from Run SQL script ACS or STRSQL session on IBM i:
the number of business/working days returned is 4. Since the 5th is Thursday and the 10th is Tuesday and there are total days in between these two dates are 6 and non-working days are 2 i.e. 7th and 8th (Saturday and Sunday) therefore working days are only 4.
See lessHow to specify the database/ASP when using Run SQL script?
You can run SQL queries on files present in the library in an ASP device using 2 ways: Start the Schemas tool in IBM i Access client solutions (ACS) and run your SQL scripts from a specific database(ASP device) since each ASP device is a separate database. You need to right-click on the ASP device aRead more
You can run SQL queries on files present in the library in an ASP device using 2 ways:
Schemas tool
in IBM iAccess client solutions
(ACS) and run your SQL scripts from a specific database(ASP device) since each ASP device is a separate database. You need to right-click on theASP device
and select the optionRun SQL Scripts
and now you can run your SQL scripts on the selectedASP device
on the IBM i machine.Run SQL Scripts tools
in IBM iAccess client solutions
(ACS) and under theConnections
menu, selectConnect to Database…
dialog box appears, and select thedatabase
from the drop-down. There you notice all of your ASP devices present in the drop-down list. Select yourASP device
and clickOK
. Run theSQL Script utility
and start creating thenew connection
to theASP device
and now you will be able to run your SQL query and select file data from the library present on the selectediASP device
.How can i pass an integer variable to an RPG program from the command line?
You can use hexadecimal numbers to pass a numeric(integer) value to a parameter in the RPG program when calling it from the command line. Passing numeric value to a packed decimal numeric field in RPG: CALL PGM(PGM1) PARM((x'0001F') (x'00010F')) Here, the first parameter is a 3-length numeric fieldRead more
You can use
hexadecimal numbers
to pass anumeric(integer)
value to a parameter in theRPG program
when calling it from thecommand line
.Passing numeric value to a packed decimal numeric field in RPG:
CALL PGM(PGM1) PARM((x'0001F') (x'00010F'))
Here, the first parameter is a 3-length numeric field and passing value 1. The second parameter is a 4-length numeric field with and passing value of 10.
To pass a hexadecimal field you must start with
x
after X within quotes, there must be an even number of positions including theF
.So, passing value 1 to the numeric length 3 would be
x’001F’
whereF
denotes a positive number and it is a signed bit. And as I remember we passD
for negative numbers.However, passing value 10 to numeric length 4 is not
since inside single quotes 0010F is an odd number of digits. So the correct value would bex'0010F'
x'00010F
i.e. add an extra zero in front of the number to make it an even number of positions within single quotes including F after X.Just refer to some examples to understand it a little bit more,
CALL PGM(PGM1) PARM((5.2) (543))
CALL PGM(PGM1) PARM((x'052F') (x'543F'))
CALL PGM(PGM1) PARM((254674)
CALL PGM(PGM1) PARM((x'0254674F'))
Add an extra 0 at the start of the number after x and within quotes so that to make it an even number of digits in the hex value being passed.
Passing 4-byte integer value to integer (10I) field field in RPG:
If you try to pass 1 and 10 respectively
CALL PGM(PGM1) PARM((x'00000001') (x'0000000A'))
Just refer to some other examples to understand it a little more:
Passing value for 3I and 5I and 10I and 20I parameters in RPG
CALL PGM(PGM1) PARM((X'0A') (X'000A') (X'0000000A') (X'000000000000000A'))
CALL PGM(PGM1) PARM((X'01') (X'0001') (X'00000001') (X'0000000000000001'))
CALL PGM(PGM1) PARM((X'12') (X'0012') (X'00000012') (X'0000000000000012'))
You can check convert decimal to hex value here.
Sample program
This is the sample program that you can create at your end and test the above calls for passing Integer values in 3I, 5I, 10I, and 20I parameters in the RPG program:
How to move JAR file to IBM i?
We can move the JAR file to the IBM i using the Integrated File System (IFS) on Access Client Solutions (ACS). Go to ACS. Open IFS. Navigate to the IFS directory where you want to upload/place the JAR from Windows PC. Right-click on the file listing area and click Upload. Select your JAR from the WiRead more
We can move the
JAR
file to the IBM i using theIntegrated File System
(IFS) onAccess Client Solutions
(ACS).ACS
.IFS
.IFS directory
where you want to upload/place theJAR
from Windows PC.file listing area
and clickUpload
.JAR
from the Windows PC and ClickOK
on theUpload dialog
. This will start uploading the selectedJAR
to IBM iIFS
.how can i update last modification date in yoast generated sitemap.xml on all post at once?
You can follow the below steps to update the last modification date for all posts, questions, and pages on your WordPress site sitemap.xml at once. Using SQL Query for bulk update: You can use SQL queries to update the post_modified and post_modified_gmt fields in the WordPress database. Please backRead more
You can follow the below steps to update the
last modification date
for all posts, questions, and pages on your WordPress site
sitemap.xml
at once.Using SQL Query for bulk update:
You can use SQL queries to update the
post_modified
andpost_modified_gmt
fields in theWordPress database
.phpMyAdmin
.modification date
to thecurrent date
andtime
for all posts, pages, and questions on your site.UPDATE wp_posts
This SQL query updates theSET post_modified = NOW(),
post_modified_gmt = UTC_TIMESTAMP()
WHERE post_type in ('post', 'page','question')
AND post_status = 'publish';
post_modified
date, which Yoast uses to generate thetag in your
sitemap
.How to disbale Yoast schema output for Q&A website?
When you use the Yoast SEO plugin with a theme like Discy that has its own QA schema, there can be some conflicts occur in the schema: If both the Yoast SEO plugin and Discy theme are adding article and QA schema data respectively to the same question pages, it could lead to conflict and duplicationRead more
When you use the
Yoast SEO plugin
with atheme like Discy
that has itsown QA schema
, there can be some conflicts occur in the schema:If both the Yoast SEO plugin and Discy theme are adding article and QA schema data respectively to the same question pages, it could lead to conflict and duplication and make it even worse. Google might find it harder to find which schema data to prioritize whether Article or QA schema which can hurt your page’s ranking on SERP.
You have to disable Yoast schema and retain Discy’s theme schema since the Discy theme has the native QA schema which is specifically designed for Q&A websites, and its schema should be optimal for those purposes.
To disable Yoast schema, You can follow the below steps:
Customization for WP SEO
on the WordPress site. Install and Activate it.Settings
in the left menu panel in WordPress and selectCustomization for WP SEO
.Disable Schema Output
.Check this option
to disable all Yoast SEO’s schema output and clickSave
Changes.Schema Markup Validator tool
.how to get the number of records and file size for all the files in a given IBM i library?
You can execute the following SQL query to get the number of records and file size of each file/table in your library. select system_table_name, number_rows, data_size from qsys2.systablestat where system_table_schema = 'Libname' Here in this SQL query, we are selecting data from the IBM i catalog sRead more
You can execute the following SQL query to get the number of records and file size of each file/table in your library.
select system_table_name, number_rows, data_size from
qsys2.systablestat where system_table_schema = 'Libname'
Here in this SQL query, we are selecting data from the IBM i catalog
See lesssystablestat
present in theQSYS2
library.How to copy Job log into a flat file?
You can follow these steps to copy the job log into a flat file: Create a PF named job log in the qtemp library using the CRTPF command crtpf file(qtemp/joblog) rcdlen (150) ccsid(65535) Print the Joblog using the DSPJOBLOG command dspjoblog job(job number/user profile/job name) output(*print) CopyRead more
You can follow these steps to copy the job log into a flat file:
crtpf file(qtemp/joblog) rcdlen (150) ccsid(65535)
dspjoblog job(job number/user profile/job name) output(*print)
cpysplf file(qpjoblog) tofile(qtemp/joblog) splnbr(*last)
Your flat file is ready with job log data of the provided job in
See lessDSPJOBLOG
command and now you can save this flat file in a Save file and share it.How to check the installed Java version on the IBM i machine?
You can execute the RUNJVA command on the IBM i which is used to run Java commands on the IBM i machine. When you run RUNJVA CLASS(*VERSION), it will display the installed Java version on your IBM i machine. The output of this command would look like: Java Shell Display java version "1.8.0_411" JavaRead more
You can execute the
RUNJVA
command on the IBM i which is used to run Java commands on the IBM i machine.When you run
RUNJVA CLASS(*VERSION)
, it will display the installed Java version on your IBM i machine.The output of this command would look like:
Java Shell Display
Here, as per the above output, the Java version is
See less1.8.0_411
which is a specific build ofJava 1.8 (Java 8)
.how to check if the given source member is present in library src-pfs?
We can do this by running the QSHELL command ls on the IBM i green screen by invoking the Qshell environment using the STRQSH command. ls /qsys.lib/libname.lib/Q*SRC.FILE/srcmbrname.MBR ls command will list out files and directories. For example: I want to search for source member name file1 in allRead more
We can do this by running the
QSHELL
commandls
on the IBM i green screen by invoking theQshell
environment using theSTRQSH
command.ls /qsys.lib/libname.lib/Q*SRC.FILE/srcmbrname.MBR
ls
command will list out files and directories.For example: I want to search for source member name
file1
in all of the source files available in the libraryTESTLIB
, if it finds the source member the command will list out that member and if it does not find that source member then it gives error.Ran the following QSH command after running STRQSH on the command line,
ls /qsys.lib/testlib.lib/Q*SRC.FILE/file1.MBR
Source member found and its output is:
/qsys.lib/testlib.lib/QDDSSRC.FILE/file1.MBR
The source member
FILE1
is present in theQDDSSRC
source file in the libraryTESTLIB
.Now, run the following QSH command after running STRQSH on the command line,
See lessls /qsys.lib/testlib.lib/Q*SRC.FILE/filea.MBR
Source member not found and its output is:
ls: 001-2113 Error found getting information for object /qsys.lib/testlib.lib/Q*SRC.FILE/filea.MBR. No such path or directory.
Gettiing error character conversion between CCSID 65535 and CCSID 1208 not valid
You have to change your session job ccsid from 65535 to 37 only no need to change system level ccsid. This will fix your issue. Just execute chgjob ccsid(37) command in your logged-in IBM i session.
You have to change your session job ccsid from
65535
to37
only no need to change system level ccsid. This will fix your issue.Just execute
See lesschgjob ccsid(37)
command in your logged-in IBM i session.How to find the library list of my IBM i session using SQL?
You can query an IBM DB2 catalog table LIBRARY_LIST_INFO available in the QSYS2 library on the IBM i system to get your session library list information using SQL. Just run this query and you will get your result: select listagg(sys_name,',') from qsys2.library_list_info Here, I am using the LISTAGGRead more
You can query an IBM DB2 catalog table
LIBRARY_LIST_INFO
available in theQSYS2
library on the IBM i system to get your session library list information using SQL. Just run this query and you will get your result:select listagg(sys_name,',') from qsys2.library_list_info
Here, I am using the
See lessLISTAGG
aggregate function to concatenate values from multiple rows into a single string with a comma separator between the values.How to change STRSQL session to use library list?
Looking at both errors SQL0204 and SQL5016 it is clear that the *SQL Naming convention is set as default in your STRSQL session attributes. With the *SQL Naming convention being set on your STRSQL session you cannot use the qualifier slash(/) and instead, you have to only rely on using dot(.) as a qRead more
Looking at both errors
SQL0204
andSQL5016
it is clear that the*SQL
Naming convention is set as default in yourSTRSQL
session attributes.With the
*SQL
Naming convention being set on yourSTRSQL
session you cannot use the qualifierslash(/)
and instead, you have to only rely on usingdot(.)
as a qualifier. Also, with the*SQL
naming convention it will search for the file/table in the schema name same as the user profile on the IBM i system.Therefore, both errors
SQL0204
i.e.PF in DEVELOPER type *FILE not found,
andSQL5016
i.e.Qualified object name PF1 not valid.
are valid errors and they are more of a type of Diagnostic error.Therefore, to fix this problem use both
slash(/)
anddot(.)
as a qualifier and run SQL queries without the need to qualify file/table with library name and instead search in the set library list in the same session you need to change theSTRSQL
session attribute namely Naming convention. So, please change the Naming convention attribute from*SQL
to*SYS
. You can do so by these steps:STRSQL
session pressF13 (shift + F1)
. It will show the following options:option 1
to change session attributes. It will show the following menu:*SQL
to*SYS
.STRSQL
session.ADDLIBLE LIB(DEVLIB)
. Go back to theSTRSQL
session and run SQL queries without qualifying the library name with file/table name or even using any qualifier eitherslash(/)
ordot(.)
if you are qualifying the file/table name.Can we provide spaces between colon and host variable in embedded SQL in IBM i?
It works. You can provide space between the colon(:) and the host variable used in embedded SQL in the RPG program. Refer to the below snippet code where we have space in between the colon(:) and host variable l_name. D l_name S 10A /Free clear l_name; exec sql select name into : l_name from clpf1Read more
It works. You can provide space between the
colon(:)
and thehost variable
used in embedded SQL in the RPG program.Refer to the below snippet code where we have space in between the colon(:) and host variable l_name.
How to save JAR file to Save file?
You can save the JAR file stored at the IFS path to the save file using the command SAV. Please follow these steps to save the JAR file to save file. Create a save file in your devlib by running the CRTSAVF command from the command line on IBM i green screen. For Example, crtsavf file(testlib/savf1)Read more
You can save the
JAR file
stored at theIFS path
to thesave file
using the commandSAV
. Please follow these steps to save theJAR file
tosave file
.devlib
by running theCRTSAVF
command from the command line on IBM i green screen. For Example,crtsavf file(testlib/savf1)
.IFS path
andJAR file
name on IFS and note it down. Assuming yourJAR file
is located at/home/developer/files/jar1.jar
.SAV
command from the command line to save theJAR file
tosave file
.SAV DEV('/qsys.lib/testlib.lib/savf1.file')
OBJ(('/home/developer/files/jar1.jar'))
JAR file
jar1.jar
to thesave file
savf1
. You can then view the save file contents using the commanddspsavf testlib/savf10
there you will see the directory from where thisJAR file
is saved to thissave file
.How to extract JAR file from save file?
You can run the RST command from the command line to extract/restore the JAR file from the save file back to the IFS folder. To restore to the same directory location from where it was saved initially saved but on your IBM i IFS location. You can run this command. RST DEV('/qsys.lib/devlib.lib/ptfsaRead more
You can run the
RST
command from the command line toextract/restore
theJAR file
from thesave file
back to theIFS folder
.To restore to the same directory location from where it was saved initially saved but on your IBM i IFS location. You can run this command.
RST DEV('/qsys.lib/devlib.lib/ptfsavf.file')
OBJ(('/home/jvdev/ptf/2024/')) crtprndir(*yes)
This will restore the jar file at the ifs path
/home/jvdev/ptf/2024/
.However, if you want it to extract/restore to a different IFS folder than it was saved then you can do that by running the following command.
RST DEV('/qsys.lib/devlib.lib/ptfsavf.file')
obj(('/home/jvdev/ptf/2024/' *include
'/home/ckets/files/jarfiles/'))
crtprndir(*yes)
Here, the only difference is we have
See less*INCLUDE
to specify the new path name of the JAR file to restore on IFS. Provided the new path to restore ‘/home/ckets/files/jarfiles/
‘.How to enable the CTRL+C and CTRL+V key for copy and paste on IBM i green screen?
You can map your keyboard on the IBM i ACS 5250 emulator to use CTRL + C and CTRL + V keys by following these steps: Open ACS 5250 emulator window. Click on Edit menu option on top and from Preferences select the Keyboard... option. Keyboard dialog box appears that opens the IBMi.kmp file from the eRead more
You can map your keyboard on the IBM i ACS 5250 emulator to use
CTRL + C
andCTRL + V
keys by following these steps:5250
emulator window.Edit
menu option on top and fromPreferences
select theKeyboard...
option.Keyboard
dialog box appears that opens theIBMi.kmp
file from the emulator location on your Windows PC.Key Assignment
tab. Be on it.Category
. Click on it and selectMenu Commands
from the drop-down box.Category
, you will now notice thelist of Menu commands
and theirKey value
is being displayed.menu commands list
and locate theCopy
command and select it. The selectedCOPY
menu command will get a blue highlight indicating its selection.Copy
command is selected from the menu commands list,Assign a key
button below the list gets enabled. Click on it. This will show the message above that the messagePress a key
.CTRL
key first and then pressC
and it enters the assignment value in thekey column
against the Copy command in the Menu command list. Please note that if you press the first keyCTRL
and release, it gets assigned as a value to the key column againCopy
command right away without waiting for the second key.CTRL + V
key setup forPaste
menu command.CTRL + C
andCTRL + V
keys inIBMi.kmp
file.How to find which libraries were created by me on IBM i?
You can find the libraries created by you on the IBM i system by following these steps: Run the DSPOBJD command to list out all libraries for all users on the IBM i machine and create an outfile in the qtemp library. dspobjd obj(*allusr) objtype(*lib) output(*outfile) outfile(qtemp/libsfile) Now, yoRead more
You can find the libraries created by you on the IBM i system by following these steps:
DSPOBJD
command to list out all libraries for all users on the IBM i machine and create anoutfile
in theqtemp
library.libsname
created in theqtemp
library and select the libraries for the specified user profile.How can I push to my fork from a clone of the original repository in GitHub?
First, open the command prompt on your Windows machine. Navigate to your folder where you want to clone the forked repo assuming you have forked the original repo under your username. Suppose, you want to clone the fork repo to the desktop of your Windows PC then you execute cd desktop to navigate tRead more
First, open the
command prompt
on yourWindows machine
. Navigate to your folder where you want to clone the forked repo assuming you have forked the original repo under your username. Suppose, you want to clone the fork repo to the desktop of your Windows PC then you executecd desktop
to navigate to the desktop.After that run the
git clone fork-repo-url
to clone the fork repo to the local Windows machine.git clone https://github.com/myusername/javacode.git
this command will start cloning your fork repo on your desktop and will show the output like this on the command prompt.
Once cloning is done, you can then run
dir
to see if the clone directory is created on the desktop. If created then runcd javacode
to navigate to your cloned folder. Once you are in your cloned folder run the commanddir
again to see files cloned from the Github fork repo inside your desktop clone folder.After cloning, we need to set up a remote by running the following command on cmd.
git remote -v
This will list out the origin of the remote for this project which is from the fork.
origin https://github.com/myusername/javacode.git (fetch)
origin https://github.com/myusername/javacode.git (push)
Now, set up a remote to the main remote repo which allows syncing of the fork repo with the main repo. for this, we need the URL of the original repo.
You can get this main original repo URL by clicking on the link after your “repo forked from the link” and there under Code –> under HTTPS -> copy the original repo URL to the clipboard.
Now under the command prompt window type the command to add remote to the main original repo.
git remote add upstream https://github.com/Originalusername/javacode.git
after this run this command again on the command prompt,
git remote -v
This will now list the fork repo as the origin and the original repo as upstream.
Now try to open this cloned project on IntelliJ make changes commit and push to your fork repo it will be successful and you will be able to see your changes inside the GitHub forked repo. Now, if you want, you can request the original author to pull your changes using a pull request on GitHub.
See lessError There are multiple H1 tags on the page reported in Bing Webmaster for my wordopress site
I can see the recommended action suggested by Bing: Recommended action: Remove redundant h1 tags from the page source, so that only one h1 tag exists. These pages have more than one h1 tag. Multiple h1 header tags might confuse search engine bots and website users. It is recommended to use only oneRead more
I can see the recommended action suggested by Bing:
Recommended action:
Remove redundant
h1 tags
from the page source, so that only oneh1 tag
exists.These pages have more than one
h1 tag
.Multiple h1 header tags
might confuse search engine bots and website users. It is recommended to use only oneh1 tag
per page.But, rather I found one video on Youtube regarding the usage of double H1 tag on the website page.
You can check this video More than one H1 tag on a page: good or bad?
Robots.txt file not getting updated in WordPress site using Advanced Crawl optimization setting in Yoast premium
I have enabled Prevent crawling of internal site search URL settings for the Advanced Crawl optimization; however, I cannot see the added directives to my robots.txt file. Enabling the settings Prevent crawling of internal site search URLs Add a disallow rule to my robots.txt file to prevent the craRead more
I have enabled Prevent crawling of internal site search URL settings for the
Advanced Crawl optimization
; however, I cannot see the added directives to myrobots.txt
file.Enabling the settings Prevent crawling of internal site search URLs
Add a
disallow
rule to myrobots.txt
file to prevent the crawling of URLs like?s=
,/search/
and/page/*/?s=
.”, this should add the following directives in the robots.txt file:However, I observed that the crawl directives would not be added to my default
robots.txt
file. Instead, it has already been added to the staticrobots.txt
file here:https://example.com/?robots=1
.the code added to static robots.txt which is the Yoast output.
Duplicate meta descriptions multiple tag errors reported by Bing Webmaster on my wordpress site
I have disabled the meta-description output generated by Yoast as follows: Login to the WordPress site admin Accessed Yoast SEO -> Settings -> Content Types -> Questions and blanked out the text inside the meta description content box and Save Changes. You can follow this to change this onRead more
I have disabled the meta-description output generated by
Yoast
as follows:Yoast SEO -> Settings -> Content Types -> Questions
and blanked out the text inside the meta description content box and Save Changes.what is the difference between the two files ?robots=1 and robots.txt?
robots.txt file is placed in the root directory of your WordPress site that provides instructions to the web crawler as to which part of the site is crawled or not. For example, you can always block certain directories, web pages, or other resources on your website from getting indexed by search engRead more
robots.txt
file is placed in the root directory of your WordPress site that provides instructions to the web crawler as to which part of the site is crawled or not.For example, you can always block certain directories, web pages, or other resources on your website from getting indexed by search engines like Google or Bing.
You can see the contents of the
robots.txt
file by going to the pagehttps://example.com/robots.txt
.On the other hand, meta robots tag
?robots=1
is used at a page level to control whether individual pages should be indexed or followed.When you visit a page on your website with the
?robots=1
query parameter, then you can check the robots meta tags settings for that specific page.You can see how indexing instructions like
See lessindex
,noindex
,follow
, andnofollow
are applied to your specific page.How Google interprets the default rules generated by Yoast plugin in the robots.txt file?
This is the default output generated by the Yoast SEO plugin is installed on the WordPress site which is a standard rule for indexing a complete site. # START YOAST BLOCK # --------------------------- User-agent: * Disallow: Sitemap: https://example.com/sitemap_index.xml # --------------------------Read more
This is the default output generated by the
Yoast SEO plugin
is installed on theWordPress
site which is a standard rule for indexing a complete site.Lines 1, 2, and 8,9: Comments
Line 3:
User-agent: *
The rules apply to all web crawlers, such as Googlebot, Bingbot, DuckDuckbot, Slurp, Yandexbot, Baiduspider, etc.Line 4:
Disallow:
As we can see, nothing is specified after the Disallow specification, meaning no pages are blocked from being crawled by the web crawler. They can crawl the complete site.Line 6:
Sitemap: https://example.com/sitemap_index.xml
This is the sitemap location of your WordPress site which search engine refers to index the web pages on your site.Here is the explanation of the meta robots tag
?robots=1
rules generated by the Yoast plugin for individual website pages.Lines 1, 2, and 11,12: Comments
See lessLine 3:
User-agent: *
means the rules apply to all web crawlers.Line 4:
Disallow: /?s=
This rule does not allow the web crawlers to crawl internal website search result pages starting with the/?s= query parameter.Line 5:
Disallow: /page/*/?s=
This rule does not allow the web crawlers to crawl paginated search result pages starting with /page/*/?s= query parameter.Line 6:
Disallow: /search/
This rule does not allow the web crawlers to crawl alternative search result pages starting with /search/ query parameter.Line 7:
Disallow: /wp-json/
This rule does not allow the web crawlers to crawl WordPress REST API at /wp-json/.Line 8:
Disallow: /?rest_route=
This rule does not allow the web crawlers to crawl the routes that are part of the REST API.Line 10:
Sitemap: https://example.com/sitemap_index.xml
This is the sitemap location of your WordPress site which search engine refers to index the web pages on your site.