Sunday, August 31, 2008

OCT – Operation Cost Target:

This value represents the maximum expenditure for material, labor, outsourcing, overhead, and all other costs associated with that project. This figure can then be divided between the various operations comprising the manufacturing process, in order to control costs at each step.

Tuesday, August 26, 2008

Calendar Coloring in Lotus Notes:

Lotus Notes 8 has added two new coloring features to calendar. Now in addition to defining the colors for the different meeting types, we can now define how we want unprocessed meetings and cancellations to appear on the calendar.

In Preferenes -> Calendar & To Do -> Colors, there is a option to set colors for the New meetings and Cancelled meetings.
Here is an example where we invite a person to a meeting.

He has not yet accepted the calendar invite that is in his in-box, but Notes 8 now displays the unprocessed meeting on his calendar anyway.
After he accepts, it is displayed as we would expect.
Then as the chairperson we have to unfortunately cancel the meeting. The person has not had the time to open the cancellation notice in his email, but Notes 8 automatically changes the way the meeting is displayed on his calendar, visually informing him that the meeting has been cancelled.

Monday, August 25, 2008

Quick method to find the name of the Calling Program:

Infinitely, IBM has kindly provided us with QWVRCSTK at V5.

D GetCaller PR Extpgm('QWVRCSTK')
D 2000
D 10I 0
D 8 CONST
D 56
D 8 CONST
D 15

D Var DS 2000
D BytAvl 10I 0
D BytRtn 10I 0
D Entries 10I 0
D Offset 10I 0
D EntryCount 10I 0
D VarLen S 10I 0 Inz(%size(Var))
D ApiErr S 15

D JobIdInf DS
D JIDQName 26 Inz('*')
D JIDIntID 16
D JIDRes3 2 Inz(*loval)
D JIDThreadInd 10I 0 Inz(1)
D JIDThread 8 Inz(*loval)

D Entry DS 256
D EntryLen 10I 0
D PgmNam 10 Overlay(Entry:25)
D PgmLib 10 Overlay(Entry:35)
D
C CallP GetCaller(Var:VarLen:'CSTK0100':JobIdInf
C :'JIDF0100':ApiErr)
C Do EntryCount
C Eval Entry = %subst(Var:Offset + 1)
C Eval Offset = Offset + EntryLen
C Enddo
C Eval *InLR = *on

Sunday, August 24, 2008

Tips for faster Query Access:

Faster is better when accessing large volumes of data. There are many ways to improve SQL performance, but here are four tips that are especially useful for high volume, read-only database access.

• Code a Set Option AlwCpyDta = *Optimize SQL statement (or the AlwCpyDta(*Optimize) parameter on the appropriate CL command). This lets the optimizer choose whether to create a new index or use a sort for a temporary copy of the data.

• Note that AlwCpyDta=*Yes actually means "use a copy only when it's required to perform the query." This allows the optimizer less latitude than the *Optimize option provides.

• Code a Set Option AlwBlk = *AllRead SQL statement (or the AlwBlk(*AllRead) parameter on the appropriate CL command). This maximizes system blocking when possible.

• Use a CL OvrDbF (Override with Database File) command with the SeqOnly(*Yes, mm) and/or the NbrRcds(nn) parameter(s) to specify system blocking for batch sequential Fetch's.

Use multi-row fetches to read a set of records with each Fetch statement.

Friday, August 22, 2008

V5R3 Enhancement in SQL:

SQL's INSERT command adds records to a table (physical file) or view (logical file). There are three forms of INSERT. The VALUES form allows you to create a record from constants. For example, assume a table PLANT with two columns (fields)--ID and NAME.

create table qtemp/Plants (ID char(4),Name char(12))

To create rows (records) for two factories, you could use two insert commands.

insert into qtemp/plants values('1492', 'Lost Angeles')
insert into qtemp/plants values('2001', 'New Yolk')

In V5R3, IBM enhanced the VALUES form of INSERT to permit you to insert more than one row at a time. The following INSERT command inserts two rows.

insert into qtemp/plants values ('1492', 'Lost Angeles'), ('2001', 'New Yolk')

Each row's values are enclosed in parentheses and separated from other rows with commas.

This is not an IBM-only feature. Other SQL platforms support it as well.

Thursday, August 21, 2008

Right Justify Character data using SQL:

There is no "right-justify" string function built into SQL, but it can still be done: Taking a character string of variable size and right-justifying within a target column containing a maximum of 12 characters. The example below does a bit more but it illustrates well what can be done, effectively concatenating blanks (up to 12) for a length of 12 - the length of the source column.

INSERT INTO TARGET_TABLE
SITE_CODE_RIGHT_JUSTIFED
SELECT
SUBSTR(' ', 1, 12 -
LENGTH( TRIM( CHAR_COLUMN_NAME)))
|| TRIM( CHAR_COLUMN_NAME )
FROM TABLE
FROM SOURCE_DATA

Tuesday, August 19, 2008

Various Date format conversions:

**********************************************************************
* character dates
d @chara s 8 inz('04/12/01')
d @charb s 10 inz('12/02/2004')
d @charc s 8 inz('12/03/04')
**********************************************************************
* date field
d @datea s d inz(d'2004-12-04')
**********************************************************************
* numeric dates
d @numa s 6 0 inz(041205)
d @numb s 7 0 inz(1041206)
d @numc s 8 0 inz(20041207)
d @numd s 6 0 inz(120804)
d @nume s 8 0 inz(12092004)
**********************************************************************
/free

//character to character...
@charb = %char(%date(@chara:*ymd/):*usa/); //'yy/mm/dd' to 'mm/dd/ccyy'
@charc = %char(%date(@chara:*ymd/):*mdy/); //'yy/mm/dd' to 'mm/dd/yy'
@chara = %char(%date(@charb:*usa/):*ymd/); //'mm/dd/ccyy' to 'yy/mm/dd'
@charc = %char(%date(@charb:*usa/):*mdy/); //'mm/dd/ccyy' to 'mm/dd/yy'
@chara = %char(%date(@charc:*mdy/):*ymd/); //'mm/dd/yy' to 'yy/mm/dd'
@charb = %char(%date(@charc:*mdy/):*usa/); //'mm/dd/yy' to 'mm/dd/ccyy'

//character to numeric...
@numa = %dec(%char(%date(@chara:*ymd/):*ymd0):6:0); //'yy/mm/dd' toyymmdd
@numb = %dec(%char(%date(@chara:*ymd/):*cymd0):7:0); //'yy/mm/dd' to cyymmdd
@numd = %dec(%char(%date(@chara:*ymd/):*mdy0):7:0); //'yy/mm/dd' to mmddyy
@numa = %dec(%char(%date(@charb:*usa/):*ymd0):6:0); //'mm/dd/ccyy' toyymmdd
@numb = %dec(%char(%date(@charb:*usa/):*cymd0):7:0); //'mm/dd/ccyy' to cyymmdd
@numd = %dec(%char(%date(@charb:*usa/):*mdy0):7:0); //'mm/dd/ccyy' to mmddyy
@numa = %dec(%char(%date(@charc:*mdy/):*ymd0):6:0); //'mm/dd/yy' to yymmdd
@numb = %dec(%char(%date(@charc:*mdy/):*cymd0):7:0); //'mm/dd/yy' to cyymmdd
@numd = %dec(%char(%date(@charc:*mdy/):*mdy0):7:0); //'mm/dd/yy' to mmddyy

//date to character...
@chara = %char(@datea:*ymd/); //d'ccyy-mm-dd' to 'yy/mm/dd'
@charb = %char(@datea:*usa/); //d'ccyy-mm-dd' to 'mm/dd/ccyy'
@charc = %char(@datea:*mdy/); //d'ccyy-mm-dd' to 'mm/dd/yy'

//numeric to character...
@chara = %char(%date(@numa:*ymd):*ymd/); //yymmdd to 'yy/mm/dd'
@charb = %char(%date(@numa:*ymd):*usa/); //yymmdd to 'mm/dd/ccyy'
@charc = %char(%date(@numa:*ymd):*mdy/); //yymmdd to 'mm/dd/yy'
@chara = %char(%date(@numb:*cymd):*ymd/); //cyymmdd to 'yy/mm/dd'
@charb = %char(%date(@numb:*cymd):*usa/); //cyymmdd to 'mm/dd/ccyy'
@charc = %char(%date(@numb:*cymd):*mdy/); //cyymmdd to 'mm/dd/yy'
@chara = %char(%date(@numc:*iso):*ymd/); //d'ccyy-mm-dd' to 'yy/mm/dd'
@charb = %char(%date(@numc:*iso):*usa/); //d'ccyy-mm-dd' to 'mm/dd/ccyy'
@charc = %char(%date(@numc:*iso):*mdy/); //d'ccyy-mm-dd' to 'mm/dd/yy'
@chara = %char(%date(@numd:*mdy):*ymd/); //mmddyy to 'yy/mm/dd'
@charb = %char(%date(@numd:*mdy):*usa/); //mmddyy to 'mm/dd/ccyy'
@charc = %char(%date(@numd:*mdy):*mdy/); //mmddyy to 'mm/dd/yy'
@chara = %char(%date(@nume:*usa):*ymd/); //mmddccyy to 'yy/mm/dd'
@charb = %char(%date(@nume:*usa):*usa/); //mmddccyy to 'mm/dd/ccyy'
@charc = %char(%date(@nume:*usa):*mdy/); //mmddccyy to 'mm/dd/yy'

//numeric to date...
@datea = %date(@numa:*ymd); //yymmdd to d'ccyy-mm-dd'
@datea = %date(@numb:*cymd); //cyymmdd to d'ccyy-mm-dd'
@datea = %date(@numc:*iso); //ccyymmdd' to d'ccyy-mm-dd'
@datea = %date(@numd:*mdy); //mmddyy to d'ccyy-mm-dd'
@datea = %date(@nume:*usa); //mmddccyy to d'ccyy-mm-dd'

//numeric to numeric...
@numb = %dec(%char(%date(@numa:*ymd):*cymd0):7:0); //yymmdd to cyymmdd
@numc = %dec(%char(%date(@numa:*ymd):*iso0):8:0); //yymmdd to ccyymmdd
@numd = %dec(%char(%date(@numa:*ymd):*mdy0):6:0); //yymmdd to mmddyy
@nume = %dec(%char(%date(@numa:*ymd):*usa0):8:0); //yymmdd to mmddccyy
@numa = %dec(%char(%date(@numb:*cymd):*ymd0):6:0); //cyymmdd to yymmdd
@numc = %dec(%char(%date(@numb:*cymd):*iso0):8:0); //cyymmdd to ccyymmdd
@numd = %dec(%char(%date(@numb:*cymd):*mdy0):6:0); //cyymmdd to mmddyy
@nume = %dec(%char(%date(@numb:*cymd):*usa0):8:0); //cyymmdd to mmddccyy
@numa = %dec(%char(%date(@numc:*iso):*ymd0):6:0); //ccyymmdd to yymmdd
@numb = %dec(%char(%date(@numc:*iso):*cymd0):7:0); //ccyymmdd tocyymmdd
@numd = %dec(%char(%date(@numc:*iso):*mdy0):6:0); //ccyymmdd to mmddyy
@nume = %dec(%char(%date(@numc:*iso):*usa0):8:0); //ccyymmdd to mmddccyy

@numa = %dec(%char(%date(@numd:*mdy):*ymd0):6:0); //mmddyy to yymmdd
@numb = %dec(%char(%date(@numd:*mdy):*cymd0):7:0); //mmddyy to cyymmdd
@numc = %dec(%char(%date(@numd:*mdy):*iso0):8:0); //mmddyy to ccyymmdd
@nume = %dec(%char(%date(@numd:*mdy):*usa0):8:0); //mmddyy to mmddccyy
@numa = %dec(%char(%date(@nume:*usa):*ymd0):6:0); //mmddccyy to yymmdd
@numb = %dec(%char(%date(@nume:*usa):*cymd0):7:0); //mmddccyy to cyymmdd
@numc = %dec(%char(%date(@nume:*usa):*iso0):8:0); //mmddccyy to ccyymmdd
@numd = %dec(%char(%date(@nume:*usa):*mdy0):6:0); //mmddccyy to mmddyy

*inlr = *on;

/end-free

Monday, August 18, 2008

Transfer your Lotus Notes Contacts on your ipod:

The steps to transfer the Lotus notes contacts to an ipod is given below.

Step 1. Attach your iPod to your computer. This should mount your iPod as a removable storage device, and you will see it has a folder called Contacts.

Step 2. Open your Lotus Notes Address Book to the Contacts view, and select the documents you want to export, or simply select all with CTRL+A.

Step 3. From the menus, choose File - Export. For "Save in" navigate to your iPod's "Contacts" folder. Provide a file name, for example, "Lotus Notes Contacts", and make sure to choose vCard for the "Save as type". Click Export.

You will be prompted with a few additional vCard export options, Leave the default options as such.


You'll see a progress bar as Notes exports the file, and you're done!

Disconnect your iPod, navigate to the iPod's Contacts application, and you'll see all your Lotus Notes contacts!

Sunday, August 17, 2008

Nominal Data:

Nominal data are categorical data where the order of the categories is arbitrary.

The data related to gender, race, religious affiliation, political affiliation etc; are the examples for Nominal data. In a more general form the data assigned with labels or names are considered as the data in Nominal scale. Since, each label or name indicates a separate category in the data; this data is also called as categorical data. The only comparison that can be made between two categorical variables is that they are equal or not, these variables can not be compared with respect to the order of the labels.

Wednesday, August 13, 2008

Efficiently Handling Subfile ‘More’:

To get a subfile to display the "More..." or "Bottom" automatically is an easy process for subfiles when configured in the mentioned way. In the subfile control record we need to use the same indicator for both the SFLDSP and SFLEND(*MORE) keywords as follows:
A 26 SFLDSP
A 26 SFLEND(*MORE)
Then in the program, when we write the first subfile record, the indicator will be turned on. As the subfile fills up, it will automatically put the correct value at the bottom of the screen.

Tuesday, August 12, 2008

What is Replication:

Replication is one of the most important, yet least understood features of Lotus Notes/Domino.

Replication is the process of keeping databases synchronized. That applies to both the design (the look and colors, the forms, the views that display the documents, the security, etc), and the information (documents) inside the databases.

Think of one of the Lotus Notes databases that we use at our company. May be a HelpDesk application, or Email, or a Document Library. That database most likely resides on more than one server in the company. Perhaps employees in Noida access it on Server A, while employees in Hyderabad access it on Server B, Chennai uses Server C, and people in US use Server D. We want everyone to see the same information. So when we create a new document in that database, or edit (update) and existing document, or even delete a document, replication is the Domino process that makes sure those changes are also reflected in the other databases.

Replication occurs on a schedule that your Domino Administrators set-up. For important databases this schedule maybe frequent, such as every 10 minutes, or 5,or even 1. Other databases which are not as "time sensitive" may replicate only once a day.

Monday, August 11, 2008

Process Capability:


Process capability compares the output of an in-control process to the specification limits by using capability indices.

We are often required to compare the output of a stable process with the process specifications and make a statement about how well the process meets specification. To do this we compare the natural variability of a stable process with the process specification limits.
A capable process is one where almost all the measurements fall inside the specification limits. This can be represented pictorially by the plot below:

Most capability indices estimates are valid only if the sample size used is 'large enough'. Large enough is generally thought to be about 50 independent data values.
Process Capability is given by,
Cp = USL - LSL
_________
6 Sigma

Who is locking the Record:

Facing record lock problem on iSeries is very. Assume that there is a physical file that can be accessed by a number of users at the same time; you want to update a record that is locked by another user. How do you know which user has locked that particular record?
DSPRCDLCK command on the iSeries that gives you this information Type DSPRCDLCK on the command line and take a prompt by pressing function key F4. Fill the required parameters, such as the name of physical file, library name, member name, etc. and press enter.
It's as simple as that!
You will get a screen that shows you the locked record number, name of the job and the user who has locked that record, the job number, status, and the type of lock.

Thursday, August 7, 2008

Color Coding Lotus Notes email:

In order to easily recognize emails from specific senders, Lotus Notes allows you to color code messages based on who the sender is.

To configure this, open your mail file and on the Action bar click Tools - Preferences.

Next select Mail - Colors. You can define three different sets of colors, and each set can contain multiple names.



There are many ways to configure your preferences. You could put your management chain in one color, your employees in another, and your teammates in the third. You could friends in one color, and family in another. You could also choose to define senders based on important projects you are working on. The point is, you can define the color coding in the way that best fits how you want to work.

Wednesday, August 6, 2008

Multi-Vari Chart:

In quality control, multi-vari charts are a visual way of presenting variability through a series of charts. The content and format of the charts has evolved over time.

As originally conceived, the multi-vari chart resembles a Shewhart individuals control chart with the following differences:
• The quality characteristic of interest is measured at two extremes (around its diameter, along its length, or across its surface) and these measurements are plotted as vertical lines connecting the minimum and maximum values over time.
• The quality characteristic of interest is plotted across three horizontal panels that represent:
• Variability on a single piece
• Piece-to-piece variability
• Time-to-time variability
• The quality characteristic of interest is plotted against upper and lower specifications rather than control limits. The three panels are interpreted as follows:




Panel
Condition Corrective action
Variability on a single piece Lengths of the vertical lines (i.e., the range) exceed one-half the specifications (or more) Repair or realignment of tool
Piece-to-piece variability Excessive scatter Examine process inputs for excessive variability—lengths of the vertical lines are estimates of process capability
Time-to-time variability Appearance of a non-stationary process Examine process inputs or steps for evidence of shifts or drifts

Tuesday, August 5, 2008

Copy Selected as Table in Lotus Notes:

This tip is going to show how to quickly link to multiple documents.

The screen capture below is of a Document Library. If I want to forward Document Links to several of these documents, I don't have to manually copy and paste each link one at a time. Instead, I select the documents I want:

and then either:

a) from the Notes menus choose "Edit - Copy Selected as Table"


b) right click in the view and choose "Copy Selected as Table"


c) click on the "Copy Selected as Table" toolbar icon.


Next, go into the document where you want to place the links, and "Paste" using either a) the Notes menu "Edit - Paste", b) the Right Click menu "Paste", c) the CTRL+V keyboard shortcut, d) the "Paste" toolbar icon. This will create a "table" of links to the documents you selected.



"Copy Selected as Table" even preserves many of the view's properties such as text colours/fonts and column colours.

Monday, August 4, 2008

Printing Part of IFS File:

There are two Qshell commands. Sed, the stream editor, can select the lines we want to print. The Rfile utility can send them to a printer.


If we know the line numbers, we can use a command like this one:

sed -n '93,96p' myfile.txt | rfile -wQ qsys/qsysprt

This command prints lines 93 through 96 of file myfile.txt.

If we want the system to select the lines based on the contents of the file, then:

sed -n '/WORLD/,/AMERICAN/p' myfile.txt | rfile -wQ sys/qsysprt

This example starts printing when it finds the string WORLD and stops printing after it finds a line with the string AMERICAN.

Here's another example that mixes the two record-selection methods:

sed -n '/WORLD/,104p' myfile.txt | rfile -wQ qsys/qsysprt

The system starts printing when it finds a line that contains WORLD, and stops printing after line 104.

The Rfile utility allows Qshell to work with record-oriented files.

Sunday, August 3, 2008

Mean, Median, Mode:

Mean:
The mean is the average data point value within a data set. To calculate the mean, add all of the individual data points then divide that figure by the total number of data points.

Median:
The median is the middle point of a data set; 50% of the values are below this point, and 50% are above this point.

Median is the middle value, when all possible values are listed in order. Median is not the same as Average (or Mean).

Mode:
It is the value or item occurring most frequently in a series of observations or statistical data.

It is the most often occurring value in the data set.

A data set may contain more than one mode, e.g., if there are exactly 2 values or items that appear in the data the same number of times, we say the data set is bi-modal.