In AS400, "AS" stands for Application system. This article discusses what AS400 is, its history, the operating system it uses, its features, use, and other essential things. Introduction Let me first talk about what the AS400 system is. It is a midrange server introduced by IBM in 1988 in Rochester,Read more
In AS400, “AS” stands for Application system. This article discusses what AS400 is, its history, the operating system it uses, its features, use, and other essential things.
Introduction
Let me first talk about what the AS400 system is. It is a midrange server introduced by IBM in 1988 in Rochester, Minnesota. It is a compact mainframe system that replaces System/36 and System/38.
History
Let’s look at the history of AS400. The AS400 system was renamed several times, from eServer iSeries in 2000 to System i in 2006. Later, in 2008, System I merged with System P and became Power System.
For more information, please read IBM’s history of AS400 in detail.
Operating System
OS400 is the operating system used. OS400 is now known as the IBM i power system. The current version of the operating system is IBM i 7.4 which supports logical partitioning (LPAR) where multiple OS can run simultaneously on the same IBM i machine.
Features
The AS400 is an object-oriented system where everything is an object. It uses files to store data. It interfaces with hardware via a technology-independent machine interface (TIMI) rather than directly and is not dependent on any specific technology. Customers can switch their applications to new hardware technology at any time.
AS400 has software for communications, backup, and recovery. It has an inbuilt DB2 database. It’s a safe, multiuser and multitasking system. Additionally, it supports file systems, web application servers, and web service servers, among other tools. The system consists of Independently installed software components called licensed programs. The changes made to the parts require a PTF. Hence, we can install PTFs permanently or temporarily.
Use
AS400 is used in businesses that value safety, stability, and dependability. Several corporate applications use AS400, such as Manufacturing, Finance, Transportation and logistics, Banks, ERP, etc.
Cloud
AS400 cloud services are now provided by Amazon web services, Google Cloud platform, Microsoft Azure, etc.
Technical introduction
It contains a sizeable library-based operating system. It supports programming languages such as RPG, COBOL, Assembly, C, C++, Java, PHP, Python, REXX, CL, and SQL.
Several CASE tools are available on AS400 systems, such as Accelerator, Synon, LANSA, IBM Rational Business Developer Extension, etc.
AS400 developers generally use programming languages such as RPG, CL, SQL DB2, Java, XML, etc.
It uses an integrated language environment (ILE) programming environment, which allows us to create single programs from modules in different programming languages such as C, C++, RPG, CL, COBOL, etc. It fully supports the Java language. Several IBM i terminal emulators are available for accessing AS400, such as IBM i ACS, Mocha TN5250, and 5250 emulators. It supports both JDBC and ODBC connectivity. It offers a command and menu-driven interface. This system works in a single operating environment known as a subsystem.
Careers
AS400 is still in high demand in 2024. Many companies globally use AS400 systems. Freshers can opt for several roles in this technology, as indicated below.
IBM i developer
IBM i system administrator
Database administrator
Business analyst
Support Specialist
IBM i tester
IBM i technical analyst
IBM i consultant and others
Integrations
IBMi can share data and communicate with other systems. Moreover, it integrates with file servers, web apps, etc. It can integrate with SAP and JD Edwards. WordPress is hosted on IBM i servers and powers websites and online commerce. Tableau and Power BI tools connect to Salesforce and IBM i databases. IBM i is compatible with iOS and Android mobile OS. Social media networks such as Facebook, LinkedIn, and X (formerly Twitter) integrate with it. E-commerce sites such as Shopify, Amazon, and others are compatible with it. IBM I can integrate with banks and payment gateway for secure transactions. IBM i can integrate with their party software/services using APIs and Web services. The operating system supports Oracle, SQL Server, MySQL, DB2, etc.
Where can I learn more about IBM i?
You can refer to the following material to learn about IBM i technology.
Read official documentation and resources from IBM.
The library cannot contain any other *LIB type object, while QSYS can contain *LIB objects.
Moreover, the IBM-supplied library starts with Q or #.
Different types of objects can exist in the library.
An object name can have a maximum of 10 characters.
An object is unique by its name and type in a library.
This system uses EBCDIC encoding.
This system also supports IFS.
Conclusion
AS400 is a midrange server now known as a power system. IBM i 7.5 is the current version of the operating system, and it is object-oriented. It is a very stable system, and some firms have adopted the As400 cloud services. IBM i can integrate with other external systems.
AS400 is still in high demand in 2024. Many companies globally use AS400 systems. Freshers can opt for several roles in this technology, as indicated below.
IBM i developer
IBM i system administrator
Database administrator
Business analyst
Support Specialist
IBM i tester
IBM i technical analyst
IBM i consultant and others
Integrations
IBMi can share data and communicate with other systems. Moreover, it integrates with file servers, web apps, etc. It can integrate with SAP and JD Edwards. WordPress is hosted on IBM i servers and powers websites and online commerce. Tableau and Power BI tools connect to Salesforce and IBM i databases. IBM i is compatible with iOS and Android mobile OS. Social media networks such as Facebook, LinkedIn, and X (formerly Twitter) integrate with it. E-commerce sites such as Shopify, Amazon, and others are compatible with it. IBM I can integrate with banks and payment gateway for secure transactions. IBM i can integrate with their party software/services using APIs and Web services. The operating system supports Oracle, SQL Server, MySQL, DB2, etc.
Where can I learn more about IBM i?
You can refer to the following material to learn about IBM i technology.
Read official documentation and resources from IBM.
The library cannot contain any other *LIB type object, while QSYS can contain *LIB objects.
Moreover, the IBM-supplied library starts with Q or #.
Different types of objects can exist in the library.
An object name can have a maximum of 10 characters.
An object is unique by its name and type in a library.
This system uses EBCDIC encoding.
This system also supports IFS.
Conclusion
AS400 is a midrange server now known as a power system. IBM i 7.5 is the current version of the operating system, and it is object-oriented. It is a very stable system, and some firms have adopted the As400 cloud services. IBM i can integrate with other external systems.
PUB400 is an accessible online IBM i server where anyone can create a user profile and get access to the server. Additionally, they will get 500 MB of disk storage and two private libraries for their practice. PUB400 is hosting IBM i 7.5. This was started in the year 2000, and according to the PUB40Read more
PUB400 is an accessible online IBM i server where anyone can create a user profile and get access to the server. Additionally, they will get 500 MB of disk storage and two private libraries for their practice. PUB400 is hosting IBM i 7.5. This was started in the year 2000, and according to the PUB400 website reports, this server has more than 40K active user profiles globally.
PUB400 sign up – as400 server sign up
To start practicing on the PUB400 server, you must first register at pub400.com. Click here to join pub400 at any time. To register on PUB400, you must provide your first and last name, email address, and IBM I user name, agree to their terms and conditions, and submit the registration form. This will trigger an email with the instructions to do next.
Pub400 IP address
Pub400 IP address is 185.113.5.134.
Pub400 connection – as400 server connection
Install and open Access Client Solutions (ACS) software on your Windows machine. After that, start ACS and enter pub400.com as the Destination Address. You are prompted to enter your username and password that you get from PUB400.
Pub400 User forum
After creating your user profile on PUB40, you can now ask questions and share your knowledge on a community forum run by PUB400. To access the pub400 community forum, you must validate your user ID and password. Here, you will find information regarding PUB400.com announcements.
PUB400 not working
If you face connectivity issues with pub400, visit the FAQ page on PUB400.com.
Free tools on as400 server
On the PUB400 IBM i server, you will see that several free tools are installed on the server, such as iQuery, IBM i Report Server by KDP, FFD, and AL400S. Click here for additional details.
Menus provides access to various AS400 commands and the system functionalities. The menu name appears on the top left corner of a menu and can be seen by invoking that menu. Also, each menu provides a command line from where we can select any options provided on the menu. Type GO <menu-name> oRead more
Menus provides access to various AS400 commands and the system functionalities. The menu name appears on the top left corner of a menu and can be seen by invoking that menu. Also, each menu provides a command line from where we can select any options provided on the menu. Type GO <menu-name> on the command line and press enter to access any specific menu.
Display All as400 menu
Use the GO *ALL command to display a list of all available menus in the AS400 system.
Go To A Menu
Type options, press Enter.
1=Select menu
Opt Menu Library Text
AFPU QSYS IBM AFP Utilities
ASSIST QSYS AS/400 Operational Assistant menu
BACKUP QSYS Backup menu
CFG QSYS Configuration
CFGCMN QSYS Configure Communications and Remote Hardware
CFGDEVCMN QSYS Configure Devices and Communications
CFGIPS QSYS Configure IP over SNA
CFGLCL QSYS Configure Local Hardware
CFGLST QSYS Configure Address and Location Lists
CFGNWS QSYS Configure Network Servers
CFGPCS QSYS Configure PC Connections
CFGSM QSYS Configure IBM System Manager for i5/OS
More...
main menu
After logging in to the IBM i machine, the MAIN menu appears on the first screen. We can also type GO MAIN on the command line to enter the MAIN menu.
MAIN IBM i Main Menu
Select one of the following:
1. User tasks
2. Office tasks
3. General system tasks
4. Files, libraries, and folders
5. Programming
6. Communications
7. Define or change the system
8. Problem handling
9. Display a menu
10. Information Assistant options
11. IBM i Access tasks
90. Sign off
Selection or command
Option ranges 1 through 11 are available on the MIAN menu, including option 90, which allows you to sign off from IBM i. There is a menu option from 1 to 11, and finally 90 for SIGN OFF. You can select any available option.
user menu
Take option 1 on the MAIN menu screen to access the USER menu.
USER User Tasks
Select one of the following:
1. Display or change your job
2. Display messages
3. Send a message
4. Submit a job
5. Work with your spooled output files
6. Work with your batch jobs
7. Display or change your library list
8. Change your password
9. Change your user profile
60. More user task options
90. Sign off
Office Task menu
Take option 2 on the MAIN menu screen to access the office task (OFCTSK) menu.
OFCTSK Office Tasks
Select one of the following:
2. IBM i Access tasks
3. Decision support
4. Office security
5. Work with directory entries
6. Documents
7. Folders
System menu
Take option 3 on the MAIN menu screen to access the system menu.
SYSTEM General System Tasks
Select one of the following:
1. Jobs
2. Status
3. Display system operator messages
4. Messages
5. Files, libraries, and folders
6. Save
7. Restore
8. Device operations
9. Communications
10. Security
60. More system task options
Some other helpful AS400 menus are available for use.
major menu
Type GO MAJOR on the command line to enter into this menu.
MAJOR Major Command Groups
System: PUB400
Select one of the following:
1. Select Command by Name SLTCMD
2. Verb Commands VERB
3. Subject Commands SUBJECT
4. Object Management Commands CMDOBJMGT
5. File Commands CMDFILE
6. Save and Restore Commands CMDSAVRST
7. Work Management Commands CMDWRKMGT
8. Data Management Commands CMDDTAMGT
9. Security Commands CMDSEC
10. Print Commands CMDPRT
11. Spooling Commands CMDSPL
12. System Control Commands CMDSYSCTL
13. Program Commands CMDPGM
More...
verb menu
Type GO VERB on the command line and press Enter to enter into this menu.
STRSDA utility invokes SDA(screen design aid) and creates a menu. Type STRSDA on the command line and press Enter. On the next screen, take option 2 (design menu) to create a menu. You can do this for practicing purposes on the accessible online public as400 server; for more details about the Menu, visit here.
Screen Design Aid (SDA)
Select one of the following:
1. Design screens
2. Design menus
3. Test display files
You must specify the menu name, source file, and library on the Design menu screen. It checks for the menu’s existence; if no menu exists with specified details, a menu gets created.
Design Menus
Type choices, press Enter.
Source file . . . . . . . . Name, F4 for list
Library . . . . . . . . . Name, *LIBL, *CURLIB
Menu . . . . . . . . . . . Name, F4 for list
Enter on the Specify Menu Functions display.
Specify Menu Functions
File . . . . . . : QDDSSRC Menu . . . . . . . : MENU1
Library . . . . : USER9999
Type choices, press Enter.
Work with menu image and commands . . . . . . Y Y=Yes, N=No
Work with menu help . . . . . . . . . . . . . N Y=Yes, N=No
Press Enter on the Specify menu functions screen, which will display the below screen with 10 options where you provide commands to every option.
MENU1 MENU1 Menu
Select one of the following:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
Selection or command
F3=Exit F10=Work with commands F12=Cancel
F13=Command area F20=Reverse F24=More keys
Press Help for a list of valid operations.
Add some menu options.
MENU1 MENU1 Menu
Select one of the following:
1. Create Physical File
2. Create Logical File
3. Create DSPF
4. Create PRTF
5. Create Program
6. Create Service Program
7. Sign Off
8.
9.
10.
Selection or command
F3=Exit F10=Work with commands F12=Cancel
F13=Command area F20=Reverse F24=More keys
Press Help for a list of valid operations.
SDA inserts the code in the backend DSPF source member from the inputs provided on the menu screen. The display attribute for each text string is contained in a hidden character that appears before each text block. SDA will display white or high-intensity text if you type an “H” directly before a text block and in reverse image when “R” and “D” will make the text disappear.
Define the commands for every selection after that. To input the commands, press F10 which is displayed below screen:
Define Menu Commands
Menu . . . . . . : MENU1 Position to menu option . . . . .
Type commands, press Enter.
Option Command
01
02
03
04
05
06
07
More...
F3=Exit F11=Defined only options F12=Cancel F24=More keys
This is where you input the commands linked to every choice. Thus, type the commands as follows:
Define Menu Commands
Menu . . . . . . : MENU1 Position to menu option . . . . .
Type commands, press Enter.
Option Command
01 CRTPF
02 CRTLF
03 CRTDSPF
04 CRTPRTF
05 CRTPGM
06 CRTSRVPGM
07 SIGNOFF
More...
F3=Exit F11=Defined only options F12=Cancel F24=More keys
To escape, press F3 a few times. Check the name of the “object library” after you quit SDA. Your compiled menu objects will be placed here.
Exit SDA Menus
File . . . . . . : QDDSSRC DDS member . . . . . : MENU1
Library . . . . : USER9999 Commands member . . . : MENU1QQ
Type choices, press Enter.
Save new or updated menu source . . . . Y Y=Yes, N=No
For choice Y=Yes:
Source file . . . . . . . . . . . . QDDSSRC Name,
F4 for list
Library . . . . . . . . . . . . . USER9999 Name, *LIBL, *CURLIB
Text . . . . . . . . . . . . . . . .
Replace menu members . . . . . . . . Y Y=Yes, N=No
Create menu objects . . . . . . . . . . Y Y=Yes, N=No
For choice Y=Yes:
Prompt for parameters . . . . . . . N Y=Yes, N=No
Object library . . . . . . . . . . . USER9999 Name, *CURLIB
Replace menu objects . . . . . . . . Y Y=Yes, N=No
Once you press Enter, the menu source gets compiled, and SDA will create three objects of the same name as the menu name but of type *MSGF, *FILE attribute DSPF, and *MENU attribute DSPF.
Work with Objects
Type options, press Enter.
2=Edit authority 3=Copy 4=Delete 5=Display
8=Display description 13=Change description
Opt Object Type Library Attribute Text
MENU1 *MSGF USER9999
MENU1 *FILE USER9999 DSPF
MENU1 *MENU USER9999 DSPF
as400 call menu
After the menu gets created, you can call that menu by typing GO <menu-name> on the command line and pressing Enter.
MENU1 MENU1 Menu
Select one of the following:
1. Create Physical File
2. Create Logical File
3. Create DSPF
4. Create PRTF
5. Create Prorgam
6. Create Service Program
7. Sign Off
8.
9.
10.
Selection or command
===>
A subsystem is an operating environment in as400 systems that manages resource allocation, usage, and job handling. Multiple subsystems that function independently of one another may be present in the system. A subsystem description is an object that defines a subsystem’s run-time properties. Jobs oRead more
A subsystem is an operating environment in as400 systems that manages resource allocation, usage, and job handling. Multiple subsystems that function independently of one another may be present in the system. A subsystem description is an object that defines a subsystem’s run-time properties. Jobs operate within the subsystem. The subsystem description explains the amount, location, and resource allocation of each work that enters the subsystem.
The following sections will review subsystems used for server jobs, IBM-supplied subsystems, create subsystems, start subsystems, end subsystems, work with subsystems, and commands, and check if subsystems are active.
Subsystem for server jobs
The server jobs are configured to operate in separate subsystems based on their function. The server jobs use the following subsystems.
QSYSWRK
QUSRWRK
QSERVER
QSYSWRK subsystem
This subsystem is responsible for running all daemon jobs.
QUSRWRK subsystem
Server jobs for the servers Network Print, Remote Command, Program Call, Central, Data Queue, Signon, and Database are executed in the QUSRWRK subsystem.
QSERVER subsystem
The file server and database server daemon jobs are executed in the QSERVER subsystem.
IBM subsystem
IBM provides the following subsystems, which are listed:
QBASE
QSERVER
QSPL
QSYSWRK
QUSRWRK
QCTL
QUINTER
QBATCH
QCMN
QBASE
One such controlling subsystem is the QBASE subsystem. Communication, Batch, and Interactive Jobs are supported. An autostart job starts the subsystems QSERVER, QSPL, and QUSRWRK.
QSERVER subsystem
A file server subsystem is called Qserver.
QSPL subsystem
Reader and writer jobs are supported by the QSPL subsystem, which is a spool subsystem.
QSYSWRK subsystem
A system work subsystem is called a QSYSWRK subsystem. It initiates automatically when the system boots up.
QUSRWRK subsystem
A user work subsystem is called QUSRWRK. It includes jobs that servers launch to carry out tasks for users.
QCTL subsystem
This subsystem is a control subsystem. It includes an autostart job that launches the QINTER, QBATCH, QCMN, QUSRWRK, QSERVER, and QSPL subsystems.
QUINTER subsystem
This subsystem facilitates interactive tasks.
QBATCH subsystem
This subsystem supports batch jobs.
QCMN subsystem
This subsystem supports the communication jobs to be executed within it, such as Client access and server jobs.
Create subsystem in as400
We must create the essential elements before creating a subsystem to carry out interactive and batch activities. After that, we can start or stop the subsystem. The following is a list of what has to be done first:
Subsystem Description
Job Queue
Class Object
Routing Entries
A few more actions after the subsystem is created:
Start subsystem
End subsystem
Create Subsystem Description
A system object, including general and storage pool definitions, is called a subsystem description. How the subsystem uses memory for work, where work can enter the subsystem, how much work it can manage, how much memory will be utilized for primary storage, and how storage pool properties determine the jobs run inside the subsystem.
The Subsystem Description can be created using the command CRTSBSD. CRTSBSD SBSD(libraryName/SubsystemName)
POOLS((1 *BASE))
MAXJOBS(10)
TEXT('Test subsystem')
10 jobs can be active at a time in the subsystem and operate in pool 1 with primary storage memory as *BASE.
Create job Queue
Use the CRTJOBQ command to create a job queue. CRTJOBQ JOBQ(LibraryName/JobQueueName) TEXT('Test Job Queue')
Add Job Queue Entry
After creating the JOBQ, use the command ADDJOBQE to attach it to the subsystem. ADDJOBQE SBSD(LibraryName/SubsystemName) JOBQ(LibraryName/JobQueueName) MAXACT(5)
The MAXACT option indicates the most jobs that this JOBQ can process concurrently.
Create Class
Use the CRTCLS command to create a class. CRTCLS CLS(LibraryName/ClassName) RUNPTY(40)
The class defines run time attributes like Run priority, Time slice, Default wait time, Maximum temporary storage, etc.
Add Routing Entry
The ADDRTGE command can add a routing entry to the subsystem description. To utilize routing entry 50, the character string TEST must begin at position 1 in the routing data. Through this item, any number of routing stages can be enabled at once. The programs will operate in storage pool 1 by utilizing the library class. ADDRTGE SBSD(LibraryName/SubsystemName) SEQNBR(50) CMPVAL(TEST)
PGM(LibraryName/ProgramName) CLS(LibraryName/ClassName)
Once the subsystem is created successfully, please follow the steps below.
Start subsystem
Start the subsystem by using the command STRSBS. The subsystem can be used to submit jobs once they have been started. STRSBS SBSD(LibraryName/SubsystemName)
End subsystem
The ENDSBS command terminates the subsystem. ENDSBS SBSD(SubsystemName) Work with subsystem
Use the command WRKSBS on the command line to work with the subsystem. Some important subsystem commands
Start subsystem command: Use the STRSBS command to initiate a subsystem.
End subsystem command: Use the ENDSBS command to terminate a subsystem.
Delete subsystem description command: Use the DLTSBSD command to eliminate a subsystem description. The subsystem must not be in an active state to use the DLTSBSD command.
Change subsystem description command: Use the CHGSBSD command to change the subsystem description.
Display subsystem description command: Use the DSPSBSD command to view the subsystem description.
Start subsystem using BRMS: Use the STRSBSBRM command to start a subsystem with BRMS.
Work with subsystem: Use the WRKSBS command to interact with subsystems.
Work with subsystem description: Use the WRKSBSD command to interact with subsystem descriptions.
Work with subsystem jobs: Use the WRKSBSJOB command to work with subsystem jobs.
Please follow these steps to copy the save file from IFS to the library. The first step is to create a save file in your library using the CRTSAVF command. CRTSAVF FILE(LIBNAME/SAVEFILENAME) For example, if the library name is TESTLIB and the save file name is SAVF1 then the command formed would beRead more
Please follow these steps to copy the save file from IFS to the library.
The first step is to create a save file in your library using the CRTSAVF command. CRTSAVF FILE(LIBNAME/SAVEFILENAME)
For example, if the library name is TESTLIB and the save file name is SAVF1 then the command formed would be CRTSAVF FILE(TESTLIB/SAVF1)
Use the CPY command to copy the IFS save file to the QSYS library. CPY OBJ(path/savefilename.savf)
TOOBJ(/qsys.lib/libname.lib/savefilename.file)
FROMCCSID(*PCASCII) TOCCSID(37) REPLACE(*YES)
For example, if the path is /home/developer, and save file name is savf1, and the library where the save file is to be copied is TESTLIB then the command formed would be CPY OBJ(/home/developer/savf1.savf)
TOOBJ(/qsys.lib/developer.lib/savf1.file)
FROMCCSID(*PCASCII) TOCCSID(37) REPLACE(*YES)
To transfer Savf from as400 to PC, follow the below steps: Open command prompt system 32. Type the cd desktop command in cmd and press Enter to change the directory to the desktop so the savf transfer happens from as400 to PC desktop. Type FTP and press Enter to start the savf transfer. Type open puRead more
To transfer Savf from as400 to PC, follow the below steps:
Open command prompt system 32.
Type thecd desktopcommand in cmd and press Enter to change the directory to the desktop so the savf transfer happens from as400 to PC desktop.
TypeFTPand press Enter to start the savf transfer.
Typeopen pub400.comand press Enter to open the connection with the as400 machine.
Once connected to the as400 machine, pub400.com, you will be asked toenter your user IDand then thepasswordof the as400 machine to log in to the as400 machine pub400.com.
Once log in successfully, TypeBINand press Enter to enter the binary mode.
To transfer Savf from as400 to PC, type the below command get /qsys.lib/libname.lib/savefile.savf testsav2.savf
wherelibnameis the name of the as400 library where savefile is present and savefile is the name of the save file to be transferred from as400 to PC.
You can open the command prompt using the start menu with the following steps: Open the Start menu. Type Run. Press Enter. Type cmd or cmd.exe. Press Enter. The shortcut key to open the Command Prompt is Windows Key +R and type cmd or cmd.exe in the Run command dialog box and press Enter to open theRead more
You can open the command prompt using the start menu with the following steps:
Open theStartmenu.
TypeRun.
PressEnter.
Typecmdorcmd.exe.
PressEnter.
Theshortcut key to open the Command Prompt is Windows Key +R and type cmd or cmd.exe in the Run command dialog box and press Enter to open the command prompt quickly.
You can copy the ifs file to another directory on IBM i (formerly AS400) by executing the following command. Use the CPY command to copy the IFS file to another directory. CPY OBJ(frompath/filename) TODIR(topath) REPLACE(*YES) where the frompath can be let’s say “/home/developer/” and the filename cRead more
You can copy the ifs file to another directory on IBM i (formerly AS400) by executing the following command. Use theCPYcommand to copy the IFS file to another directory. CPY OBJ(frompath/filename) TODIR(topath) REPLACE(*YES)
where thefrompathcan be let’s say “/home/developer/” and the filename can be “file1.zip” andtopathcan be let’s say “/developer/files/zipfiles”.
You can follow the below steps to copy savf from ifs to pc. Open the command prompt. Type the cd desktop command in cmd and press Enter to change the directory to the desktop so that we copy the savf from ifs to the PC desktop. Type FTP and press Enter to start the savf transfer. Type open pub400.coRead more
You can follow the below steps to copy savf from ifs to pc.
Open the command prompt.
Type thecd desktopcommand in cmd and press Enter to change the directory to the desktop so that we copy the savf from ifs to the PC desktop.
TypeFTPand press Enter to start the savf transfer.
Typeopen pub400.comand press Enter to open the connection with the as400 machine.
Once connected to the as400 machine, pub400.com, you will be asked toenter your user IDand then thepasswordof the as400 machine to log in to the as400 machine pub400.com.
Once log in successfully, TypeBINand press Enter to enter the binary mode.
To copy savf from IFS to PC, type the below command get /path/savefilename.savf where the path can be let’s say “/home/developer” or “/developer/rpg/savefiles”. it’s a user path where the savf is located in ifs and savefilename is the name of savf including its extension .savf.
we can copy the ifs file to the physical file using the CPYFRMIMPF (copy from import file) command. Like CPYTOIMPF command is used to copy physical files to ifs in the same way CPYFRMIMPF is used to copy physical files in ifs back to the physical file. CPYFRMIMPF FROMSTMF('/home/developer/pfname') TRead more
we can copy the ifs file to the physical file using the CPYFRMIMPF (copy from import file) command. Like CPYTOIMPF command is used to copy physical files to ifs in the same way CPYFRMIMPF is used to copy physical files in ifs back to the physical file.
here. cpyfrmimpf command parameter FROMSTMF received the value filename and ifs user path where the file is located. TOFILE parameter received the value library name/filename RCDDLM is *LFCR(line feed and carriage return) STRDLM(*NONE), by default its *DBLQUOTE and RMVCOLNAM(*YES), we need to remove column names if we have column names present in the ifs file.
You can copy the save file to ifs using the CPYTOSTMF command. The syntax of the Copy-to-stream file command is as follows: CPYTOSTMF FROMMBR('/qsys.lib/libname.lib/savefile.file') TOSTMF('/home/tester/savefile.savf') STMFOPT(*REPLACE) Pass the fully qualified save file name in the FROMMBR parameterRead more
You can copy the save file to ifs using the CPYTOSTMF command. The syntax of the Copy-to-stream file command is as follows: CPYTOSTMF FROMMBR('/qsys.lib/libname.lib/savefile.file')
TOSTMF('/home/tester/savefile.savf')
STMFOPT(*REPLACE)
Pass the fully qualified save file name in the FROMMBR parameter and pass the path/filename in the TOSTMF parameter. This command will copy the save file present in the library to the ifs path.
We can copy the spool file to IFS in three steps. Step 1: Create a dummy physical file named PF1 in the QTEMP library using the CRTPF command. CRTPF FILE(QTEMP/PF1) RCDLEN(200) Step 2: Copy the spool file to the physical file using the command CPYSPLF. CPYSPLF FILE(SpoolfileName) TOFILE(QTEMP/PF1) JRead more
We can copy the spool file to IFS in three steps.
Step 1: Create a dummy physical file named PF1 in the QTEMP library using the CRTPF command. CRTPF FILE(QTEMP/PF1) RCDLEN(200)
Step 2: Copy the spool file to the physical file using the command CPYSPLF. CPYSPLF FILE(SpoolfileName) TOFILE(QTEMP/PF1)
JOB(JobNumber/JobUser/JobName) SPLNBR(1)
Step 3:Copy the physical file to the ifsusing the CPYTOIMPF command.
Simply, we can copy the physical files to ifs by using the as400 command named CPYTOIMPF (Copy to import file). below are the CPYTOIMPF command syntax and parameters to be passed to copy the physical file to ifs. CPYTOIMPF FROMFILE(library/filename) TOSTMF('/path/filename') RCDDLM(*LFCR) STRDLM(*NONRead more
Simply, we can copy the physical files to ifs by using the as400 command named CPYTOIMPF (Copy to import file). below are the CPYTOIMPF command syntax and parameters to be passed to copy the physical file to ifs.
here cpytoimpf command parameter fromfile received value filename and library name where the file is located. TOSTMF parameter received the value /path/filename where the path can be /home/developer user home path let’s say and the filename is the file the user wants to keep. RCDDLM is *LFCR(line feed and carriage return) STRDLM(*NONE), by default it’s *DBLQUOTE and ADDCOLNAM(*SYS), it is *NONE, and if we want to keep the column names as well from the physical file in the ifs file then we can provide value as either *SYS or *SQL to either provide system name or SQL long names.
You can follow the below steps to copy a file from pc to your iSeries IFS. Open the command prompt. Type the cd desktop command in cmd and press Enter to change the directory to the desktop so the file from the PC desktop should be referred to during ftp. Type FTP and press Enter to start the file tRead more
You can follow the below steps to copy a file from pc to your iSeries IFS.
Open the command prompt.
Type thecd desktopcommand in cmd and press Enter to change the directory to the desktop so the file from the PC desktop should be referred to during ftp.
TypeFTPand press Enter to start the file transfer.
Typeopen pub400.comand press Enter to open the connection with the as400 machine.
Once connected to the as400 machine, pub400.com, you will be asked toenter your user IDand then thepasswordof the as400 machine to log in to the as400 machine pub400.com.
Once log in successfully, Typebinand press Enter to enter the binary mode.
To copy files from PC to iSeries ifs, type the below command put savefilename.savf /path/savefilename.savf
where the path can be let’s say /home/developer or /developer/RPG/savefiles. it’s a user path where the file should be copied in ifs from pc and the filename is the name of the save file.
We can use the Printer Output utility from the IBM i Access client solutions screen to download spool files from the as400 system. Here are the steps. Open IBM i ACS. Open the printer output. Click on Edit and then click on Filter… Set Filter dialog screen open where the user can set the filter critRead more
We can use the Printer Output utility from the IBM i Access client solutions screen to download spool files from the as400 system. Here are the steps.
Open IBM i ACS.
Open the printer output.
Click on Edit and then click on Filter…
Set Filter dialog screen open where the user can set the filter criteria to view the required spool file entry. The following filter criteria can be set and then click OK to set the filter.
Users can select the user profile that created the spool file.
Users can specify the OUTQ.
Users can specify the job information.
Users can also specify the from and to date and time for the spool created.
Select any or all spool files and right-click and click on Download… to download selected spool files from the AS400 system.
Download… dialog appears, select the location where you want to download the spool files, and then either uncheck the Use PDF format if available option to download ascii plain .txt file and if you want pdf format then keep selecting the checkbox for pdf format.
Click OK. This will download the spool file from as400 to pc in .txt format at the selected location.
If one has checked the PDF format checkbox this will download the spool file from as400 to pc in .pdf format at the selected location.
To delete a library in as400 follow the below steps: First, check the library should not be the system or the product library. The library object must exist in the QSYS library. Remove the library to be deleted from the library list if present. Change Job and set INQMSGRPY as *DFT using the commandRead more
To delete a library in as400 follow the below steps:
First, check the library should not be the system or the product library.
The library object must exist in the QSYS library.
Remove the library to be deleted from the library list if present.
Change Job and set INQMSGRPY as *DFT using the command CHGJOB INQMSGRPY(*DFT)
Check the ASP device name of the library.
Run the DLTLIB command to delete the library DLTLIB LIB(LibraryName) ASPDEV(aspdeviceName)
You can copy the data from as400 to Excel by using the data transfer utility by following some steps if you have Access Client Solution (ACS) installed at your end. Open IBM i ACS and then from the General menu open the Data Transfer utility. Once the Data transfer utility opens up, then select FromRead more
You can copy the data from as400 to Excel by using the data transfer utility by following some steps if you have Access Client Solution (ACS) installed at your end.
Open IBM i ACS and then from the General menu open the Data Transfer utility.
Once the Data transfer utility opens up, then select From IBM i tab to export data from as400 to Excel.
Select the already configured as400 system under the IBM i section.
Provide the qualified file name like library/filename that you want to export from the as400 system.
Select the output device as File under the file section.
Click on the details button and the File details dialog opens.
Select File Type as Microsoft Excel(.xlsx).
Select File action as per your choice/requirement.
Under the Client file description section check the Save client file description box.
Once you check the box, the File name box that was earlier disabled will get enabled and then click on browse to browse the file location where you want to save the .fdfx type file i.e. file description files, and now provide a file name and click on open that will close the dialog box.
Click on OK on the File Details dialog box to save file details.
Click on the Start Transfer button on the main Data Transfer From IBM i utility dialog box.
You may be asked to input your user ID and password and after that, the data will be copied from as400 to Excel.
The library in the AS400 system is a collection of different types of objects. QSYS is the system library and is the only available library in as400 that contains other libraries on the as400 system. Any other library other than QSYS cannot contain a library-type object. The object type for libraryRead more
The library in the AS400 system is a collection of different types of objects.
QSYS is the system library and is the only available library in as400 that contains other libraries on the as400 system. Any other library other than QSYS cannot contain a library-type object.
The object type for library type object is *LIB.
To create a library use the command CRTLIB.
We can also create the schema using the CREATE SCHEMA SQL statement that creates a library-type object and it differs from the library created using the CRTLIB command. The schema contains a journal and journal receiver by default which is not available in the library. that’s the difference between schema and library.
When you log in QSYS library gets loaded first as it is a root library.
To locate any library in ifs we should qualify it with root library QSYS. /qsys.lib/libname.lib
After login to the as400 system, a session gets created for the user and a temporary library is created in that session which is unique in each session which means that one session qtemp library cannot be accessed by another session or job.
After login to the as400 system, a default library list is set and the user can add libraries to the library list to call the program objects. you can edit the library list using the EDTLIBL command or add the library to the library list using the ADDLIBLE command.
There are four types of library list in as400
System library: The system library is an IBM-supplied library that begins with the letter Q or #. The system library is always present at the top of the library list. A maximum of 15 system libraries can be present on the library list at a time. To display the system libraries in the library list you can run the command DSPSYSVAL SYSVAL(QSYSLIBL) to view the system value QSYSLIBL that contains the default system libraries.
Product library: The product library is added to the library list automatically by the system programs when it is being used and later removed from the library list when the job uses the product library.
Current library: the current library is the work library where all our work is stored. To change the current library use the command CHGCURLIB.
User library: The user library is created by the user using the CRTLIB command or CREATE SCHEMA SQL statement. The user portion of the job can be stored in the job description i.e. JOBD type objects. You can display user libraries in the library list using the system value QUSRLIBL. Run command DSPSYSVAL SYSVAL(QUSRLIBL).
Several commands can be used with the library in as400
DSPLIBL: The display library list command is used to display all types of libraries as part of the library list. For example, system library, current library, user library, etc.
CRTLIB: The create library command is used to create a user library where one has to input the library name, library type, and description and can create a user library. Library type is of two types:
*PROD: When a user library is created using type *PROD means production library then files in the production library cannot be opened for update in debug mode. A user can specify *NO for the UPDPROD parameter (update production files) on the STRDBG command (Start debug) to start with testing. However, this option will not stop the program from being debugged to delete records or update other objects like data areas in the library.
*TEST: When a user library is created using type *TEST means test library. Files can be updated during testing.
DSPLIB: The display library command can be used to get the information of all the objects present in the given library with its size.
EDTLIBL: Edit library list command is used to edit the library list, you can add, remove, or change any library position on the library list.
ADDLIBLE: Add library list entry command to add library on the library list.
WRKLIBPDM: Work with libraries using the PDM command
CHGLIBL: Change library list command can be used to change the library list.
RMVLIBLE: Remove library list entry command can be used to change libraries from the library list.
You can use the SQL query to find the source physical file in AS400. Select * from QSYS.QADBXREF where DBXTYP = 'S' This query will fetch and list all the source physical files in the AS400 system.
You can use the SQL query to find the source physical file in AS400.
Select * from QSYS.QADBXREF where DBXTYP = 'S'
This query will fetch and list all the source physical files in the AS400 system.
To list all the libraries in as400 use the DSPOBJD command. Step 1: The DSPOBJD command will list out all the libraries on the as400 system and create an outfile. In the OUTFILE parameter input the library and file name where you want to create the outfile. DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*LIB) OUTPURead more
To list all the libraries in as400 use the DSPOBJD command.
Step 1:The DSPOBJD command will list out all the libraries on the as400 system and create an outfile. In the OUTFILE parameter input the library and file name where you want to create the outfile.
You can change the library list in as400 using commands like CHGLIBL, ADDLIBLE, EDTLIBL, and RMVLIBLE. At the admin level, one can change the job description (JOBD) parameter INLLIBL(Initial library list) of QDFTJOBD to the default job description in QGPL. This will change the library list for the wRead more
You can change the library list in as400 using commands likeCHGLIBL,ADDLIBLE,EDTLIBL, andRMVLIBLE.
At the admin level, one can change the job description (JOBD) parameter INLLIBL(Initial library list) ofQDFTJOBDto the default job description in QGPL. This will change the library list for the whole system.
For a particular session or job, we can copy this QDFTJOBD jobd object in one of our libraries that is on top of the library list and change the library list there in this QDFTJOBD job description.
You can use the ping and nslookup command to find the IP address. DNS lookup tool can be used as well. Using the ping command: Use the ping command from the command prompt. The ping command returns the IP address by verifying the response time. To find the IP address of a website using the ping commRead more
You can use thepingandnslookupcommand to find theIP address.DNS lookup toolcan be used as well.
Using the ping command:
Use the ping command from the command prompt. The ping command returns the IP address by verifying the response time.
To find the IP address of a website using the ping command,
Open the command promptand type ping domainname.com
Using the nslookup command:
Another option to check the IP address of a website is to use the nslookup command from the command prompt designed to look up the IP addresses. The nslookup command returns more information to the user than the ping command.
To find the IP address of a website using the nslookup command,open the command promptand type nslookup domainname.com
Using the DNS lookup tool to find the IP address of a website:
Both the ping and nslookup commands can be used to find a website’s IP address. However, using the DNS lookup tool is the simplest way to find the IP address of a website.
Visit theDNS lookup tool, Enter the domain name into the text entry, and click DNS Lookup.
An access path specifies how records from a database file are fetched. We can create permanent access paths such as PF/LF or temporary access paths using the command OPNQRYF. There are two types of access path Arrival sequence access path: records are fetched in the same order in which they were insRead more
An access path specifies how records from a database file are fetched. We can create permanent access paths such as PF/LF or temporary access paths using the command OPNQRYF.
There are two types of access path
Arrival sequence access path: records are fetched in the same order in which they were inserted in the file. This is similar to processing sequential files based on RRN.
Keyed sequence access path: records are fetched based on the contents of one or more key fields in the file.
You can specify the access path maintenance (MAINT) parameter. If a member of a file is opened, then the system maintains the access path for that member when changes are done to its stored data. However, there are chances that more than one access path might exist for the same data, therefore changing data in one member of a file might cause changes in the access path for other members of a file that are not currently opened. We can maintain access paths of all members of a file in the following ways:
Immediate: This is a default type of maintenance for a file. It means that a file member’s access path is maintained when its data is changed. For example, access paths for the referential constraint are in immediate maintenance.
Rebuild: It means that the access path is maintained for a file member only when the member is open. The access path is rebuilt when the member is opened next time. When a file member is closed, the system stops maintaining the access path for that member.
Delayed: This means that access path maintenance is done only when the member of a file is opened the next time. Access path changes are gathered when a member is closed and until it opens again. Once the member is opened again, only the gathered changes are merged into the access path.
Source Physical file: The source physical file contains the sources of different source members. This file has a specific structure. CRTSRCPF is the command used to create the source physical file. We can create up to 32767 members in a single source file. The source file is an object, but the sourcRead more
Source Physical file:
The source physical file contains the sources of different source members. This file has a specific structure. CRTSRCPF is the command used to create the source physical file. We can create up to 32767 members in a single source file. The source file is an object, but the source members contained within it are not objects.
The command used to create the source file is CRTSRCPF FILE(TESTLIB/QDDSSRC) RCDLEN(92)
RCDLEN parameter in the CRTSRCPF command indicates the record length of the source physical file. Record length refers to thenumber of bytes in the source physical file’s length of records.The record format of the source physical file consists of three fields.
Source sequence number
Date
Source statement
The default record length is 92 bytes. The source sequence number has 6 bytes, Date 6 has bytes, and the source statement has 80 bytes. The important thing about this is that the source sequence number (6 bytes) and the date (6 bytes) have fixed forms, which means that a total of 12 bytes are fixed—the remaining go toward the source statement. For the record’s length, which can reach 32766 bytes. Thus, the permissible values for record length span from 13 to 32766 bytes. The following are the sizes of some of the common source physical files.
QRPGSRC, QDDSSRC, QDDLSRC, QCLSRC, QCMDSRC, etc – record length of 92
QRGLESRC – a record length of 112 (92 default + 20 bytes of comment)
The AS400 command line tool WRKMBRPDM is used to view every source member of a source physical file. To add a new source member of any kind to the source physical file, use F6 on WRKMBRPDM.
Physical file:
The physical file contains data.
the command used to create a physical file is CRTPF.
create a physical file PF1 in library TESTLIB using source member PF1 present in source physical file QDDSSRC in TESTLIB CRTPF FILE(TESTLIB/PF1) SRCFILE(TESTLIB/QDDSSRC) SRCMBR(PF1)
Or create a physical file without a source member and of record length 92. CRTPF FILE(TESTLIB/PF1) RCDLEN(92)
A database file containing data records is referred to as a physical file. After that, the records are organized into physical file members, each of which has a unique access path to the data. The physical files should ideally have a single member by default, inserted immediately upon creation.
A physical file can have only one record format.
The physical file has four levels of entries, which are listed below in a certain order:
File Level
Record Format Level
Field Level
Key Field Level
File-level entries are optional.The keywords used at the file level are listed below:
UNIQUE
FIFO
LIFO
FCFO
REF
The record format name is specified along with an optional text description at the record format level. The keywords used at this level are listed below:
FORMAT
TEXT
Field name, length, and data type, along with option Text description and Column heading, are specified for each field at the field level. The keywords used at this level are listed below:
ALIAS
ALWNULL
CCSID
CHECK
CHKMSGID
CMP/COMP
COLHDG
DATFMT
DATSEP
DFT
EDTCDE
EDTWRD
REFFLD
REFSHIFT
TEXT
TIMFMT
TIMSEP
VALUES
VARLEN
Key field names are listed at key field level entries.Keywords used at this level are listed below:
When a program gets compiled, its source information is saved in the object. If the object is an ILE program, then you can find the source file information using the DSPPGM command, visit the module information for that program, and type 5 next to the respective module. This will show you the sourceRead more
When a program gets compiled, its source information is saved in the object. If the object is an ILE program, then you can find the source file information using the DSPPGM command, visit the module information for that program, and type 5 next to the respective module. This will show you the source file of the selected module. For example, Type the command DSPPGM PGM1 on the command line and press enter thrice to display a list of modules associated with the program object. Take option 5 to select the respective module for which you want to find the source file location and press enter; the source file location will be displayed as below:
Try this command. DSPOBJD OBJ(LibName/ObjectName) OBJTYPE(*FILE) DETAIL(*SERVICE)
You can also use List ILE program information API (QBNLPGMI). The details of the ILE program module, including source file and member information, are available to you in format PGML0100.
You can also use the listservice program information API (QBNLSPGM). The details of the service program module, including source file and member information, are available to you in the format SPFL0100.
To find the source file of an OPM program object, you can use either the DSPOBJD command Retrieve Program Information API (QCLRPGMI) or Retrieve Object Description API (QUSROBJD).
Please follow the steps below to change the record length of the source physical file to 400. Create a source physical file with a new name and a changed record length. Copy all the source members from the old source physical file to the new one. Be careful at this step. If the new record length isRead more
Please follow the steps below to change the record length of the source physical file to 400.
Create a source physical file with a new name and a changed record length.
Copy all the source members from the old source physical file to the new one.
Be careful at this step. If the new record length is shorter than the old src-pf, the code should not exceed the new record length. You may lose the source code in that case.
Rename the old source physical file to some other name.
Rename the new source physical file with the changed record length to the former name of the old one.
Delete the old source file that has been changed to some other name.
CPF4174 error is OPNID for a file that already exists. Also, EDCL008 failed on message CPF4174, causing the Job to terminate. This CPF4174 error comes in OPNQRYF. Message ID . . . . . . . . . : CPF4174 Message file . . . . . . . . : QCPFMSG Library . . . . . . . . . : QSYS Message . . . . : OPNID(Read more
CPF4174 error is OPNID for a file that already exists. Also, EDCL008 failed on message CPF4174, causing the Job to terminate.
This CPF4174 error comes in OPNQRYF.
Message ID . . . . . . . . . : CPF4174
Message file . . . . . . . . : QCPFMSG
Library . . . . . . . . . : QSYS
Message . . . . : OPNID(&4) for file &1 already exists.
Cause . . . . . : File &1 in library &2 cannot be opened with the OPNID(&4)
parameter specified on either the OPNDBF command or OPNQRYF command because
another file is already open with this parameter. If a member was
specified, it was &3.
Recovery . . . : Either specify a unique identifier in the OPNID parameter
value or close the file that was previously opened with this parameter (CLOF
command). Then try your request again.
You can use the CLOF command to close the file to resolve this error. CLOF OPNID(File)
CPF4174 error is OPNID(&4) for file &1 already exists.. The open query file (OPNQRYF) command opens a file for some set of records, and these records are accessed by an RPG program that shares the open data path (ODP). The path can be closed using the Close file (CLOF) command.
Varying keywords are used in D specs with character, graphic, and UCS-2 fields to make them variable-length fields. A 2-byte integer field gets added at the start of the field using the VARYING keyword. That 2-byte integer contains the length of the data in the varying field. For example, D FLDA1 SRead more
Varying keywords are used in D specs with character, graphic, and UCS-2 fields to make them variable-length fields. A 2-byte integer field gets added at the start of the field using the VARYING keyword. That 2-byte integer contains the length of the data in the varying field. For example,
D FLDA1 S 10 VARYING
In storage, the data in hex format would look like 0004E3C5E2E3404040404040. Here, 0004 is the hex value for decimal 4 that represents the length of data in the fld1. Hex value E3 is character ‘T’, C5 is ‘E’ and E2 is ‘S’, and 40 is space.
DDS stands for Data description specifications. It defines data attributes in the file description. PF, LF, DSPF, PRTF, and ICF files use DDS. We can create a file using DDS by following these steps: Write the DDS script for the source member in a source file. Create the file using the CL command foRead more
DDS stands for Data description specifications. It defines data attributes in the file description. PF, LF, DSPF, PRTF, and ICF files use DDS. We can create a file using DDS by following these steps:
Write the DDS script for the source member in a source file.
Create the file using the CL command for the respective file type.
The left side of the DDS positions 1 through 44 is called positional entries and is available for fixed format entries. This includes the record format name, field name, and length of the field. The right side of the DDS positions 45 through 80 are used for DDS keywords. This includes attributes of record format, files, and fields. The sequence number and form type are optional in DDS. An asterisk in position 8 makes the line a comment line. Position 17 indicates the name entry in positions 19 through 28.
Name entryRindicates a record format name. (used with All files)
Blankindicates a field name. (used with All files)
K indicates a key field name. (used with PF and LF only)
S indicates a select field name. (used with LF only)
O indicates an omit field name. (used with LF only)
J indicates a join specification. (used with Join LF only)
H indicates a help specification (used with Display file only)
R specified in position 29 indicates that it is a preferred field, and its definition is defined somewhere else. You can enter the DDS source using STRSEU. You create a DDS pf using the CRTPF command, a DDS LF using CRTLF, a DDS Display file using CRTDSPF, a DDS printer file using CRTPRTF, and a DDS ICF file using CRTICFF.
Following are the differences between PF and LF. PF stands for physical file whereas LF stands for Logical file. PF stores data in memory whereas LF does not store data in memory, it's an access path or a view over one or more PFs. CRTPF command is used to create PF object whereas CRTLF command is uRead more
Following are the differences between PF and LF.
PF stands for physical file whereas LF stands for Logical file.
PF stores data in memory whereas LF does not store data in memory, it’s an access path or a view over one or more PFs.
CRTPF command is used to create PF object whereas CRTLF command is used to create LF object.
PF can exist independently whereas a LF cannot exist without PF.
PF can have only one record format whereas the LF can contain 32 record formats.
PF cannot be deleted if any LF exists over it and LF can be deleted without deleting its parent PF.
The DSPDBR command is used with PF to get all dependents and the DSPFD command is used with LF to get its parent PF.
CHGPF is changing the physical file command in AS400, i.e., CHGPF. This command changes the PF attributes and structure without losing the actual data stored in PF. CHGPF FILE(TESTLIB/PF1) SRCFILE(PF1/QDDSSRC) SRCMBR(PF1) We can change the following attributes of a PF using the CHGPF command: MaximuRead more
CHGPF is changing the physical file command in AS400, i.e., CHGPF. This command changes the PF attributes and structure without losing the actual data stored in PF. CHGPF FILE(TESTLIB/PF1) SRCFILE(PF1/QDDSSRC) SRCMBR(PF1)
We can change the following attributes of a PF using the CHGPF command:
We can create physical files in AS400 using DDS. You can create a physical file in the library using QDDSSRC srcpf. To create a physical file, follow these steps: Write the DDS source for the physical file for the source member using SEU. A R RCDFMT1 A FLD1 10A A FLD2 5A A FLD3 2P 0 A FLD4 1A CreateRead more
We can create physical files in AS400 using DDS. You can create a physical file in the library using QDDSSRC srcpf. To create a physical file, follow these steps:
Write the DDS source for the physical file for the source member using SEU.
A R RCDFMT1
A FLD1 10A
A FLD2 5A
A FLD3 2P 0
A FLD4 1A
Create a physical file using the CRTPF command CRTPF FILE(TESTLIB/FILE1) TEXT('DDS based physical file')
There are many data types supported by physical files in as400, which are as follows: Character – entry A in fixed position 35. Binary – entry B Floating point – entry F Hexadecimal – entry H Date – entry L Packed decimal – entry P Zoned decimal – entry S Time – entry T Timestamp – entry Z Binary chRead more
There are many data types supported by physical files in as400, which are as follows:
Character– entryAin fixed position 35.
Binary– entryB
Floating point– entryF
Hexadecimal– entryH
Date– entryL
Packed decimal– entryP
Zoned decimal– entryS
Time– entryT
Timestamp– entryZ
Binarycharacter– entry5 There are also some DDS-supported DBCS data types.
DBCS only – entry J
DBCS either – entry E
Open – entry O
Graphics – entry G (UCS-2 or UTF-16)
Points to consider while implementing these data types in physical files.
Decimal places 36 and 37 for the Character data type (A) would be empty.
Decimal places 36 and 37 for Packed Decimal (P) and Zoned Decimal (S) data types (P) would hold values ranging from 0 to 63 maximum.
Position 37 would have the value 0 to indicate that it is a numeric field for data types such as packed, zoned, and binary fields.
The maximum length permitted for the Binary(B) data type is 18.
The maximum length permitted for the Float(F) data type with single precision and the FTPCN(*SINGLE) keyword applied is 9.
The maximum length permitted for the Float(F) data type with double precision and the FTPCN(*DOUBLE) keyword applied is 17.
Source code for defining character data type in the physical file: maximum allowed length for the character data type is 32766
A R RFMT1
A CHARF 32766A
The source code for defining Varying character data types in physical files:
The maximum allowed length for varying character data types is 32740, and the VARLEN keyword is used.
A R RFMT1
A CHARF 32740A VARLEN
Source code for defining Binary data type in the physical file:
the maximum allowed length for the character data type is 18.
A R RFMT1
A BINF 18B
Source code for defining Floating data type in physical file:
the maximum allowed length for floating data type is 9 for single precision.
A R RFMT1
A FLOATSF 9F FLTPCN(*SINGLE)
The maximum allowed length for the floating data type is 17 for double precision.
A R RFMT1
A FLOATDF 17F FLTPCN(*DOUBLE)
The source code for defining the Hexadecimal data type in the physical file:
the maximum allowed length for the hexadecimal data type is 32766.
A R RFMT1
A HEXDECF 32766H
Source code for defining Date data type in physical file
A R RFMT1
A DATEF L
Source code for defining Time data type in physical file
A R RFMT1
A TIMEF T
Source code for defining Timestamp data type in physical file
A R RFMT1
A TIMESTAMPF Z
The source code for defining the Packed decimal data type in the physical file:
the maximum allowed length for the packed decimal data type is 63. Either 63 numeric and decimal 0 or 0 numeric and decimal 63.
A R RFMT1
A PACKEDDECF 63P 0
A PACKEDDECL 63P63
The source code for defining the Zoned decimal data type in the physical file:
the maximum allowed length for the packed decimal data type is 63. Either 63 numeric and decimal 0 or 0 numeric and decimal 63.
A R RFMT1
A ZONEDDECF 63S 0
A ZONEDDECL 63S63
The source code for defining the Binary character data type in the physical file:
the maximum allowed length for the binary character data type is 32766.
A R RFMT1
A BINCHARF 327665
Source code for DDS-supported DBCS data type Source code for defining DBCS-only data type in the physical file:
the maximum allowed length for DBCS-only data type is 32766.
A R RFMT1
A DBCSONLYF 32766J
The source code for defining Varying DBCS-only data types in the physical file:
the maximum allowed length for varying DBCS-only data types is 32740.
A R RFMT1
A DBCSONLYF 32740J VARLEN
Source code for defining DBCS Either data type in the physical file:
the maximum allowed length for DBCS either data type is 32766.
A R RFMT1
A DBCSETHRF 32766E
Source code for defining Varying DBCS:
The maximum allowed length for varying DBCS data types in the physical file is 32740.
A R RFMT1
A DBCSETHRF 32740E VARLEN
The source code for defining the Open data type in the physical files:
the maximum allowed length for the open data type is 32766.
A R RCDFMT1
A OPEN1 32766O CCSID(65535)
The source code for defining Varying open data types in physical files:
the maximum allowed length for varying open data types is 32740.
A R RCDFMT1
A OPEN2 32740O CCSID(65535) VARLEN
Source code for defining Graphic data type in physical file:
the maximum allowed length for the open data type is 16383.
A R RFMT1
A GRAPA 16383G CCSID(1200)
A GRAPB 16383G CCSID(13488)
The source code for defining Varying graphic data types in physical files:
the maximum allowed length for varying open data types is 16370.
A R RFMT1
A GRAPA 16370G CCSID(1200) VARLEN
A GRAPB 16370G CCSID(13488) VARLEN
We can manually add data to the physical files using SQL INSERT in the STRSQL session or from Run SQL Script in as400. We can also use the UPDDATA command line command to add data to the physical file. Follow the below steps: Type UPDDTA on the command line and press F4. Provide a file name and librRead more
We can manually add data to the physical files using SQL INSERT in the STRSQL session or from Run SQL Script in as400.
We can also use the UPDDATA command line command to add data to the physical file. Follow the below steps:
Type UPDDTA on the command line and press F4.
Provide a file name and library, and membership is optional.
Press enter.
Press F9, you will enter in insert mode
Enter the values
Press Enter to add the record at the end of the file.
You can view journal entries using the Display Journal (DSPJRN) command. The journal entries can be displayed, printed, and written in the outfile. You can view journal entries in SQL using the table function DISPLAY_JOURNAL in the QSYS2 library. This table function returns information about journalRead more
You can view journal entries using the Display Journal (DSPJRN) command. The journal entries can be displayed, printed, and written in the outfile.
You can view journal entries in SQL using the table function DISPLAY_JOURNAL in the QSYS2 library. This table function returns information about journal entries and is similar to what the Display Journal (DSPJRN) command returns.
You can also use the Retrieve Journal Entries (QjoRetrieveJournalEntries) API to view information on journal entries.
You can use this SQL query SELECT * FROM TABLE(QSYS2.DISPLAY_JOURNAL( 'TESTLIB', 'Journal_Name')) AS JT
There are various uses of ovrdbf. Some of them are as follows: OVRDBF command can override the local file with a DDM file so that the program uses a remote rather than a local one. Using this command, you can change a physical file’s attribute. To access the file with a different name. To override aRead more
There are various uses ofovrdbf. Some of them are as follows:
OVRDBFcommand can override the local file with a DDM file so that the program uses a remote rather than a local one.
Using this command, you can change a physical file’s attribute.
To access the file with a different name.
To override a specific file member in case of a multimember file.
To override a file to point to the file in a specific library.
To override some of the parameters in the program, For example:
Position: It is used to specify the starting position for reading the records in the file. Possible values are *NONE, *START, *END, *RRN, *KEYB, *KEYBE, *KEY, *KEYAE, *KEYA.
OVRSCOPE: It is used to specify the scope of the override. Possible values are *ACTGRPDFN, *CALLVL, *JOB.
SHARE: It is used to specify whether the open data path would be shared with other programs in the job. Possible values are *NO, *YES.
OPNSCOPE: It is used to specify the scope of the open operation. Possible values are *ACTGRPDFN, *JOB.
For example, the OVRDBF command can be written as:
An array is a collection of elements with the same data type and length. We commonly utilize the keyword to define an array in an RPG program. An individual array element can be referred to by its location, while an array name refers to all its members in an RPG application. The array name must be uRead more
An array is a collection of elements with the same data type and length.
We commonly utilize the keyword to define an array in an RPG program.
An individual array element can be referred to by its location, while an array name refers to all its members in an RPG application.
The array name must be unique within the RPG program, and the array index must be numeric with zero decimal places.
If the RPG program attempted to use the array index ARR(Index) as zero, negative, or more than the number of elements defined in the DIM keyword, an error occurred during runtime. There are three types of arrays in RPG.
Run Time array: It is loaded by the RPG program while running. Compile Time array: It is loaded when an RPG program is compiled. Any data available in the compile-time array will not be modified unless the RPG programmer changes it and recreates the program object. Prerun Time array: It is loaded from the Array file when the program begins.
A data queue is a type of system object that can be created to send data to one program or process and receive data from another. The data-receiving program may be waiting or may receive the data later. A data queue is the quickest means to communicate between two jobs. There are many advantages ofRead more
A data queue is a type of system object that can be created to send data to one program or process and receive data from another. The data-receiving program may be waiting or may receive the data later.
A data queue is the quickest means to communicate between two jobs.
There are many advantages of using a data queue in as400:
When sending and receiving data, a data queue requires less overhead than any other method, including database files, message queues, or data areas.
By calling APIs QSNDDTAQ, QRCVDTAQ, QCLRDTAQ, QMHRDQM, QMHQRDQD, and QMHQCDQ from any high-level program or procedure, we can send, receive, clear, and retrieve the data or description of a data queue and change some attributes of the data queue without having to call any CL programs or exit the High-level program.
The same data queue can supply data to multiple jobs at once. When we process a lot of entries—more than one job could handle while maintaining performance—we gain some advantage in this situation.
Every message that is added to a data queue has the option of including the sender ID. The qualified job name and the current user profile are contained in the sender id.
We can configure the timeout so that, when data is being received from the data queue, the job waits for an entry to appear on the appropriate data queue.
To restore the data queue to a consistent state if a crash happens, we can journal the data queues.
Use SQL CALL statement to run the stored procedure in AS400. On the CALL statement, specify the stored procedure name and any parameters if required. The parameters include constants, special registers, host variables, or expression and SQL variables. To run the stored procedure, try to call using tRead more
Use SQL CALL statement to run the stored procedure in AS400. On the CALL statement, specify the stored procedure name and any parameters if required. The parameters include constants, special registers, host variables, or expression and SQL variables. To run the stored procedure, try to call using the name specified on the CREATE PROCEDURE statement. For example, consider a simple SQL stored procedure as follows:
CREATE PROCEDURE SQLInsertProc(
IN P_FLD1 CHAR(20),
IN P_FLD2 CHAR(1) )
SPECIFIC SQLPROC1
BEGIN
INSERT INTO PF1(FLD1,FLD2) VALUES(P_FLD1,P_FLD2);
END
To run this stored procedure, use the SQL CALL statement as follows: CALL SQLInsertProc('TEST', '1')
session device error can occur in the following situation The subfile SFLRCDNBR or SFLSIZ field has an incorrect record number. Even if no record gets loaded in the subfile, trying to display the subfile means the run is 0 during EXFMT execution and the SFLDSP indication is set *ON. try to display aRead more
session device error can occur in the following situation
The subfile SFLRCDNBR or SFLSIZ field has an incorrect record number.
Even if no record gets loaded in the subfile, trying to display the subfile means the run is 0 during EXFMT execution and the SFLDSP indication is set *ON.
try to display an empty subfile.
Attempt to write more than 9999 records for the Load All subfile on the Display file.
We usually get the error Session or device error occurred in file SubfileName (C G D F) when we try to display an empty subfile by setting the indicator ON associated with the SFLDSP keyword. So, setting the SFLDSP indicator off would resolve this session or device error. You may also get this session or device error if you do not include the SFLDSPCTL keyword in your subfile control record format.
This session or device error can also occur when the field and position in DDS are incorrect and display a window subfile in an incorrect position.
We can use DSPSYSVAL comamnd to check as400 system values. We can retrieve system values using the command RTVSYSVAL in the CL program as well. We can also use SQL to check as400 system values. SQL view SYSTEM_VALUE_INFO in the QSYS2 library to retrieve and check as400 system values. This SQL view SRead more
We can use DSPSYSVAL comamnd to check as400 system values.
We can retrieve system values using the command RTVSYSVAL in the CL program as well.
We can also use SQL to check as400 system values. SQL viewSYSTEM_VALUE_INFOin theQSYS2library to retrieve and check as400 system values. This SQL viewSYSTEM_VALUE_INFOcontains three fields.
System_value_name (varchar(10))
Current_numeric_value (Bigint)
Current_character_value (Vargraphic)
Current_numeric_value is null if the system value is not numeric, and Current_character_value is null if the system value is not a character; otherwise, they would have contained the values.
SQL to check as400 system values:
SELECT
SYSTEM_VALUE_NAME,
CURRENT_NUMERIC_VALUE,
CURRENT_CHARACTER_VALUE
FROM
QSYS2.SYSTEM_VALUE_INFO
To check triggers on a file, run the command Print trigger programs (PRTTRGPGM). It generates a report that includes all physical file triggers on your AS400 system. PRTTRGPGM command takes two input parameters, namely library and changed report only. We can pass the values in the library parameterRead more
To check triggers on a file, run the command Print trigger programs (PRTTRGPGM). It generates a report that includes all physical file triggers on your AS400 system. PRTTRGPGM command takes two input parameters, namely library and changed report only. We can pass the values in the library parameter as *LIBL, *USRLIBL, *CURLIB, *ALL, *ALLUSR, or Library name. In the changed report-only parameter, the default value is *NO i.e. full and changed reports will be printed. You can also pass *YES, which means only the changed report will be printed.
Once you run the PRTTRGPGM command with specified parameter values, a trigger program spool file QPSECTRG in your job gets generated. You can access it using the WRKSPLF command.
In the report, you will see specified library info that you passed in the first parameter, other information as a library, the file on which the trigger program is attached, ASP device, name of trigger, type, trigger program library, and name, time, event, condition, allow repeated change.
You can also use the DSPFD command outfile to check triggers on a file. Run the following command from the command line to create an outfile in the qtemp library. DSPFD FILE(TESTLIB/FILENAME)
TYPE(*TRG)
OUTPUT(*OUTFILE)
OUTFILE(QTEMP/OutFileName)
In the outfile you will receive a row when there is any trigger program associated with this file, otherwise, the outfile will be empty.
CPF4131 is a record format level check error. This indicates that the format level ID in the file at the time of program compilation is not found when the program opens the file. This means that the file structure has been changed after the program compilation. You must recompile your program to resRead more
CPF4131 is a record format level check error. This indicates that the format level ID in the file at the time of program compilation is not found when the program opens the file. This means that the file structure has been changed after the program compilation. You must recompile your program to resolve the CPF4131, i.e. level check error.
CPF4131 usually occurs when the program tries to access files whose record format differs from the record format level used during program compilation. The solution to level check error, i.e. CPF4131, could be to set the LVLCHK option (*NO) during file compilation. This will ensure that the record format will not be checked during file opening, but this is not a suggested approach to follow.
CPF4131 level check error can be resolved by recompiling the programs. Steps to follow to fix the CPF4131 error:
Run the DSPPGMREF command from the command line for the program experiencing a level check problem.
Verify the record format ID of the files in the program.
Compare the actual record format ID of the file by doing DSPFD on the file and the one stored in the DSPPGMREF output. If they are not equal, then recompile the program.
To find damaged objects in as400, we can follow the below steps: Run the DSPOBJD command from the command line and create an outfile in the QTEMP library. DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*ALL) OUTPUT(*OUTFILE) OUTFILE(QTEMP/A1) Once the outfile is created, start the Interactive SQL session and run thRead more
To find damaged objects in as400, we can follow the below steps:
Run the DSPOBJD command from the command line and create an outfile in the QTEMP library. DSPOBJD OBJ(*ALL/*ALL)
OBJTYPE(*ALL)
OUTPUT(*OUTFILE)
OUTFILE(QTEMP/A1)
Once the outfile is created, start the Interactive SQL session and run the following command from the command line. STRSQL
Run the following SQL query to find damaged objects in the AS400 system. SELECT odlbnm, odobnm, odobtx FROM qtemp/a1 WHERE odobdm <> '0'
Here, the odobdm field value 0 means the object is not damaged; if it’s other than 0, it’s damaged.
We can find damaged objects using the DSPOBJD command outfile, field ODOBDM values, which are as follows:
Modules help organize related tasks into smaller code units to be bound into programs or service programs. A module is a non-running object whose object type is *MODULE. Instead, They are called with either the bound call (CALLB in RPG) or a prototyped call (CALLP in RPG), as the dynamic CALL operatRead more
Modules help organize related tasks into smaller code units to be bound into programs or service programs.
A module is a non-running object whose object type is *MODULE. Instead, They are called with either the bound call (CALLB in RPG) or a prototyped call (CALLP in RPG), as the dynamic CALL operation is unavailable for them.
We can develop modules, particularly in large applications, because they allow code reuse. A module may consist of one or more procedures.
A procedure is a function that accepts parameters and returns values.
When using ILE, we must build a module object before creating a program object (*PGM) using the CRTPGM command or a service program object (*SRVPGM) with the CRTSRVPGM object.
During program or service program creation from the module object, all the compiled code is copied into the program or service program object. This code becomes routine/procedure in the program or service program, and there can be primary or sub-procedures. The main method has the same name as the module.
After that, the *Module object is no longer needed. We can delete it anytime if we want.
There are three types of RPG modules.
Module with the cycle-main procedure: The module consists of a cycle-main procedure that includes logic for a complete RPG cycle and zero or more subprocedures. It can be called using a bound call or a program call. Module with the linear-main procedure: The module consists of a linear-main procedure identified by the MAIN keyword on the control specs and zero or more procedures. It can only be called using a program call. It cannot be called using a bound call. Module with no main procedure: The module contains only subprocedures and the NOMAIN keyword on the control specs. This type of module does not include logic for the RPG cycle, and it cannot be the program entry module of a program since it has no main procedure. It can only be called using a bound call.
To create a binding directory, use the command CRTBNDDIR as follows: CRTBNDDIR BNDDIR(TESTLIB/BNDDIR1) A binding directory is an object of type *BNDDIR. We can add entries to the binding directory using the command ADDBNDDIRE. ADDBNDDIRE BNDDIR(TESTLIB/BNDDIR1) OBJ((TESTLIB/SRVPGM1 *SRVPGM)) We canRead more
To create a binding directory, use the command CRTBNDDIR as follows: CRTBNDDIR BNDDIR(TESTLIB/BNDDIR1)
A binding directory is an object of type *BNDDIR. We can add entries to the binding directory using the command ADDBNDDIRE. ADDBNDDIRE BNDDIR(TESTLIB/BNDDIR1) OBJ((TESTLIB/SRVPGM1 *SRVPGM))
We can add service programs or modules to the binding directory. Only names get added, not the object, and it gets picked when the program executes and has this binding directory attached.
Commands used with binding directories, such as RMVBNDDIRE and WRKBNDDIRE.
RMVBNDDIRE BNDDIR(EASYCLASS1/B1)
OBJ((EASYCLASS1/TEST *SRVPGM))
and WRKBNDDIRE BNDDIR(TESTLIB/BNDDIR1)
We can create an ifs folder using System I Navigator. Follow the below steps to create an ifs folder in the as400 machine. Open the System i Navigator. Click on the plus symbol (+) next to the Server (IP or domain). After node expansion, Click on the plus symbol (+) next to File Systems. After nodeRead more
We can create an ifs folder using System I Navigator. Follow the below steps to create an ifs folder in the as400 machine.
Open the System i Navigator.
Click on the plus symbol (+) next to the Server (IP or domain).
After node expansion, Click on the plus symbol (+) next to File Systems.
After node expansion, Click on the plus symbol (+) next to Integrated File System.
After node expansion, Click on Root.
A dialog for creating a New folder appears, enter the new folder name in the respective field and click OK, leaving other fields as it is.
The Ifs folder is the ifs directory. So, we can create an ifs directory from the server end. Use the mkdir(make directory) command to create an ifs folder(directory) in the AS400 system.
TypeMKDIRon the command line, then press F4. Enter your new folder name, including the complete path back to the root.
mkdir ()API can create a new or sub-directory in the IFS. mkdir() is make directory API. The prototypes inCandRPGlanguage for mkdir() API are as follows:
C prototype of mkdir():
int mkdir(const char *path, mode_t mode)
RPG prototype of mkdir() in fixed format:
D mkdir PR 10I 0 ExtProc('mkdir')
D dirpath * Value options(*string)
D mode 10U 0 Value
mkdir() accepts two parameters and returns an integer value.
Pathparameter where we specify the folder/directory to be created.
Themodeparameter is the access permissions assigned to the directory during creation.
mkdir() API returns -1 if the API call fails and 0 if it’s successful.
Here is the RPG code in fixed format to create an ifs folder in as400.
HDFTACTGRP(*NO)
D mkdir PR 10I 0 ExtProc('mkdir')
D dirpath * Value options(*string)
D mode 10U 0 Value
*
D errorifs PR * ExtProc('__errno')
*
D strerror PR * ExtProc('strerror')
D error_num 10I 0 value
*
Dreturn_mkdir s 10i 0 inz
D dirpath s 512a inz
D mode s 10U 0 inz
Derror_ptr S *
Derror_num S 10I 0 based(error_ptr)
Derrormsg_ptr S *
Derror_msg S 50a based(errormsg_ptr)
*
* owner,group,other (RWX)
* owner authority
D M_readowner C 256
D M_writeowner C 128
D M_executeowner C 64
* group authority
D M_readgroup C 32
D M_writegroup C 16
D M_executegroup C 8
* other people
D M_readother C 4
D M_writeother C 2
D M_executeother C 1
*
C EVAL dirpath = '/home/developer/dir1'
C EVAL mode = M_readowner +
C M_writeowner
C EVAL return_mkdir = mkdir(%trim(dirpath):mode)
C IF return_mkdir < 0
C EVAL error_ptr = errorIFS()
C EVAL errormsg_ptr = strerror(error_num)
C error_msg DSPLY
C RETURN
C ELSE
C 'DIR1 CREATED'DSPLY
C ENDIF
Here is the RPG code in free format to create an ifs folder in as400.
HDFTACTGRP(*NO)
D mkdir PR 10I 0 ExtProc('mkdir')
D dirpath * Value options(*string)
D mode 10U 0 Value
*
D errorifs PR * ExtProc('__errno')
*
D strerror PR * ExtProc('strerror')
D error_num 10I 0 value
*
Dreturn_mkdir s 10i 0 inz
D dirpath s 512a inz
D mode s 10U 0 inz
Derror_ptr S *
Derror_num S 10I 0 based(error_ptr)
Derrormsg_ptr S *
Derror_msg S 50a based(errormsg_ptr)
* <-----mode---->
* owner,group,other (RWX)
* owner authority
D M_readowner C 256
D M_writeowner C 128
D M_executeowner C 64
* group authority
D M_readgroup C 32
D M_writegroup C 16
D M_executegroup C 8
* other people
D M_readother C 4
D M_writeother C 2
D M_executeother C 1
*
/Free
dirpath = '/home/developer/dir1';
mode = M_readowner +
M_writeowner ;
return_mkdir = mkdir(%trim(dirpath):mode);
if return_mkdir < 0;
error_ptr = errorIFS();
errormsg_ptr = strerror(error_num);
DSPLY error_msg;
return;
else;
DSPLY 'DIR1 CREATED';
endif;
/End-Free
Here is the fully free RPG code to create an IFS folder in AS400.
ASP is an auxiliary storage pool. It is one or more physical disk units that are connected to the same storage region. ASP is available on IBM I servers, and several disk storage units are grouped to form an ASP. ASP is a collection of internal storage area networks (SAN) and other types of accessedRead more
ASP is an auxiliary storage pool. It is one or more physical disk units that are connected to the same storage region.
ASP is available on IBM I servers, and several disk storage units are grouped to form an ASP. ASP is a collection of internal storage area networks (SAN) and other types of accessed disks on IBM i. There are different types of ASP storage, ranging from 1 to 255.
System ASP (ASP 1): It is automatically created for an IBM i system, which means it is a default ASP. This consists of disk storage unit 1 and other unassigned system ASP containing OS objects, licensed programs, etc. Basic ASP (ASP 2 through ASP 32): We can create a basic ASP by combining a set of storage units and assigning that group to an unused ASP number. This ASP is assigned to only one IBM i server. Independent ASP (ASP 33 through ASP 255): This ASP is available to be used by local and remote IBM i servers. They were created for multiple purposes, such as database segregation, uninterrupted business, etc. It is possible to switch this ASP between IBM i servers.
All jobs that are submitted go into the Job Queue (JOBQ), Jobs waiting in the job queue (type *JOBQ) to be processed. Use the CRTJOBQ command to create a JOBQ. CRTJOBQ JOBQ(TESTLIB/JOBQ1) TEXT('Test Job Queue') After creating a JOBQ, it needs to be assigned to a subsystem only then we can execute joRead more
All jobs that are submitted go into the Job Queue (JOBQ), Jobs waiting in the job queue (type *JOBQ) to be processed.
Use the CRTJOBQ command to create a JOBQ. CRTJOBQ JOBQ(TESTLIB/JOBQ1) TEXT('Test Job Queue')
After creating a JOBQ, it needs to be assigned to a subsystem only then we can execute jobs within that JOBQ.
Add a job queue (JOBQ) entry to the subsystem description to associate a Job queue to the subsystem.
Use the ADDJOBQE command to add JOBQ to the subsystem ADDJOBQE SBSD(SBSYSTEM1) JOBQ(TESTLIB/JOBQ1) MAXACT(*NOMAX) SEQNBR(5)
The PSDS keyword for a free-form definition or the S letter, which appears in the 23rd position in a fixed format RPG, is used to identify it. It offers information on program exceptions and errors that the program can access. To ensure that each module can only have a single PSDS, it must be defineRead more
The PSDS keyword for a free-form definition or the S letter, which appears in the 23rd position in a fixed format RPG, is used to identify it. It offers information on program exceptions and errors that the program can access.
To ensure that each module can only have a single PSDS, it must be defined in the main source section. Predefined subfields are present in a PSDS.
Declaring PSDS in Fixed format RPG program:
* Program status data structure
* program exception available to rpg program (1 psds per module)
D psds1 SDS
D proc_name *proc * module/program
* 1 to 10 position, 10 chars
D pgm_status *status * status code
* 11 to 15 position, (5,0) zoned decimal
D pgm_prvstatus 16 20S 0 * Prev. status
D src_listing 21 28 * src. list line
D routine *routine * routine
* 29 to 36 position, 8 chars
* *INIT --> program initialization
* *DETL --> detail lines
* *GETIN --> get input record
* *TOTC --> Total calculations
* *TOTL --> Total lines
* *DETC --> Detail calculations
* *OFL --> Overflow lines
* *TERM --> Program ending
* *ROUTINE --> name of program or procedure called (first 8 chars)
D parms *parms * no. of parms pass
* 37 to 39 position, (3,0) zoned decimal
D excptype 40 42 * exception type
* CPF --> operating system exception
* MCH --> machine exception
D excpnum 43 46 * exception number
* CPF --> CPF message number
* MCH --> MCH message number
D reserved1 47 50 * reserved
D workarea 51 80 * internal use by
* ILE RPG compiler
D pgmlib 81 90 * prgram library
D excpdata 91 170 * exception data
D excpcause 171 174 * exception that
* cause RNX9001
D filename 175 184 * file name on whic
*h last file operati
*on occur updated on
*ly when error occur
D unused 185 190 * unused
D date 191 198 * date(*date format)
D yy 199 200S 0 * first two digits
* of 4 digit year
D filenametrn 201 208 * file name truncate
* (175-184 pos above
D statusinfo 209 243 * status info on las
*t file used
D jobname 244 253 * job name
D username 254 263 * user name
D jobnumber 264 269 * job number
D date2 270 275S 0 * date (udate format
* pgm running
* (191-198 pos above
D pgmrundate 276 281S 0 * date of pgm runnin
D time 282 287S 0 * time (hhmmss)
* pgm running
D date3 288 293 * date (udate format
* pgm compiled
D time2 294 299 * time (hhmmss)
* pgm compiled
D cmplevel 300 303 * compiler level
D srcfile 304 313 * src file name
D srclib 314 323 * src lib name
D srcmbr 324 333 * src file member
D pgmproc 334 343 * pgm containing
* procedure
D modproc 344 353 * module containing
* procedure
D srcid 354 355B 0 * src id match the
* binary 2 (5i,0)
* statement number
* from pos 21-28
D srcid2 356 357B 0 * src id match the
* binary 2 (5i,0)
* statement number
* from pos 228-235
D curuserprf 358 367 * current user profi
D exterrorcd 368 371I 0 * external error cod
* Integer (10,0)
D elements 372 379I 0 * elements set by XM
* Integer (20,0)
*L-INTO or DATA-INTO
D internaljobid 380 395 * internal job id
D systemname 396 403 * system name
D unused2 404 429
We can declare program status data structure in rpgle free format as follows:
**FREE
// Program status data structure
// program exception which is available to rpg program // (1 psds per module is asllowd))
dcl-ds psdsname psds;
proc_name *proc; //name of the module or program position 1 to 10 (10 chars)
pgm_status *status; //status code position 11 to 15 (5,0) zoned decimal
pgm_previousstatus zoned(5);// Previous status
source_listing char(8); // source list line
routineName *routine; // routine name position 29 to 36, (8 chars)
// *INIT --> program initialization &
// *DETL --> detail lines &
// *GETIN --> get the input record
// *TOTC --> Total calculations
// *TOTL --> Total lines
// *DETC --> Detail calculations
// *OFL --> Overflow lines
// *TERM --> Program ending
// *ROUTINE --> name of program or procedure called (first 8 chars)
params *parms; // no. of parms pass position 37 to 39, (3,0) zoned decimal
exceptionType char(3); // exception type
// CPF --> operating system exception
// MCH --> machine exception
exceptionNumber char(4);//exception number
// CPF --> CPF message number
// MCH --> MCH message number
reserved1 char(4);// reserved
workarea char(30); // internal use by ILE RPG compiler
programlibrary char(10); // prgram library
exceptiondata char(80); // exception data
exceptioncause char(4); //exception that cause RNX9001
filecname char(10); // file name on whicc last file
// operation occur updated only when error occur
unused char(6); //unused
date char(8); //date(*date format)
yy zoned(2); //first two digits of 4 digit year
filenametruncate char(8); // file name truncate 175-184 pos above
statusinfo char(35); // status info on last file used
jobname char(10); // job name
username char(10); // user name
jobnumber zoned(6); //job number
date2 zoned(6); // date (udate format pgm running (191-198 pos above
programrundate zoned(6); // date of pgm running
time zoned(6); // time (hhmmss) pgm running
date3 char(6); // date (udate format pgm compiled
time2 char(6); // time (hhmmss) pgm compiled
compilerlevel char(4); // compiler level
sourcefile char(10); // src file name
sourcelibrary char(10); // src lib name
sourcemember char(10); //src file member
programprocedure char(10); // pgm containing procedure
moduleprocedure char(10); // module that contains procedure
sourceid bindec(2); // source id that match the statement number from pos 21-28
sourceid2 bindec(2); // src id that match the statement number from pos 228-235 binary 2 (5i,0)
currentuserprofile char(10); // this is current user profile
externalerrorcode int(10); // this is external error code Integer (10,0)
elements int(20); //his is elements set by XML-INTO or DATA-INTO Integer (20,0)
internaljobid char(16); //this is internal job id
systemName char(8); // this is system name
unused2 char(6); // this is unused field
end-ds;
What are AS400 systems. Please provide a introduction of AS400 systems?
In AS400, "AS" stands for Application system. This article discusses what AS400 is, its history, the operating system it uses, its features, use, and other essential things. Introduction Let me first talk about what the AS400 system is. It is a midrange server introduced by IBM in 1988 in Rochester,Read more
In AS400, “AS” stands for Application system. This article discusses what AS400 is, its history, the operating system it uses, its features, use, and other essential things.
Introduction
Let me first talk about what the AS400 system is. It is a midrange server introduced by IBM in 1988 in Rochester, Minnesota. It is a compact mainframe system that replaces System/36 and System/38.
History
Let’s look at the history of AS400. The AS400 system was renamed several times, from eServer iSeries in 2000 to System i in 2006. Later, in 2008, System I merged with System P and became Power System.
For more information, please read IBM’s history of AS400 in detail.
Operating System
OS400 is the operating system used. OS400 is now known as the IBM i power system. The current version of the operating system is IBM i 7.4 which supports logical partitioning (LPAR) where multiple OS can run simultaneously on the same IBM i machine.
Features
The AS400 is an object-oriented system where everything is an object. It uses files to store data. It interfaces with hardware via a technology-independent machine interface (TIMI) rather than directly and is not dependent on any specific technology. Customers can switch their applications to new hardware technology at any time.
AS400 has software for communications, backup, and recovery. It has an inbuilt DB2 database. It’s a safe, multiuser and multitasking system. Additionally, it supports file systems, web application servers, and web service servers, among other tools. The system consists of Independently installed software components called licensed programs. The changes made to the parts require a PTF. Hence, we can install PTFs permanently or temporarily.
Use
AS400 is used in businesses that value safety, stability, and dependability. Several corporate applications use AS400, such as Manufacturing, Finance, Transportation and logistics, Banks, ERP, etc.
Cloud
AS400 cloud services are now provided by Amazon web services, Google Cloud platform, Microsoft Azure, etc.
Technical introduction
It contains a sizeable library-based operating system. It supports programming languages such as RPG, COBOL, Assembly, C, C++, Java, PHP, Python, REXX, CL, and SQL.
Several CASE tools are available on AS400 systems, such as Accelerator, Synon, LANSA, IBM Rational Business Developer Extension, etc.
AS400 developers generally use programming languages such as RPG, CL, SQL DB2, Java, XML, etc.
It uses an integrated language environment (ILE) programming environment, which allows us to create single programs from modules in different programming languages such as C, C++, RPG, CL, COBOL, etc. It fully supports the Java language. Several IBM i terminal emulators are available for accessing AS400, such as IBM i ACS, Mocha TN5250, and 5250 emulators. It supports both JDBC and ODBC connectivity. It offers a command and menu-driven interface. This system works in a single operating environment known as a subsystem.
Careers
AS400 is still in high demand in 2024. Many companies globally use AS400 systems. Freshers can opt for several roles in this technology, as indicated below.
Integrations
IBMi can share data and communicate with other systems. Moreover, it integrates with file servers, web apps, etc. It can integrate with SAP and JD Edwards. WordPress is hosted on IBM i servers and powers websites and online commerce. Tableau and Power BI tools connect to Salesforce and IBM i databases. IBM i is compatible with iOS and Android mobile OS. Social media networks such as Facebook, LinkedIn, and X (formerly Twitter) integrate with it. E-commerce sites such as Shopify, Amazon, and others are compatible with it. IBM I can integrate with banks and payment gateway for secure transactions. IBM i can integrate with their party software/services using APIs and Web services. The operating system supports Oracle, SQL Server, MySQL, DB2, etc.
Where can I learn more about IBM i?
You can refer to the following material to learn about IBM i technology.
Explore the IBM i system
Conclusion
AS400 is a midrange server now known as a power system. IBM i 7.5 is the current version of the operating system, and it is object-oriented. It is a very stable system, and some firms have adopted the As400 cloud services. IBM i can integrate with other external systems.
AS400 is still in high demand in 2024. Many companies globally use AS400 systems. Freshers can opt for several roles in this technology, as indicated below.
Integrations
IBMi can share data and communicate with other systems. Moreover, it integrates with file servers, web apps, etc. It can integrate with SAP and JD Edwards. WordPress is hosted on IBM i servers and powers websites and online commerce. Tableau and Power BI tools connect to Salesforce and IBM i databases. IBM i is compatible with iOS and Android mobile OS. Social media networks such as Facebook, LinkedIn, and X (formerly Twitter) integrate with it. E-commerce sites such as Shopify, Amazon, and others are compatible with it. IBM I can integrate with banks and payment gateway for secure transactions. IBM i can integrate with their party software/services using APIs and Web services. The operating system supports Oracle, SQL Server, MySQL, DB2, etc.
Where can I learn more about IBM i?
You can refer to the following material to learn about IBM i technology.
Explore the IBM i system
Conclusion
AS400 is a midrange server now known as a power system. IBM i 7.5 is the current version of the operating system, and it is object-oriented. It is a very stable system, and some firms have adopted the As400 cloud services. IBM i can integrate with other external systems.
See lessIs there any online server available for practicing on AS400 system?
PUB400 is an accessible online IBM i server where anyone can create a user profile and get access to the server. Additionally, they will get 500 MB of disk storage and two private libraries for their practice. PUB400 is hosting IBM i 7.5. This was started in the year 2000, and according to the PUB40Read more
PUB400 is an accessible online IBM i server where anyone can create a user profile and get access to the server. Additionally, they will get 500 MB of disk storage and two private libraries for their practice. PUB400 is hosting IBM i 7.5. This was started in the year 2000, and according to the PUB400 website reports, this server has more than 40K active user profiles globally.
PUB400 sign up – as400 server sign up
To start practicing on the PUB400 server, you must first register at pub400.com. Click here to join pub400 at any time. To register on PUB400, you must provide your first and last name, email address, and IBM I user name, agree to their terms and conditions, and submit the registration form. This will trigger an email with the instructions to do next.
Pub400 IP address
Pub400 IP address is 185.113.5.134.
Pub400 connection – as400 server connection
Install and open Access Client Solutions (ACS) software on your Windows machine. After that, start ACS and enter pub400.com as the Destination Address. You are prompted to enter your username and password that you get from PUB400.
Pub400 User forum
After creating your user profile on PUB40, you can now ask questions and share your knowledge on a community forum run by PUB400. To access the pub400 community forum, you must validate your user ID and password. Here, you will find information regarding PUB400.com announcements.
PUB400 not working
If you face connectivity issues with pub400, visit the FAQ page on PUB400.com.
Free tools on as400 server
On the PUB400 IBM i server, you will see that several free tools are installed on the server, such as iQuery, IBM i Report Server by KDP, FFD, and AL400S. Click here for additional details.
See lessWhat are the menus available in AS400?
Menus provides access to various AS400 commands and the system functionalities. The menu name appears on the top left corner of a menu and can be seen by invoking that menu. Also, each menu provides a command line from where we can select any options provided on the menu. Type GO <menu-name> oRead more
Menus provides access to various AS400 commands and the system functionalities. The menu name appears on the top left corner of a menu and can be seen by invoking that menu. Also, each menu provides a command line from where we can select any options provided on the menu. Type GO <menu-name> on the command line and press enter to access any specific menu.
Display All as400 menu
Use the GO *ALL command to display a list of all available menus in the AS400 system.
main menu
After logging in to the IBM i machine, the MAIN menu appears on the first screen. We can also type GO MAIN on the command line to enter the MAIN menu.
Option ranges 1 through 11 are available on the MIAN menu, including option 90, which allows you to sign off from IBM i. There is a menu option from 1 to 11, and finally 90 for SIGN OFF. You can select any available option.
user menu
Take option 1 on the MAIN menu screen to access the USER menu.
Office Task menu
Take option 2 on the MAIN menu screen to access the office task (OFCTSK) menu.
System menu
Take option 3 on the MAIN menu screen to access the system menu.
Some other helpful AS400 menus are available for use.
major menu
Type GO MAJOR on the command line to enter into this menu.
verb menu
Type GO VERB on the command line and press Enter to enter into this menu.
Create a menu in as400
STRSDA utility invokes SDA(screen design aid) and creates a menu. Type STRSDA on the command line and press Enter. On the next screen, take option 2 (design menu) to create a menu. You can do this for practicing purposes on the accessible online public as400 server; for more details about the Menu, visit here.
You must specify the menu name, source file, and library on the Design menu screen. It checks for the menu’s existence; if no menu exists with specified details, a menu gets created.
Enter on the Specify Menu Functions display.
Press Enter on the Specify menu functions screen, which will display the below screen with 10 options where you provide commands to every option.
Add some menu options.
SDA inserts the code in the backend DSPF source member from the inputs provided on the menu screen. The display attribute for each text string is contained in a hidden character that appears before each text block. SDA will display white or high-intensity text if you type an “H” directly before a text block and in reverse image when “R” and “D” will make the text disappear.
Define the commands for every selection after that. To input the commands, press F10 which is displayed below screen:
This is where you input the commands linked to every choice. Thus, type the commands as follows:
To escape, press F3 a few times. Check the name of the “object library” after you quit SDA. Your compiled menu objects will be placed here.
Once you press Enter, the menu source gets compiled, and SDA will create three objects of the same name as the menu name but of type *MSGF, *FILE attribute DSPF, and *MENU attribute DSPF.
as400 call menu
After the menu gets created, you can call that menu by typing GO <menu-name> on the command line and pressing Enter.
What is subsystem in AS400?
A subsystem is an operating environment in as400 systems that manages resource allocation, usage, and job handling. Multiple subsystems that function independently of one another may be present in the system. A subsystem description is an object that defines a subsystem’s run-time properties. Jobs oRead more
A subsystem is an operating environment in as400 systems that manages resource allocation, usage, and job handling. Multiple subsystems that function independently of one another may be present in the system. A subsystem description is an object that defines a subsystem’s run-time properties. Jobs operate within the subsystem. The subsystem description explains the amount, location, and resource allocation of each work that enters the subsystem.
The following sections will review subsystems used for server jobs, IBM-supplied subsystems, create subsystems, start subsystems, end subsystems, work with subsystems, and commands, and check if subsystems are active.
Subsystem for server jobs
The server jobs are configured to operate in separate subsystems based on their function. The server jobs use the following subsystems.
QSYSWRK subsystem
This subsystem is responsible for running all daemon jobs.
QUSRWRK subsystem
Server jobs for the servers Network Print, Remote Command, Program Call, Central, Data Queue, Signon, and Database are executed in the QUSRWRK subsystem.
QSERVER subsystem
The file server and database server daemon jobs are executed in the QSERVER subsystem.
IBM subsystem
IBM provides the following subsystems, which are listed:
One such controlling subsystem is the QBASE subsystem. Communication, Batch, and Interactive Jobs are supported. An autostart job starts the subsystems QSERVER, QSPL, and QUSRWRK.
QSERVER subsystem
A file server subsystem is called Qserver.
QSPL subsystem
Reader and writer jobs are supported by the QSPL subsystem, which is a spool subsystem.
QSYSWRK subsystem
A system work subsystem is called a QSYSWRK subsystem. It initiates automatically when the system boots up.
QUSRWRK subsystem
A user work subsystem is called QUSRWRK. It includes jobs that servers launch to carry out tasks for users.
QCTL subsystem
This subsystem is a control subsystem. It includes an autostart job that launches the QINTER, QBATCH, QCMN, QUSRWRK, QSERVER, and QSPL subsystems.
QUINTER subsystem
This subsystem facilitates interactive tasks.
QBATCH subsystem
This subsystem supports batch jobs.
QCMN subsystem
This subsystem supports the communication jobs to be executed within it, such as Client access and server jobs.
Create subsystem in as400
We must create the essential elements before creating a subsystem to carry out interactive and batch activities. After that, we can start or stop the subsystem. The following is a list of what has to be done first:
A few more actions after the subsystem is created:
Create Subsystem Description
A system object, including general and storage pool definitions, is called a subsystem description. How the subsystem uses memory for work, where work can enter the subsystem, how much work it can manage, how much memory will be utilized for primary storage, and how storage pool properties determine the jobs run inside the subsystem.
The Subsystem Description can be created using the command CRTSBSD.
CRTSBSD SBSD(libraryName/SubsystemName)
POOLS((1 *BASE))
MAXJOBS(10)
TEXT('Test subsystem')
10 jobs can be active at a time in the subsystem and operate in pool 1 with primary storage memory as *BASE.
Create job Queue
Use the
CRTJOBQ
command to create a job queue.CRTJOBQ JOBQ(LibraryName/JobQueueName) TEXT('Test Job Queue')
Add Job Queue Entry
After creating the JOBQ, use the command
ADDJOBQE
to attach it to the subsystem.ADDJOBQE SBSD(LibraryName/SubsystemName) JOBQ(LibraryName/JobQueueName) MAXACT(5)
The
MAXACT
option indicates the most jobs that this JOBQ can process concurrently.Create Class
Use the
CRTCLS
command to create a class.CRTCLS CLS(LibraryName/ClassName) RUNPTY(40)
The class defines run time attributes like Run priority, Time slice, Default wait time, Maximum temporary storage, etc.
Add Routing Entry
The
ADDRTGE
command can add a routing entry to the subsystem description. To utilize routing entry 50, the character string TEST must begin at position 1 in the routing data. Through this item, any number of routing stages can be enabled at once. The programs will operate in storage pool 1 by utilizing the library class.ADDRTGE SBSD(LibraryName/SubsystemName) SEQNBR(50) CMPVAL(TEST)
PGM(LibraryName/ProgramName) CLS(LibraryName/ClassName)
Once the subsystem is created successfully, please follow the steps below.
Start subsystem
Start the subsystem by using the command
STRSBS
. The subsystem can be used to submit jobs once they have been started.STRSBS SBSD(LibraryName/SubsystemName)
End subsystem
The
ENDSBS
command terminates the subsystem.ENDSBS SBSD(SubsystemName)
Work with subsystem
Use the command
WRKSBS
on the command line to work with the subsystem.Some important subsystem commands
STRSBS
command to initiate a subsystem.ENDSBS
command to terminate a subsystem.DLTSBSD
command to eliminate a subsystem description. The subsystem must not be in an active state to use the DLTSBSD command.CHGSBSD
command to change the subsystem description.DSPSBSD
command to view the subsystem description.STRSBSBRM
command to start a subsystem with BRMS.WRKSBS
command to interact with subsystems.WRKSBSD
command to interact with subsystem descriptions.WRKSBSJOB
command to work with subsystem jobs.How to copy a save file from IFS to a library?
Please follow these steps to copy the save file from IFS to the library. The first step is to create a save file in your library using the CRTSAVF command. CRTSAVF FILE(LIBNAME/SAVEFILENAME) For example, if the library name is TESTLIB and the save file name is SAVF1 then the command formed would beRead more
Please follow these steps to copy the save file from IFS to the library.
The first step is to create a save file in your library using the CRTSAVF command.
CRTSAVF FILE(LIBNAME/SAVEFILENAME)
For example, if the library name is TESTLIB and the save file name is SAVF1 then the command formed would be
CRTSAVF FILE(TESTLIB/SAVF1)
Use the CPY command to copy the IFS save file to the QSYS library.
CPY OBJ(path/savefilename.savf)
TOOBJ(/qsys.lib/libname.lib/savefilename.file)
FROMCCSID(*PCASCII) TOCCSID(37) REPLACE(*YES)
For example, if the path is
See less/home/developer
, and save file name issavf1
, and the library where the save file is to be copied isTESTLIB
then the command formed would beCPY OBJ(/home/developer/savf1.savf)
TOOBJ(/qsys.lib/developer.lib/savf1.file)
FROMCCSID(*PCASCII) TOCCSID(37) REPLACE(*YES)
How to transfer savf from as400 to pc?
To transfer Savf from as400 to PC, follow the below steps: Open command prompt system 32. Type the cd desktop command in cmd and press Enter to change the directory to the desktop so the savf transfer happens from as400 to PC desktop. Type FTP and press Enter to start the savf transfer. Type open puRead more
To transfer Savf from as400 to PC, follow the below steps:
get /qsys.lib/libname.lib/savefile.savf testsav2.savf
where
libname
is the name of the as400 library where savefile is present and savefile is the name of the save file to be transferred from as400 to PC.How can I open Command Prompt?
You can open the command prompt using the start menu with the following steps: Open the Start menu. Type Run. Press Enter. Type cmd or cmd.exe. Press Enter. The shortcut key to open the Command Prompt is Windows Key +R and type cmd or cmd.exe in the Run command dialog box and press Enter to open theRead more
You can open the command prompt using the start menu with the following steps:
The shortcut key to open the Command Prompt is Windows Key +R and type cmd or cmd.exe in the Run command dialog box and press Enter to open the command prompt quickly.
See lessHow to copy ifs file to another directory?
You can copy the ifs file to another directory on IBM i (formerly AS400) by executing the following command. Use the CPY command to copy the IFS file to another directory. CPY OBJ(frompath/filename) TODIR(topath) REPLACE(*YES) where the frompath can be let’s say “/home/developer/” and the filename cRead more
You can copy the ifs file to another directory on IBM i (formerly AS400) by executing the following command. Use the CPY command to copy the IFS file to another directory.
See lessCPY OBJ(frompath/filename) TODIR(topath) REPLACE(*YES)
where the
frompath
can be let’s say “/home/developer/” and the filename can be “file1.zip” andtopath
can be let’s say “/developer/files/zipfiles”.How to copy savf from ifs to pc?
You can follow the below steps to copy savf from ifs to pc. Open the command prompt. Type the cd desktop command in cmd and press Enter to change the directory to the desktop so that we copy the savf from ifs to the PC desktop. Type FTP and press Enter to start the savf transfer. Type open pub400.coRead more
You can follow the below steps to copy savf from ifs to pc.
get /path/savefilename.savf
where the path can be let’s say “/home/developer” or “/developer/rpg/savefiles”. it’s a user path where the savf is located in ifs and
savefilename
is the name of savf including its extension .savf.How to copy ifs file to physical file?
we can copy the ifs file to the physical file using the CPYFRMIMPF (copy from import file) command. Like CPYTOIMPF command is used to copy physical files to ifs in the same way CPYFRMIMPF is used to copy physical files in ifs back to the physical file. CPYFRMIMPF FROMSTMF('/home/developer/pfname') TRead more
we can copy the ifs file to the physical file using the
CPYFRMIMPF
(copy from import file) command. Like CPYTOIMPF command is used to copy physical files to ifs in the same way CPYFRMIMPF is used to copy physical files in ifs back to the physical file.CPYFRMIMPF FROMSTMF('/home/developer/pfname')
TOFILE(libname/filename)
MBROPT(*replace)
RCDDLM(*LFCR)
STRDLM(*NONE)
RMVCOLNAM(*YES)
here.
See lesscpyfrmimpf
command parameter FROMSTMF received the value filename and ifs user path where the file is located. TOFILE parameter received the value library name/filename RCDDLM is *LFCR(line feed and carriage return) STRDLM(*NONE), by default its *DBLQUOTE and RMVCOLNAM(*YES), we need to remove column names if we have column names present in the ifs file.How to copy save file to ifs?
You can copy the save file to ifs using the CPYTOSTMF command. The syntax of the Copy-to-stream file command is as follows: CPYTOSTMF FROMMBR('/qsys.lib/libname.lib/savefile.file') TOSTMF('/home/tester/savefile.savf') STMFOPT(*REPLACE) Pass the fully qualified save file name in the FROMMBR parameterRead more
You can copy the save file to ifs using the CPYTOSTMF command. The syntax of the Copy-to-stream file command is as follows:
See lessCPYTOSTMF FROMMBR('/qsys.lib/libname.lib/savefile.file')
TOSTMF('/home/tester/savefile.savf')
STMFOPT(*REPLACE)
Pass the fully qualified save file name in the
FROMMBR
parameter and pass thepath/filename
in theTOSTMF
parameter. This command will copy the save file present in the library to the ifs path.How to copy spool file to ifs?
We can copy the spool file to IFS in three steps. Step 1: Create a dummy physical file named PF1 in the QTEMP library using the CRTPF command. CRTPF FILE(QTEMP/PF1) RCDLEN(200) Step 2: Copy the spool file to the physical file using the command CPYSPLF. CPYSPLF FILE(SpoolfileName) TOFILE(QTEMP/PF1) JRead more
We can copy the spool file to IFS in three steps.
Step 1: Create a dummy physical file named PF1 in the QTEMP library using the CRTPF command.
See lessCRTPF FILE(QTEMP/PF1) RCDLEN(200)
Step 2: Copy the spool file to the physical file using the command CPYSPLF.
CPYSPLF FILE(SpoolfileName) TOFILE(QTEMP/PF1)
JOB(JobNumber/JobUser/JobName) SPLNBR(1)
Step 3: Copy the physical file to the ifs using the CPYTOIMPF command.
How to copy physical file to ifs?
Simply, we can copy the physical files to ifs by using the as400 command named CPYTOIMPF (Copy to import file). below are the CPYTOIMPF command syntax and parameters to be passed to copy the physical file to ifs. CPYTOIMPF FROMFILE(library/filename) TOSTMF('/path/filename') RCDDLM(*LFCR) STRDLM(*NONRead more
Simply, we can copy the physical files to ifs by using the as400 command named
CPYTOIMPF
(Copy to import file). below are theCPYTOIMPF
command syntax and parameters to be passed to copy the physical file to ifs.CPYTOIMPF FROMFILE(library/filename) TOSTMF('/path/filename')
RCDDLM(*LFCR) STRDLM(*NONE) ADDCOLNAM(*SYS)
here
See lesscpytoimpf
command parameter fromfile received value filename and library name where the file is located.TOSTMF
parameter received the value/path/filename
where the path can be/home/developer
user home path let’s say and the filename is the file the user wants to keep.RCDDLM
is*LFCR
(line feed and carriage return)STRDLM(*NONE)
, by default it’s*DBLQUOTE
andADDCOLNAM(*SYS)
, it is*NONE
, and if we want to keep the column names as well from the physical file in the ifs file then we can provide value as either*SYS
or*SQL
to either provide system name or SQL long names.How to copy file from pc to IFS/
You can follow the below steps to copy a file from pc to your iSeries IFS. Open the command prompt. Type the cd desktop command in cmd and press Enter to change the directory to the desktop so the file from the PC desktop should be referred to during ftp. Type FTP and press Enter to start the file tRead more
You can follow the below steps to copy a file from pc to your iSeries IFS.
put savefilename.savf /path/savefilename.savf
where the path can be let’s say
See less/home/developer
or/developer/RPG/savefiles
. it’s a user path where the file should be copied in ifs from pc and the filename is the name of the save file.How to download spool file from AS400?
We can use the Printer Output utility from the IBM i Access client solutions screen to download spool files from the as400 system. Here are the steps. Open IBM i ACS. Open the printer output. Click on Edit and then click on Filter… Set Filter dialog screen open where the user can set the filter critRead more
We can use the Printer Output utility from the IBM i Access client solutions screen to download spool files from the as400 system. Here are the steps.
How do I delete a library in AS400?
To delete a library in as400 follow the below steps: First, check the library should not be the system or the product library. The library object must exist in the QSYS library. Remove the library to be deleted from the library list if present. Change Job and set INQMSGRPY as *DFT using the commandRead more
To delete a library in as400 follow the below steps:
CHGJOB INQMSGRPY(*DFT)
DLTLIB LIB(LibraryName) ASPDEV(aspdeviceName)
How do I copy data from AS400 to excel?
You can copy the data from as400 to Excel by using the data transfer utility by following some steps if you have Access Client Solution (ACS) installed at your end. Open IBM i ACS and then from the General menu open the Data Transfer utility. Once the Data transfer utility opens up, then select FromRead more
You can copy the data from as400 to Excel by using the data transfer utility by following some steps if you have
Access Client Solution
(ACS) installed at your end.ACS
and then from the General menu open the Data Transfer utility.Data transfer utility
opens up, then select From IBM i tab to export data from as400 to Excel.library/filename
that you want to export from the as400 system.output device
as File under the file section.details button
and the File details dialog opens..xlsx
)..fdfx
type file i.e. file description files, and now provide a file name and click on open that will close the dialog box.user ID
andpassword
and after that, the data will be copied from as400 to Excel.What is library in AS400?
The library in the AS400 system is a collection of different types of objects. QSYS is the system library and is the only available library in as400 that contains other libraries on the as400 system. Any other library other than QSYS cannot contain a library-type object. The object type for libraryRead more
The library in the AS400 system is a collection of different types of objects.
QSYS
is the system library and is the only available library in as400 that contains other libraries on the as400 system. Any other library other thanQSYS
cannot contain a library-type object.*LIB
.CRTLIB
.CREATE SCHEMA
SQL statement that creates a library-type object and it differs from the library created using theCRTLIB
command. The schema contains a journal and journal receiver by default which is not available in the library. that’s the difference between schema and library.QSYS
library gets loaded first as it is a root library./qsys.lib/libname.lib
EDTLIBL
command or add the library to the library list using the ADDLIBLE command.Q
or#
. The system library is always present at the top of the library list. A maximum of 15 system libraries can be present on the library list at a time. To display the system libraries in the library list you can run the commandDSPSYSVAL SYSVAL(QSYSLIBL)
to view the system valueQSYSLIBL
that contains the default system libraries.CHGCURLIB
.CRTLIB
command orCREATE SCHEMA
SQL statement. The user portion of the job can be stored in the job description i.e.JOBD
type objects. You can display user libraries in the library list using the system valueQUSRLIBL
. Run commandDSPSYSVAL SYSVAL(QUSRLIBL)
.*PROD
means production library then files in the production library cannot be opened for update in debug mode. A user can specify *NO for theUPDPROD
parameter (update production files) on theSTRDBG
command (Start debug) to start with testing. However, this option will not stop the program from being debugged to delete records or update other objects like data areas in the library.*TEST
means test library. Files can be updated during testing.QGPL
is the general-purpose library in AS400.How to find all the source physical file available in AS400?
You can use the SQL query to find the source physical file in AS400. Select * from QSYS.QADBXREF where DBXTYP = 'S' This query will fetch and list all the source physical files in the AS400 system.
You can use the SQL query to find the source physical file in AS400.
Select * from QSYS.QADBXREF where DBXTYP = 'S'
This query will fetch and list all the source physical files in the AS400 system.
See lessHow to find all libraries in AS400?
To list all the libraries in as400 use the DSPOBJD command. Step 1: The DSPOBJD command will list out all the libraries on the as400 system and create an outfile. In the OUTFILE parameter input the library and file name where you want to create the outfile. DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*LIB) OUTPURead more
To list all the libraries in as400 use the DSPOBJD command.
Step 1: The DSPOBJD command will list out all the libraries on the as400 system and create an outfile. In the OUTFILE parameter input the library and file name where you want to create the outfile.
DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*LIB) OUTPUT(OUTFILE) OUTFILE(Library/Outfile)
Step 2: Once the outfile is created in
Step 1
, then just query the file in the STRSQL session and the field ODOBNM is the name of the library object.
See lessSelect ODOBNM from library/outfile
How to change the library list in AS400?
You can change the library list in as400 using commands like CHGLIBL, ADDLIBLE, EDTLIBL, and RMVLIBLE. At the admin level, one can change the job description (JOBD) parameter INLLIBL(Initial library list) of QDFTJOBD to the default job description in QGPL. This will change the library list for the wRead more
You can change the library list in as400 using commands like
CHGLIBL
,ADDLIBLE
,EDTLIBL
, andRMVLIBLE
.At the admin level, one can change the job description (JOBD) parameter INLLIBL(Initial library list) of
QDFTJOBD
to the default job description in QGPL. This will change the library list for the whole system.For a particular session or job, we can copy this QDFTJOBD jobd object in one of our libraries that is on top of the library list and change the library list there in this QDFTJOBD job description.
See lessHow to find the IP address of a website?
You can use the ping and nslookup command to find the IP address. DNS lookup tool can be used as well. Using the ping command: Use the ping command from the command prompt. The ping command returns the IP address by verifying the response time. To find the IP address of a website using the ping commRead more
You can use the
ping
andnslookup
command to find theIP address
.DNS lookup tool
can be used as well.Using the ping command:
Use the ping command from the command prompt. The ping command returns the IP address by verifying the response time.
To find the IP address of a website using the ping command,
ping domainname.com
Using the nslookup command:
Another option to check the IP address of a website is to use the nslookup command from the command prompt designed to look up the IP addresses. The nslookup command returns more information to the user than the ping command.
To find the IP address of a website using the nslookup command, open the command prompt and type
nslookup domainname.com
Using the DNS lookup tool to find the IP address of a website:
Both the ping and nslookup commands can be used to find a website’s IP address. However, using the DNS lookup tool is the simplest way to find the IP address of a website.
Visit the DNS lookup tool, Enter the domain name into the text entry, and click DNS Lookup.
See lessWhat is access path in AS400?
An access path specifies how records from a database file are fetched. We can create permanent access paths such as PF/LF or temporary access paths using the command OPNQRYF. There are two types of access path Arrival sequence access path: records are fetched in the same order in which they were insRead more
An access path specifies how records from a database file are fetched. We can create permanent access paths such as PF/LF or temporary access paths using the command OPNQRYF.
There are two types of access path
You can specify the access path maintenance (MAINT) parameter. If a member of a file is opened, then the system maintains the access path for that member when changes are done to its stored data. However, there are chances that more than one access path might exist for the same data, therefore changing data in one member of a file might cause changes in the access path for other members of a file that are not currently opened. We can maintain access paths of all members of a file in the following ways:
What is the difference between source physical file and physical file in as400?
Source Physical file: The source physical file contains the sources of different source members. This file has a specific structure. CRTSRCPF is the command used to create the source physical file. We can create up to 32767 members in a single source file. The source file is an object, but the sourcRead more
Source Physical file:
The source physical file contains the sources of different source members. This file has a specific structure. CRTSRCPF is the command used to create the source physical file. We can create up to 32767 members in a single source file. The source file is an object, but the source members contained within it are not objects.
The command used to create the source file is
CRTSRCPF FILE(TESTLIB/QDDSSRC) RCDLEN(92)
RCDLEN parameter in the CRTSRCPF command indicates the record length of the source physical file. Record length refers to the number of bytes in the source physical file’s length of records. The record format of the source physical file consists of three fields.
The default record length is 92 bytes. The source sequence number has 6 bytes, Date 6 has bytes, and the source statement has 80 bytes. The important thing about this is that the source sequence number (6 bytes) and the date (6 bytes) have fixed forms, which means that a total of 12 bytes are fixed—the remaining go toward the source statement. For the record’s length, which can reach 32766 bytes. Thus, the permissible values for record length span from 13 to 32766 bytes. The following are the sizes of some of the common source physical files.
The AS400 command line tool WRKMBRPDM is used to view every source member of a source physical file. To add a new source member of any kind to the source physical file, use F6 on WRKMBRPDM.
Physical file:
The physical file contains data.
the command used to create a physical file is CRTPF.
create a physical file PF1 in library TESTLIB using source member PF1 present in source physical file QDDSSRC in TESTLIB
CRTPF FILE(TESTLIB/PF1) SRCFILE(TESTLIB/QDDSSRC) SRCMBR(PF1)
Or create a physical file without a source member and of record length 92.
CRTPF FILE(TESTLIB/PF1) RCDLEN(92)
A database file containing data records is referred to as a physical file. After that, the records are organized into physical file members, each of which has a unique access path to the data. The physical files should ideally have a single member by default, inserted immediately upon creation.
A physical file can have only one record format.
The physical file has four levels of entries, which are listed below in a certain order:
File-level entries are optional. The keywords used at the file level are listed below:
The record format name is specified along with an optional text description at the record format level. The keywords used at this level are listed below:
Field name, length, and data type, along with option Text description and Column heading, are specified for each field at the field level. The keywords used at this level are listed below:
Key field names are listed at key field level entries. Keywords used at this level are listed below:
how to find the source file of an object in as400?
When a program gets compiled, its source information is saved in the object. If the object is an ILE program, then you can find the source file information using the DSPPGM command, visit the module information for that program, and type 5 next to the respective module. This will show you the sourceRead more
When a program gets compiled, its source information is saved in the object. If the object is an ILE program, then you can find the source file information using the DSPPGM command, visit the module information for that program, and type 5 next to the respective module. This will show you the source file of the selected module. For example, Type the command DSPPGM PGM1 on the command line and press enter thrice to display a list of modules associated with the program object. Take option 5 to select the respective module for which you want to find the source file location and press enter; the source file location will be displayed as below:
Try this command.
DSPOBJD OBJ(LibName/ObjectName) OBJTYPE(*FILE) DETAIL(*SERVICE)
You can also use List ILE program information API (QBNLPGMI). The details of the ILE program module, including source file and member information, are available to you in format PGML0100.
You can also use the listservice program information API (QBNLSPGM). The details of the service program module, including source file and member information, are available to you in the format SPFL0100.
To find the source file of an OPM program object, you can use either the DSPOBJD command Retrieve Program Information API (QCLRPGMI) or Retrieve Object Description API (QUSROBJD).
See lesshow to change record length of source physical file in as400?
Please follow the steps below to change the record length of the source physical file to 400. Create a source physical file with a new name and a changed record length. Copy all the source members from the old source physical file to the new one. Be careful at this step. If the new record length isRead more
Please follow the steps below to change the record length of the source physical file to 400.
What is cpf4174 error in as400?
CPF4174 error is OPNID for a file that already exists. Also, EDCL008 failed on message CPF4174, causing the Job to terminate. This CPF4174 error comes in OPNQRYF. Message ID . . . . . . . . . : CPF4174 Message file . . . . . . . . : QCPFMSG Library . . . . . . . . . : QSYS Message . . . . : OPNID(Read more
CPF4174 error is OPNID for a file that already exists. Also, EDCL008 failed on message CPF4174, causing the Job to terminate.
This CPF4174 error comes in OPNQRYF.
You can use the
CLOF
command to close the file to resolve this error.CLOF OPNID(File)
CPF4174 error is
See lessOPNID(&4) for file &1 already exists.
. The open query file (OPNQRYF) command opens a file for some set of records, and these records are accessed by an RPG program that shares the open data path (ODP). The path can be closed using the Close file (CLOF) command.What is the use of varying keyword in rpgle?
Varying keywords are used in D specs with character, graphic, and UCS-2 fields to make them variable-length fields. A 2-byte integer field gets added at the start of the field using the VARYING keyword. That 2-byte integer contains the length of the data in the varying field. For example, D FLDA1 SRead more
Varying keywords are used in D specs with character, graphic, and UCS-2 fields to make them variable-length fields. A 2-byte integer field gets added at the start of the field using the VARYING keyword. That 2-byte integer contains the length of the data in the varying field. For example,
In storage, the data in hex format would look like 0004E3C5E2E3404040404040. Here, 0004 is the hex value for decimal 4 that represents the length of data in the fld1. Hex value E3 is character ‘T’, C5 is ‘E’ and E2 is ‘S’, and 40 is space.
See lessWhat is DDS in AS400?
DDS stands for Data description specifications. It defines data attributes in the file description. PF, LF, DSPF, PRTF, and ICF files use DDS. We can create a file using DDS by following these steps: Write the DDS script for the source member in a source file. Create the file using the CL command foRead more
DDS stands for Data description specifications. It defines data attributes in the file description. PF, LF, DSPF, PRTF, and ICF files use DDS. We can create a file using DDS by following these steps:
The left side of the DDS positions 1 through 44 is called positional entries and is available for fixed format entries. This includes the record format name, field name, and length of the field. The right side of the DDS positions 45 through 80 are used for DDS keywords. This includes attributes of record format, files, and fields. The sequence number and form type are optional in DDS. An asterisk in position 8 makes the line a comment line. Position 17 indicates the name entry in positions 19 through 28.
R specified in position 29 indicates that it is a preferred field, and its definition is defined somewhere else. You can enter the DDS source using STRSEU. You create a DDS pf using the CRTPF command, a DDS LF using CRTLF, a DDS Display file using CRTDSPF, a DDS printer file using CRTPRTF, and a DDS ICF file using CRTICFF.
See lessWhat is the difference between PF and LF in as400?
Following are the differences between PF and LF. PF stands for physical file whereas LF stands for Logical file. PF stores data in memory whereas LF does not store data in memory, it's an access path or a view over one or more PFs. CRTPF command is used to create PF object whereas CRTLF command is uRead more
Following are the differences between PF and LF.
DSPDBR
command is used with PF to get all dependents and theDSPFD
command is used with LF to get its parent PF.Why do we use CHGPF command in AS400?
CHGPF is changing the physical file command in AS400, i.e., CHGPF. This command changes the PF attributes and structure without losing the actual data stored in PF. CHGPF FILE(TESTLIB/PF1) SRCFILE(PF1/QDDSSRC) SRCMBR(PF1) We can change the following attributes of a PF using the CHGPF command: MaximuRead more
CHGPF
is changing the physical file command in AS400, i.e., CHGPF. This command changes the PF attributes and structure without losing the actual data stored in PF.CHGPF FILE(TESTLIB/PF1) SRCFILE(PF1/QDDSSRC) SRCMBR(PF1)
We can change the following attributes of a PF using the
CHGPF
command:how to create physical file in as400?
We can create physical files in AS400 using DDS. You can create a physical file in the library using QDDSSRC srcpf. To create a physical file, follow these steps: Write the DDS source for the physical file for the source member using SEU. A R RCDFMT1 A FLD1 10A A FLD2 5A A FLD3 2P 0 A FLD4 1A CreateRead more
We can create physical files in AS400 using DDS. You can create a physical file in the library using QDDSSRC srcpf. To create a physical file, follow these steps:
CRTPF FILE(TESTLIB/FILE1) TEXT('DDS based physical file')
What are the data types supported by physical files in AS400?
There are many data types supported by physical files in as400, which are as follows: Character – entry A in fixed position 35. Binary – entry B Floating point – entry F Hexadecimal – entry H Date – entry L Packed decimal – entry P Zoned decimal – entry S Time – entry T Timestamp – entry Z Binary chRead more
There are many data types supported by physical files in as400, which are as follows:
Points to consider while implementing these data types in physical files.
Source code for defining character data type in the physical file: maximum allowed length for the character data type is 32766
The source code for defining Varying character data types in physical files:
The maximum allowed length for varying character data types is 32740, and the VARLEN keyword is used.
Source code for defining Binary data type in the physical file:
the maximum allowed length for the character data type is 18.
Source code for defining Floating data type in physical file:
the maximum allowed length for floating data type is 9 for single precision.
The maximum allowed length for the floating data type is 17 for double precision.
The source code for defining the Hexadecimal data type in the physical file:
the maximum allowed length for the hexadecimal data type is 32766.
Source code for defining Date data type in physical file
Source code for defining Time data type in physical file
Source code for defining Timestamp data type in physical file
The source code for defining the Packed decimal data type in the physical file:
the maximum allowed length for the packed decimal data type is 63. Either 63 numeric and decimal 0 or 0 numeric and decimal 63.
The source code for defining the Zoned decimal data type in the physical file:
the maximum allowed length for the packed decimal data type is 63. Either 63 numeric and decimal 0 or 0 numeric and decimal 63.
The source code for defining the Binary character data type in the physical file:
the maximum allowed length for the binary character data type is 32766.
Source code for DDS-supported DBCS data type Source code for defining DBCS-only data type in the physical file:
the maximum allowed length for DBCS-only data type is 32766.
The source code for defining Varying DBCS-only data types in the physical file:
the maximum allowed length for varying DBCS-only data types is 32740.
Source code for defining DBCS Either data type in the physical file:
the maximum allowed length for DBCS either data type is 32766.
Source code for defining Varying DBCS:
The maximum allowed length for varying DBCS data types in the physical file is 32740.
The source code for defining the Open data type in the physical files:
the maximum allowed length for the open data type is 32766.
The source code for defining Varying open data types in physical files:
the maximum allowed length for varying open data types is 32740.
Source code for defining Graphic data type in physical file:
the maximum allowed length for the open data type is 16383.
The source code for defining Varying graphic data types in physical files:
the maximum allowed length for varying open data types is 16370.
how to add data in physical file in as400?
We can manually add data to the physical files using SQL INSERT in the STRSQL session or from Run SQL Script in as400. We can also use the UPDDATA command line command to add data to the physical file. Follow the below steps: Type UPDDTA on the command line and press F4. Provide a file name and librRead more
We can manually add data to the physical files using
SQL INSERT
in the STRSQL session or from Run SQL Script in as400.We can also use the
UPDDATA
command line command to add data to the physical file. Follow the below steps:how to view journal entries in as400?
You can view journal entries using the Display Journal (DSPJRN) command. The journal entries can be displayed, printed, and written in the outfile. You can view journal entries in SQL using the table function DISPLAY_JOURNAL in the QSYS2 library. This table function returns information about journalRead more
You can view journal entries using the Display Journal (
DSPJRN
) command. The journal entries can be displayed, printed, and written in the outfile.You can view journal entries in SQL using the table function
DISPLAY_JOURNAL
in the QSYS2 library. This table function returns information about journal entries and is similar to what the Display Journal (DSPJRN) command returns.You can also use the Retrieve Journal Entries (
QjoRetrieveJournalEntries
) API to view information on journal entries.You can use this SQL query
See lessSELECT * FROM TABLE(QSYS2.DISPLAY_JOURNAL( 'TESTLIB', 'Journal_Name')) AS JT
what is the use of ovrdbf in as400?
There are various uses of ovrdbf. Some of them are as follows: OVRDBF command can override the local file with a DDM file so that the program uses a remote rather than a local one. Using this command, you can change a physical file’s attribute. To access the file with a different name. To override aRead more
There are various uses of
ovrdbf
. Some of them are as follows:OVRDBF
command can override the local file with a DDM file so that the program uses a remote rather than a local one.For example, the OVRDBF command can be written as:
What is an array in AS400?
An array is a collection of elements with the same data type and length. We commonly utilize the keyword to define an array in an RPG program. An individual array element can be referred to by its location, while an array name refers to all its members in an RPG application. The array name must be uRead more
An array is a collection of elements with the same data type and length.
We commonly utilize the keyword to define an array in an RPG program.
An individual array element can be referred to by its location, while an array name refers to all its members in an RPG application.
The array name must be unique within the RPG program, and the array index must be numeric with zero decimal places.
If the RPG program attempted to use the array index
ARR(Index)
as zero, negative, or more than the number of elements defined in theDIM
keyword, an error occurred during runtime. There are three types of arrays in RPG.Run Time array: It is loaded by the RPG program while running.
See lessCompile Time array: It is loaded when an RPG program is compiled. Any data available in the compile-time array will not be modified unless the RPG programmer changes it and recreates the program object.
Prerun Time array: It is loaded from the Array file when the program begins.
what is a data queue in as400 and why do we use data queue?
A data queue is a type of system object that can be created to send data to one program or process and receive data from another. The data-receiving program may be waiting or may receive the data later. A data queue is the quickest means to communicate between two jobs. There are many advantages ofRead more
A data queue is a type of system object that can be created to send data to one program or process and receive data from another. The data-receiving program may be waiting or may receive the data later.
A data queue is the quickest means to communicate between two jobs.
There are many advantages of using a data queue in as400:
How to run stored procedure in AS400?
Use SQL CALL statement to run the stored procedure in AS400. On the CALL statement, specify the stored procedure name and any parameters if required. The parameters include constants, special registers, host variables, or expression and SQL variables. To run the stored procedure, try to call using tRead more
Use
SQL CALL
statement to run the stored procedure in AS400. On the CALL statement, specify the stored procedure name and any parameters if required. The parameters include constants, special registers, host variables, or expression and SQL variables. To run the stored procedure, try to call using the name specified on the CREATE PROCEDURE statement. For example, consider a simple SQL stored procedure as follows:To run this stored procedure, use the
See lessSQL CALL
statement as follows:CALL SQLInsertProc('TEST', '1')
How to resolve session and device error in AS400?
session device error can occur in the following situation The subfile SFLRCDNBR or SFLSIZ field has an incorrect record number. Even if no record gets loaded in the subfile, trying to display the subfile means the run is 0 during EXFMT execution and the SFLDSP indication is set *ON. try to display aRead more
session device error can occur in the following situation
SFLRCDNBR
orSFLSIZ
field has an incorrect record number.EXFMT
execution and theSFLDSP
indication is set *ON.9999
records for theLoad All subfile
on the Display file.We usually get the error
Session or device error occurred in file SubfileName (C G D F)
when we try to display an empty subfile by setting the indicator ON associated with theSFLDSP
keyword. So, setting theSFLDSP
indicator off would resolve this session or device error. You may also get this session or device error if you do not include theSFLDSPCTL
keyword in your subfile control record format.This session or device error can also occur when the field and position in DDS are incorrect and display a window subfile in an incorrect position.
See lesshow to check as400 system values?
We can use DSPSYSVAL comamnd to check as400 system values. We can retrieve system values using the command RTVSYSVAL in the CL program as well. We can also use SQL to check as400 system values. SQL view SYSTEM_VALUE_INFO in the QSYS2 library to retrieve and check as400 system values. This SQL view SRead more
We can use
DSPSYSVAL
comamnd to check as400 system values.We can retrieve system values using the command
RTVSYSVAL
in the CL program as well.We can also use SQL to check as400 system values. SQL view
SYSTEM_VALUE_INFO
in the QSYS2 library to retrieve and check as400 system values. This SQL viewSYSTEM_VALUE_INFO
contains three fields.Current_numeric_value is null if the system value is not numeric, and Current_character_value is null if the system value is not a character; otherwise, they would have contained the values.
SQL to check as400 system values:
How to check triggers on a file in as400?
To check triggers on a file, run the command Print trigger programs (PRTTRGPGM). It generates a report that includes all physical file triggers on your AS400 system. PRTTRGPGM command takes two input parameters, namely library and changed report only. We can pass the values in the library parameterRead more
To check triggers on a file, run the command Print trigger programs (
PRTTRGPGM
). It generates a report that includes all physical file triggers on your AS400 system.PRTTRGPGM
command takes two input parameters, namely library and changed report only. We can pass the values in the library parameter as *LIBL, *USRLIBL, *CURLIB, *ALL, *ALLUSR, or Library name. In the changed report-only parameter, the default value is *NO i.e. full and changed reports will be printed. You can also pass *YES, which means only the changed report will be printed.Once you run the
PRTTRGPGM
command with specified parameter values, a trigger program spool file QPSECTRG in your job gets generated. You can access it using the WRKSPLF command.In the report, you will see specified library info that you passed in the first parameter, other information as a library, the file on which the trigger program is attached, ASP device, name of trigger, type, trigger program library, and name, time, event, condition, allow repeated change.
You can also use the
See lessDSPFD
command outfile to check triggers on a file. Run the following command from the command line to create an outfile in the qtemp library.DSPFD FILE(TESTLIB/FILENAME)
TYPE(*TRG)
OUTPUT(*OUTFILE)
OUTFILE(QTEMP/OutFileName)
In the outfile you will receive a row when there is any trigger program associated with this file, otherwise, the outfile will be empty.
what is level check error and
CPF4131 is a record format level check error. This indicates that the format level ID in the file at the time of program compilation is not found when the program opens the file. This means that the file structure has been changed after the program compilation. You must recompile your program to resRead more
CPF4131
is arecord format level check
error. This indicates that the format level ID in the file at the time of program compilation is not found when the program opens the file. This means that the file structure has been changed after the program compilation. You must recompile your program to resolve theCPF4131
, i.e.level check error
.CPF4131
usually occurs when the program tries to access files whose record format differs from the record format level used during program compilation. The solution tolevel check error
, i.e.CPF4131
, could be to set theLVLCHK option (*NO)
during file compilation. This will ensure that the record format will not be checked during file opening, but this is not a suggested approach to follow.CPF4131
level check error can be resolved by recompiling the programs. Steps to follow to fix theCPF4131
error:DSPPGMREF
command from the command line for the program experiencing a level check problem.DSPFD
on the file and the one stored in theDSPPGMREF
output. If they are not equal, then recompile the program.How to find damaged objects in AS400?
To find damaged objects in as400, we can follow the below steps: Run the DSPOBJD command from the command line and create an outfile in the QTEMP library. DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*ALL) OUTPUT(*OUTFILE) OUTFILE(QTEMP/A1) Once the outfile is created, start the Interactive SQL session and run thRead more
To find damaged objects in as400, we can follow the below steps:
Run the
DSPOBJD
command from the command line and create an outfile in the QTEMP library.DSPOBJD OBJ(*ALL/*ALL)
OBJTYPE(*ALL)
OUTPUT(*OUTFILE)
OUTFILE(QTEMP/A1)
Once the outfile is created, start the Interactive SQL session and run the following command from the command line.
STRSQL
Run the following SQL query to find damaged objects in the AS400 system.
SELECT odlbnm, odobnm, odobtx FROM qtemp/a1 WHERE odobdm <> '0'
Here, the
odobdm
field value 0 means the object is not damaged; if it’s other than 0, it’s damaged.We can find damaged objects using the
DSPOBJD
command outfile, fieldODOBDM
values, which are as follows:what is module in as400?
Modules help organize related tasks into smaller code units to be bound into programs or service programs. A module is a non-running object whose object type is *MODULE. Instead, They are called with either the bound call (CALLB in RPG) or a prototyped call (CALLP in RPG), as the dynamic CALL operatRead more
Modules help organize related tasks into smaller code units to be bound into programs or service programs.
A module is a non-running object whose object type is *MODULE. Instead, They are called with either the bound call (CALLB in RPG) or a prototyped call (CALLP in RPG), as the dynamic CALL operation is unavailable for them.
We can develop modules, particularly in large applications, because they allow code reuse. A module may consist of one or more procedures.
A procedure is a function that accepts parameters and returns values.
When using ILE, we must build a module object before creating a program object (*PGM) using the CRTPGM command or a service program object (*SRVPGM) with the CRTSRVPGM object.
During program or service program creation from the module object, all the compiled code is copied into the program or service program object. This code becomes routine/procedure in the program or service program, and there can be primary or sub-procedures. The main method has the same name as the module.
After that, the *Module object is no longer needed. We can delete it anytime if we want.
There are three types of RPG modules.
Module with the cycle-main procedure: The module consists of a cycle-main procedure that includes logic for a complete RPG cycle and zero or more subprocedures. It can be called using a bound call or a program call.
See lessModule with the linear-main procedure: The module consists of a linear-main procedure identified by the MAIN keyword on the control specs and zero or more procedures. It can only be called using a program call. It cannot be called using a bound call.
Module with no main procedure: The module contains only subprocedures and the NOMAIN keyword on the control specs. This type of module does not include logic for the RPG cycle, and it cannot be the program entry module of a program since it has no main procedure. It can only be called using a bound call.
How to create binding directory in as400?
To create a binding directory, use the command CRTBNDDIR as follows: CRTBNDDIR BNDDIR(TESTLIB/BNDDIR1) A binding directory is an object of type *BNDDIR. We can add entries to the binding directory using the command ADDBNDDIRE. ADDBNDDIRE BNDDIR(TESTLIB/BNDDIR1) OBJ((TESTLIB/SRVPGM1 *SRVPGM)) We canRead more
To create a binding directory, use the command CRTBNDDIR as follows:
CRTBNDDIR BNDDIR(TESTLIB/BNDDIR1)
A binding directory is an object of type *BNDDIR. We can add entries to the binding directory using the command ADDBNDDIRE.
ADDBNDDIRE BNDDIR(TESTLIB/BNDDIR1) OBJ((TESTLIB/SRVPGM1 *SRVPGM))
We can add service programs or modules to the binding directory. Only names get added, not the object, and it gets picked when the program executes and has this binding directory attached.
Commands used with binding directories, such as
RMVBNDDIRE
andWRKBNDDIRE
.
See lessRMVBNDDIRE BNDDIR(EASYCLASS1/B1)
OBJ((EASYCLASS1/TEST *SRVPGM))
and
WRKBNDDIRE BNDDIR(TESTLIB/BNDDIR1)
how to create ifs folder in as400?
We can create an ifs folder using System I Navigator. Follow the below steps to create an ifs folder in the as400 machine. Open the System i Navigator. Click on the plus symbol (+) next to the Server (IP or domain). After node expansion, Click on the plus symbol (+) next to File Systems. After nodeRead more
We can create an ifs folder using System I Navigator. Follow the below steps to create an ifs folder in the as400 machine.
The Ifs folder is the ifs directory. So, we can create an ifs directory from the server end. Use the mkdir (make directory) command to create an ifs folder(directory) in the AS400 system.
Type MKDIR on the command line, then press F4. Enter your new folder name, including the complete path back to the root.
mkdir ()
API can create a new or sub-directory in the IFS. mkdir() is make directory API. The prototypes inC
andRPG
language for mkdir() API are as follows:C prototype of mkdir():
RPG prototype of mkdir() in fixed format:
RPG prototype of mkdir() in fully free format:
mkdir() accepts two parameters and returns an integer value.
Path
parameter where we specify the folder/directory to be created.mode
parameter is the access permissions assigned to the directory during creation.Here is the RPG code in fixed format to create an ifs folder in as400.
Here is the RPG code in free format to create an ifs folder in as400.
Here is the fully free RPG code to create an IFS folder in AS400.
What is ASP in AS400?
ASP is an auxiliary storage pool. It is one or more physical disk units that are connected to the same storage region. ASP is available on IBM I servers, and several disk storage units are grouped to form an ASP. ASP is a collection of internal storage area networks (SAN) and other types of accessedRead more
ASP is an auxiliary storage pool. It is one or more physical disk units that are connected to the same storage region.
ASP is available on IBM I servers, and several disk storage units are grouped to form an ASP. ASP is a collection of internal storage area networks (SAN) and other types of accessed disks on IBM i. There are different types of ASP storage, ranging from 1 to 255.
System ASP (ASP 1): It is automatically created for an IBM i system, which means it is a default ASP. This consists of disk storage unit 1 and other unassigned system ASP containing OS objects, licensed programs, etc.
See lessBasic ASP (ASP 2 through ASP 32): We can create a basic ASP by combining a set of storage units and assigning that group to an unused ASP number. This ASP is assigned to only one IBM i server.
Independent ASP (ASP 33 through ASP 255): This ASP is available to be used by local and remote IBM i servers. They were created for multiple purposes, such as database segregation, uninterrupted business, etc. It is possible to switch this ASP between IBM i servers.
What is JOBQ and how to create a JOBQ in AS400?
All jobs that are submitted go into the Job Queue (JOBQ), Jobs waiting in the job queue (type *JOBQ) to be processed. Use the CRTJOBQ command to create a JOBQ. CRTJOBQ JOBQ(TESTLIB/JOBQ1) TEXT('Test Job Queue') After creating a JOBQ, it needs to be assigned to a subsystem only then we can execute joRead more
All jobs that are submitted go into the
Job Queue
(JOBQ), Jobs waiting in the job queue (type *JOBQ) to be processed.Use the
CRTJOBQ
command to create a JOBQ.CRTJOBQ JOBQ(TESTLIB/JOBQ1) TEXT('Test Job Queue')
After creating a JOBQ, it needs to be assigned to a subsystem only then we can execute jobs within that JOBQ.
Add a job queue (JOBQ) entry to the subsystem description to associate a Job queue to the subsystem.
Use the
See lessADDJOBQE
command to add JOBQ to the subsystemADDJOBQE SBSD(SBSYSTEM1) JOBQ(TESTLIB/JOBQ1) MAXACT(*NOMAX) SEQNBR(5)
What is PSDS in AS400?
The PSDS keyword for a free-form definition or the S letter, which appears in the 23rd position in a fixed format RPG, is used to identify it. It offers information on program exceptions and errors that the program can access. To ensure that each module can only have a single PSDS, it must be defineRead more
The PSDS keyword for a free-form definition or the S letter, which appears in the 23rd position in a fixed format RPG, is used to identify it. It offers information on program exceptions and errors that the program can access.
To ensure that each module can only have a single PSDS, it must be defined in the main source section. Predefined subfields are present in a PSDS.
Declaring PSDS in Fixed format RPG program:
We can declare program status data structure in rpgle free format as follows: