Tuesday, May 5, 2009

Exploring iSeries QSHELL: (Innovative Idea for People want to develop application on AS400)

I am sure after reading this article most of the People will be surprised to see that there is something called as Shell programming in AS400 , Yes .. !! Its true .. Refer to the article below ..

If over the last few months or years, you thought of acquiring UNIX - or Linux - skills but never had the time, the opportunity or a platform to use it, this article may for you. The iSeries operating system now offers a built-in UNIX environment. This new environment is named QSHELL.

Why QSHELL? The first question one may want to ask is why did IBM come up with this 'QSHELL' environment in the first place? The answer is that to be fully Java compliant, IBM needed to supply a JDK (Java Development Kit) on its iSeries eServer that could run standard Java commands such as Java, Javac or Javadoc, the same way other (UNIX) systems could.

There is only one snag, OS/400 does not happen to be 'a flavor of' UNIX. The OS/400 IBM team resolved this hurdle by supplying a new 'UNIX style shell' on the iSeries and appropriately named it 'QSHELL'.

The purpose of this article is to give a quick overview of how QSHELL works, and provide a strong tutorial base and an example of shell script which can be run on a UNIX platform as well as your own iSeries using QSHELL.

Jumping In

To start QSHELL, simply type the OS/400 command 'STRQSH' on the command line. Once there, what you will see is not very different from an ordinary green-screen QCMD session, with a different set of commands.

At first glance

The first thing you will see after entering the QSHELL environment is a screen saying
'QSH Command Entry' , and a '$' character
To know what you can do with QSHELL, there is no 'HELP' command, and the F4 key is plainly ineffective. If you wish to know what tools you have, you need to get yourself to the /usr/bin directory. To do this, you have to type the command 'change directory to /usr/bin' – the actual command below is
cd /usr/bin
From there, you can confirm where you are by typing a 'Print Working Directory' – the actual command below ispwd
Once there, you can see the contents of the /usr/bin directory by using the command ls
or as I prefer to use it,
ls –ltra
in this case, the command modifiers
'a' means 'all', do not hide the directory entries starting with '.'
'l' means 'long', show all the details about each entry
't' means sort by modification time
'r' means reverse order for the sort. Effectively, the latest entries will be the last ones in the listing, which is practical for reading.
Note that the order of these command modifiers is not important. ls –artl is interpreted same as ls –ltra
You can also type, from the original directory the command
ls –ltra /usr/bin
This sounds basic, but ls and pwd are some of the most useful commands. You will use them often in this environment.
The directory structure, in UNIX, starts with '/'. The '/' directory is also known as the 'root' directory. Each directory branch grows from the previous, just like in DOS or in Windows. The directory structure in this environment can have n levels.
The equivalent of the '/' root directory in UNIX in the traditional iSeries environment is the QSYS library. However, on the iSeries, we have a single level of libraries: all libraries are in QSYS, no library can be in a library if it is not QSYS.
In UNIX, a directory can be in a non-root directory.
One other important feature of the UNIX file system: unlike the iSeries or NT, it is case-sensitive. This means that a file named caseSENSTIVE is not the same as a file named CASESensitive. They will be listed and recognized by the operating system as two distinct files. This is critical if you write shell scripts
mkdir /mysandbox

This action of creating a QSHELL directory is similar to creating your own library. Within that directory, you can store your own shell scripts without cluttering the root area, which you want to keep clean if possible

There are many UNIX commands to play with, and for now, I have given focus on the method of using QSHELL rather than explaining too many commands... Watch out for my other articles soon regarding this , till then folks keep trying using QSHELL in ur System .....

Thursday, April 30, 2009

How to open Notepad from As400 Server Command line( StressBuster )

Hey its seems to be exciting but its true .. we can execute any PC Command that we can use in our Dos in AS400 now .

like calc.exe we use to open calculator

notepad.exe to open Notepad and many more

To do so ,

The first step is to

Start iSeries Access Organizer by using command

(STRPCO)

The Start iSeries Access Organizer (STRPCO) command starts the
iSeries Access Organizer on the host system.

Simply fire STRPCO Press F4 the put *yes in Text Assist

The second step is to

Start PC Command by using command

(STRPCCMD)

example

STRPCCMD PCCMD(NOTEPAD.EXE)


and u will see a notepad in front of u ... Is'nt it that surprising..

Just give a try and it will be great fun especially when u get tired after lots of coding .. lolzzzzzzzz

Monday, April 6, 2009

AS400 SQL - Update a field from another file


Updating a field from another file on the AS/400 is done differently than most SQL-based systems. This example uses a JD Edwards table. Here's how to do it:
Syntax:
UPDATE Library/File1 Set Field1= (SELECT Field2 FROM Library/File2 where File1.Id1 = File2.Id2) WHERE File1.Id1 IN (Select Id2 FROM Library/File2)

IMPORTANT!!!: If you leave off the second WHERE statement, you'll wipe out the values of Field1 where the records don't match. Be sure to test this in non-production or you might eliminate LOTS!!! of values in JDE F42119, possibly affecting your performance review if you ever get one.

Example: Update JDE Open Orders Business unit with Address Book Business Unit

UPDATE JDEDTA/F4211 SET SDMCU=(SELECT ABMCU FROM JDEDTA/F0101 WHERE F4211.SDAN8=F0101.ABAN8) WHERE SDAN8 IN (SELECT ABAN8 FROM JDEDTA/F0101)
Note: If you use ODBC in Visual Basic or another program, change the "/" to a dot. Example, UPDATE JDEDTA.F4211... Also, if field names are different, do not use qualifiers in the where clauses.

So the above would look like this in ODBC:

UPDATE JDEDTA.F4211 SET SDMCU=(SELECT ABMCU FROM JDEDTA.F0101 WHERE SDAN8=ABAN8) WHERE SDAN8 IN (SELECT ABAN8 FROM JDEDTA.F0101)

Wednesday, April 1, 2009

System i hits new low: Revenue down 92%


This morning on the radio I heard that IBM had released fourth quarter and 2008 year end results, with the company reporting net income up 12%. But, the System i didn’t fare well in the company’s announced earnings, with a jaw-dropping decrease in revenue of 92% year-on-year. Last quarter, we reported that the System i revenue was down 82%. The explanation is that the company has combined the revenues from Systems i and p in the new converged System p numbers, and no longer attributes any new Power running i sales to the legacy system. On the positive side, revenues from the converged System p server products increased 8%, the only increase for the Systems and Technology hardware segment.

It seems that IBM, a company founded on “machines” has moved on and is now finding success in software, services and financing. In fact, IBM senior vice president and chief financial officer, Mark Loughridge, told a conference call of financial analysts that the company derived 90% of it’s revenue from these segments. But Loughridge shared the company’s optimism going forward, “With the stimulus packages being put in place, the economies will start to improve as we go to the back half of the year. Likewise, for the first quarter our performance will be relatively flat, with growth especially in second half of the year.”

Tuesday, March 31, 2009

Tips: Run and call System i stored procedures

Use these tips for running and calling System i™ stored procedures.

Running a System i stored procedure

ODBC provides a standard interface for calling stored procedures. The implementation of stored procedures differs significantly across various databases.
This simple example follows the recommended approach for running a System i stored procedure.

1.)Set up a create procedure statement for the stored procedure and create it. The creation of the stored procedure only needs to be done once and it does not have to be done through ODBC. The definition that it provides is available to all ODBC as well as integrated i5/OS® applications.
2.)Prepare the stored procedure call.
3.)Bind the parameters of the procedure, indicating whether each parameter is to be used for input to the procedure, output from the procedure, or input/output.
4.)Call the stored procedure.


Example:

CREATE PROCEDURE MYLIB.MYPROC (INOUT PARM1 CHAR(10)) EXTERNAL NAME MYLIB.MYPGM LANGUAGE COBOL GENERAL

In the above example, the procedure name is MYLIB.MYPROC.

This procedure references the COBOL program MYLIB.MYPGM. The program takes one input parameter called PARM1 which is a char field of length 10. This procedure does not return a result set.

STORED PROCEDURE : Very IMP For SQL Lovers

Defination

A stored procedure is a set of SQL commands that has been compiled and stored on the database server.

Once the stored procedure has been "stored", client applications can execute the stored procedure over and over again without sending it to the database server again and without compiling it again.

Stored procedures improve performance by reducing network traffic and CPU load

Some Details

Typical uses for stored procedures include data validation (integrated into the database) or access control mechanisms. Furthermore, stored procedures are used to consolidate and centralize logic that was originally implemented in applications. Large or complex processing that might require the execution of several SQL statements is moved into stored procedures and all applications call the procedures only.

Stored procedures are similar to user-defined functions (UDFs). The major difference is that UDFs can be used like any other expression within SQL statements, whereas stored procedures must be invoked using the CALL statement

CALL procedure(…)

or

EXECUTE procedure(…)

Stored procedures can return result sets, i.e. the results of a SELECT statement. Such result sets can be processed using cursors by other stored procedures by associating a result set locator, or by applications. Stored procedures may also contain declared variables for processing data and cursors that allow it to loop through multiple rows in a table. The standard Structured Query Language provides IF, WHILE, LOOP, REPEAT, CASE statements, and more. Stored procedures can receive variables, return results or modify variables and return them, depending on how and where the variable is declared

Difference between Stored Procedures and Functions

a. Only function can Return a value (to be precise using the Return keyword)

b. Procedures can use ‘Return’ keyword but without any value being passed

c. Functions could be used in select statements, provided they don’t do any data manipulation inside and also should not have any OUT, IN OUT parameters

Comparison with Dynamic SQL

Because stored procedure statements are stored directly in the database, this can remove the compilation overhead that is typically required in situations where software applications send inline (dynamic) SQL queries to a database. However, most database systems implement statement caches to avoid repetitive compilation of dynamic SQL statements. In addition, pre-compiled SQL statements, while avoiding some overhead, add to the complexity of creating an optimal execution plan because not all arguments of the SQL statement are supplied at compile time. Depending on the specific database implementation and configuration, mixed performance results will be seen from stored procedures versus generic queries or user defined functions.

Programming Tip: HIDING LINES WHILE EDITING ** Especially for those Who work in companies where Implementation is carried out Mostly.

When you are working with source members that have many source lines, it is useful to exclude certain lines from the displayed member, allowing you to see lines from different areas of the source on the screen at the same time. Place X (Exclude) on any line you want to exclude from the display. This doesn't delete the line from the source member; it simply causes the excluded line(s) to be temporarily removed from the SEU display.
You can also use the X command in block format (XX). The example below shows how to exclude lines 3 through 6 (I entered a blank after the XX command to make it more readable):

*************** Beginning of data **************************
0001.00 111111111111111
0002.00 222222222222222
XX 3.00 333333333333333
0004.00 444444444444444
0005.00 555555555555555
XX 6.00 666666666666666
0007.00 777777777777777
****************** End of data *****************************

The result below shows that lines 3 through 6 have been hidden from view:

*************** Beginning of data **************************
0001.00 111111111111111
0002.00 222222222222222
- - - - ------------- 4 data records excluded ----------------------
0007.00 777777777777777
****************** End of data *****************************

To redisplay the lines, press F5 (Refresh) key, or use the SF or SL commands. SF (Show first) command shows the first excluded line, and SL (Show last) shows the last excluded line. You can also use SFn or SLn to show the first n lines or the last n lines of the excluded group of lines. The example below shows how to use the SF2 command to show the first two excluded lines:

*************** Beginning of data **************************
0001.00 111111111111111
0002.00 222222222222222
SF2 - - ------------- 4 data records excluded ----------------------
0007.00 777777777777777
****************** End of data *****************************

Notice below that the display shows the first two excluded lines and the text has changed to "2 data records excluded":

*************** Beginning of data **************************
0001.00 111111111111111
0002.00 222222222222222
0003.00 333333333333333
0004.00 444444444444444
- - - - ------------- 2 data records excluded ----------------------
0007.00 777777777777777
****************** End of data *****************************

DETERMINING WHETHER A JOB IS RUNNING INTERACTIVE OR BATCH IN CL

Use RTVJOBA command to find it out . Below is the small Program i made in order to find it out .
If anybody have some other technique also then he can kindly mail me .
PGM
DCL VAR(&JOBTYPE) TYPE(*CHAR) LEN(1)
RTVJOBA TYPE(&JOBTYPE)
IF COND(&JOBTYPE *EQ '0') THEN(GOTO START)
/* Interactive Program Section */
SBMJOB CMD(CALL PGM(ITSELFCL)) JOB(SBMITSELF)
SNDPGMMSG MSG('Tell user program Itself Submitted')
RETURN
START:
/* Mainline Batch Program */
If the Job Type is 0, it's running in batch, and if it's 1, it's interactive.

PRINTING A LIST OF ALL IBM SOFTWARE INSTALLED ON AS400 SERVER

You probably already know that if you enter GO LICPGM and select option 10, you can display a list of IBM software packages installed on your system. Unfortunately, this method might not display all IBM software packages installed, and it also doesn't let you print this list. You could, of course, simply use the Print Screen key, but you might have to print 15 different screens with messy formats, and you could inadvertently truncate data or forget to print a screen. There's a better solution. The following DSPSFWRSC (Display Software Resources) command

DSPSFWRSC OUTPUT(*PRINT)

not only prints out all your software package names, but it also prints the library name in which each package is located.

FINDING DEFAULT IBM PASSWORDS ON I- SERIES

Q. What command or utility checks for IBM-supplied user IDs that haven't had their passwords changed from their default values?

A. The command is ANZDFTPWD. You can either enter the command or enter GO SECTOOLS and select menu option 1. When run, ANZDFTPWD prints a report named QPSECPWD that shows all the user profiles on the system with default passwords. ANZDFTPWD optionally lets you disable or expire the password for user profiles with default passwords.

MANAGING DISK USE


To help you manage disk use on your AS/400, OS/400 includes the RTVDSKINF (Retrieve Disk Information) and PRTDSKINF (Print Disk Information) commands. You can use these two commands to monitor the utilization of your disks, or you can write your own queries over the data captured by RTVDSKINF to analyze changes in disk use.

You use command RTVDSKINF to gather information about all the objects on your system. The command outputs the information to member QCURRENT in file QAEZDISK in library QUSRSYS. For a large system with many thousands of objects, running RTVDSKINF can take many hours, so IBM requires you to run the command in batch. The easiest way to do this is to use the SBMJOB (Submit Job) command:

SBMJOB CMD(RTVDSKINF)
You use command PRTDSKINF to print the information that command RTVDSKINF generates in file QAEZDISK. PRTDSKINF lets you print a summary of your system information or print details of disk use by library, folder, owner, or object. For example, to print a list of libraries that are more than 1,000 K in size in descending order by size, you run the command

PRTDSKINF RPTTYPE(*LIB) +
OBJ(*NONE) +
MINSIZE(1000) +
SORT(*SIZE)


The online help for PRTDSKINF explains all the available options.
If the standard PRTDSKINF report options don't meet your needs, you can write your own queries over file QAEZDISK. In addition, you can save the data in member QCURRENT in QAEZDISK to a file and write queries to compare the output from different runs of RTVDSKINF.

DEBUGGING BATCH JOBS

Steps to debug a batch job -
1. SBMJOB ... HOLD(*YES)

2. STRSRVJOB JOB(jobnbr/user/jobnam)

3. STRDBG
When source is displayed, press F12

4. RLSJOB JOB(jobnbr/user/jobnam)
When Start Serviced Job display appears, press F10

5. When command entry display is shown, DSPMODSRC
When source is displayed, set a breakpoint, then press F12
When command entry display is shown, press F12

6. When Start Serviced Job display reappears, press Enter
Program will stop at breakpoint, and can be debugged interactively

7. After serviced job ends
ENDDBG
ENDSRVJOB

In detail, some explanations -


1.Submit the batch job using the Submit Job (SBMJOB) command or a program that automatically submits the job with HOLD(*YES).
--->
SBMJOB HOLD(*YES) Determine the qualified job name (number/user/name) that is assigned to the job using the Work with Submitted Jobs (WRKSBMJOB) command or the Work with Job Queues (WRKJOBQ) command. The Submit Job (SBMJOB) command also displays the name in a completion message when the command finishes processing. The WRKJOBQ (Work With Job Queue) command displays all the jobs waiting to start in a particular job queue. You can show the job name from this display by selecting option 5 for the job.

2. Enter the Start Service Job (STRSRVJOB) command from the display
---->
STRSRVJOB JOB(qualified-job-name)

3. Enter the STRDBG command and provide the names of all programs to be debugged. (No other debug commands can be entered while the job is waiting on the job queue. )

4. Use the Release Job Queue (RLSJOBQ) command to release the job queue. A display appears when the job is ready to start, indicating that you may begin debugging the job.

5. Press F10 to show the Command Entry display. DSPMODSRC. Use the Command Entry display to enter any debug commands, such as the Add Breakpoint (ADDBKP) or Add Trace (ADDTRC) commands.
Press F3 to leave the Command Entry display, and then press Enter to start the batch job.
When the job stops at a breakpoint, you see the normal breakpoint display. When the job finishes, you cannot add breakpoints and traces, or display or change variables. However, you can display any trace data using the Display Trace Data (DSPTRCDTA) command.
If you want to debug another batch job, first end debugging using the End Debug (ENDDBG) command and then end servicing the job using the End Servicing Job (ENDSRVJOB) command.

Installing IBM i on a Power Blade: Tips and Techniques


Follow the life cycle of an IBM Power Blade installation

Power blades, the IBM BladeCenter JS12 and JS22, have increased the number of hardware platforms for IBM i applications. Using proven PowerVM technologies such as logical partitioning (LPAR) and dynamic resource movement, the JS12 and JS22 provide a novel approach to workload consolidation, efficiency, and power cost reduction for IT environments.

Here, I provide tips and techniques on making the BladeCenter solution work, drawing on experience from the front line of planning for, implementing, troubleshooting and helping design the next stage of IBM i on a Power blade. Together, we'll trace the life cycle of an implementation to help you navigate any challenging terrain.



The Planning Stage

The Planning Stage
This phase begins with the simple question, “Is IBM i on a Power blade right for this environment?” Alternatives to this solution are to deploy IBM i on a POWER6 processor-based IBM Power rack server, and to implement Windows applications on x86-architecture blade servers with an Internet SCSI (iSCSI) connection to IBM i on a rack server. Considerations include

the number, type and size of IBM i servers (AS/400, iSeries, System i)
the number and size of Windows servers
operating system levels and plans to upgrade
type of existing storage (integrated vs. SAN)
existing skills (IBM i, Power hardware, Windows, SAN, AIX/VIOS)
potential power and cooling savings with the BladeCenter
Almost all IBM i and BladeCenter implementations involve Windows integration on blade servers as well. Frequently, migrating IBM i to a Power blade is the final step of an ongoing BladeCenter consolidation project. The closest equivalent to running IBM i on a traditional Power server is the BladeCenter S because of its integrated SAS storage. This type of implementation is best suited to a small IT environment with several servers. For larger installations, including Storage Area Network (SAN) and a BladeCenter H is most appropriate. Keep in mind that in both cases, the necessary skill set includes non-IBM i storage management (BladeCenter S or SAN) as well as working with BladeCenter hardware and Virtual I/O Server (VIOS)-based virtualization.

For more details visit http://systeminetwork.com/article/installing-ibm-i-power-blade-tips-and-techniques

Sunday, March 29, 2009

COMPANIES USING AS400 SERVERS

Here is a partial list of companies that use AS/400-iSeriesMany Casinos in Nevada and N.J. (Harrahs, Ameristar Casinos, American Casino, Boyd Gaming, Borgata Casino, Table Mountain Casino)
AAFES
Absolute Data Access
Affiliated Computer Services (ACS)
Alfa Laval Indutries
Atlas Copco
Sandwik Asia
Adidas
Affiliated Computer (ACS)
AIG Insurance
Alcoa Inc
Alcon Laboratories
All England Lawn Tennis Club (Wimbledon)
Allied Waste
Ashley Furniture
Bally Technologies
Barclays
Bank of america
Merryl Lynch
Bass Pro Shops
Bed Bath and Beyond
Blockbuster Video
Blue Cross Blue Shield of NC
Brinks Home Security
Brooks Brothers
Brookstone
Cabela Outfitters
Cardell Kitchen Cabinets
Cardinal Health
CargillChildrens Hospital of Philadelphia
Citigroup
Coldwater Creek
CompUSA
ConAgra Foods
Costco Wholesale
Countrywide Mortgage
Cox Communications
Dick's Sporting Goods
Discount Tire
Dean Foods
Dolby Laboratories
Dollar General
E & J Gallo Winery
Eaton Corp
EDS
FedEx Ground
GamestopGuitar
CenterHarley-Davidson Motor Co
Harte-Hanks
Home Depot
HSBC
Honeywell
Aerospacehotels.com
International Truck
Jos A Bank Clothiers
JP Morgan Chase
Linens n Things
LL Bean
Lockheed Martin
Major League Baseball (http://www.mlb.com/)
Massachusetts Eye and Ear - a teaching hospital of Harvard Medical School
MervynsMidway Amusement Games (Video Games)
Missouri Farm Bureau
Motel 6Mrs
Fields Cookies (also owns TCBY, Pretzeltime)
NBC Universal (the TV / Movie company)
Nintendo of America
Nordstrom Retail
O'Charleys Restaurants
Pacific Sunwear
Palm Harbor Homes
Penske Truck Leasing
Pepsico
Perot Systems
Pilgrims Pride
Pizza Inn
PC Connection (PC computer sales)
Polo
Ralph Lauren
Proctor and Gamble
Ricoh Electronics
Royal Caribbean Cruises
Sally Beauty
Sammons Trucking
Sbarro Restaurant
ScottTrade Inc
Sonic Drive-In
Suddenlink Communications
StaplesState Farm Insurance
Superior AirTime Warner Cable
Transplace
TransWorld Entertainment
Travelers InsuranceTurtle Wax,
IncUnion Bank of California
Wachovia Corporation
WalgreensWalker International Transport
Westfleet
Yellow Book USA
and many more .....

INTERESTING FACTS OF AS400 SERVER





  • Largest IT install base and has more than 750,000 system installed since 1988. The System i is the world's most popular multi-user business computer system
  • Has more than 18 million users sign-on every day
  • Is installed in over 16,000 banks worldwide, infact Practically Every bank uses AS400 Servers.
  • Is installed in 95% of the FORTUNE 100 and 85% of the Fortune 500
  • Most Manufacturing and Logistics Companies uses AS400 Server .
    25,000 applications run on System i, as well as 3,000 client/server applications. Additional application are being added as software vendors from other platforms migrate their code to the AS/400
  • IBM has invested $1B over the past 3 years in System i innovation
  • Is sold in more countries than McDonald's hamburgers
  • Is the only server that allows customers to run applications from four different operating system environments – i5/OS, AIX 5L, Windows Server and Linux – simultaneously on a single server.
  • Has more than 8,000 IBM Business Partner and Independent Software Vendors Worldwide
  • Bill Gates commented that the only part of IBM that Microsoft would be interested in was the AS/400 division. (At the time, many of Microsoft's internal systems ran on the AS/400 platform.
  • Programming languages available for the AS/400 include RPG, assembly language, C, C++, Pascal, Java, EGL, Perl, Smalltalk, COBOL, SQL, BASIC, PHP, PL/I, Python and REXX. Several CASE tools are available: AllFusion Plex (see *Plex Wiki), ADELIA, Synon, AS/SET, IBM Rational Business Developer Extension, LANSA and ProGen Plus.The IBM System i fully supports the Java language, including a 32-bit Java Virtual Machine (JVM) and a 64-bit JVM making it Multifunctional and useful in most of the Environments .

AS400 PRODUCTS AVAILABLE IN MARKET

IT Productivity Products
GZip/400™ - File compression/decompression utility
MSNTP/400™ - Time synchronizer
X5250/400™ - Terminal emulator
GUI Development Tools
Graphical Extensions/400™ for WebSphere Development Studio - Graphical User Interface toolkit for Wireless and Desktop "Application Specific Solutions"Tcl/Tk/400™ - Universal scripting languageX Window/400™ - Software libraries for iSeries, AS/400, Linux, and UNIX cross-platform applications
Development Services:
Application or component software development using iSeries & AS/400 ILE languages.Modernization of AS/400 ILE RPG or ILE C Language applications.Porting of applications from Unix to the iSeries & AS/400, complete with the User's Interface, such as database query tools or cross-platform agents that provide common access mechanisms for remote systems.
Some More Products ..
Movex
Jd Edwards - oneworld
Live400 by CSC
Many Insurance products
Turnover
Implementor by Aldon