| Subcribe via RSS

Watch CCTV9 streaming on your computer

October 27th, 2009 | No Comments | Posted in China, IT |

After some weeks, I finally found how to watch CCTV9 (Chinese TV, in English), on my computer. CCTV provide a free streaming flux on his website. But actually, they use a .. windows script to show the video. So, just show the source and we have what we want:

CCTV.com

CCTV.com

DB2 Data compression

September 17th, 2009 | No Comments | Posted in IBM DB2 |

Disk storage is not cheaper, take place, make noise, so, for large warehouses (or huge volumes database), the cost of the storage become important. IBM DB2 have a solution, with the data compression named “Venom” technology, reducing storage requirements, improving I/O, and providing quicker data access from the disk.

DB2 uses a dictionary based algorithm for compressing data records. DB2 9 will scan tables, and search for duplicate occurrences, then assign a short numeric key to each entries. You will understand better with a picture:

Compress data

Compress data

Each new occurences of “Sophie”, “New York”, “IBM US”, will be respectively assign to “(01)”, “(19)” and “(09)”. This is very useful on large table. Each time a new row is added to the table, DB2 will automatically compress these new data.

Seems to be good, let’s try on our DB2 now. To enable the compression,  we should turn on the “COMPRESS” option on the table.

CREATE TABLE Users COMPRESS YES

or use alter if the table is already created:

ALTER TABLE Users COMPRESS YES

Typically, we can save an average ratio of 45 to 75 percent of our storage space. Next time, we’ll see how to use the inspect tool, to determine the compression ratio.

Tags: ,

Customize your DB2 CLP prompt

September 3rd, 2009 | 3 Comments | Posted in IBM DB2 |

You have a nice DB2 CLP prompt, looks like “db2>”, but you want more, you want a efficient prompt. It is possible with DB2 to add or modify your CLP ! DB2 have a registry variable named DB2_CLPPROMPT which allows us to define the prompt to be used in the CLP interactive mode.

To define this variable, let’s use the DB2set command:

Db2set DB2_CLPPROMPT="db2isgreat> "

Our new DB2 Prompt will be “db2isgreat> “. It’s much more better, but we can do more. DB2_CLPPROMPT registry variable can contain the tokens %n, %ia, %d, %da and %i:

  • %n – New line
  • %ia – Authorization ID of the current instance attachment
  • %d – Local alias of the currently connected database
  • %da – Authorization ID of the current database connection
  • %i – Local alias of the currently attached instance

Now, let’s try with these tokens:

Db2set DB2_CLPPROMPT="%ia@%i, %da@%d> "

With an instance attachment to instance “DB2″ with authorization ID “mycado”. Database “sample” with authorization ID “mycadoax”, will return something like:

MYCADO@DB2, MYCADOAX@SAMPLE >

You can now everytime where you are, and one which instance/database you’re working on.

Tags: , , ,

Let’s start with JCL

August 29th, 2009 | No Comments | Posted in IBM system z |

You probably know PHP, Java, C, and lot of other programming languages, but what about JCL ? No, it’s not about Java, it’s about Job Control Language a scripting language used on mainframe to instruct the system on how to run a batch job. It is possible to submit JCL for batch processing or directly by to start a JCL procedure (PROC). JCL is very important to create, check, correct and run the daily batch workload.

It’s easy, you have three basic  statements:

  • JOB: Provides a name (jobname) for the batch.
  • EXEC: Provides the name of a program to execute.
  • DD: For Data Definition, provides inputs/outputs to the program.

Let’s see a JCL example:

//MYJOB     JOBTES 1
//MYSORT    EXEC PGM=SORT
//SORTIN    DD DISP=SHR,DSN=SUP01.TAB.TEST
//SORTOUT   DD SYSOUT=*
//SYSOUT    DD SYSOUT=*
//SYSIN     DD *
SORT FIELDS=(1,4,CH,A)
/*

Now, try to understand what’s happen here.

  • MYJOB is the jobname associates to the workload, here it’s “JOBTES”.
  • MYSORT is the stepname, which ask the system to execute a program called “SORT”.
  • SORTIN is the program input, here with the DSN (Data Set Name) SUP01.TAB.TEST, and the dataset can be shared (DISP=SHR).
  • SORTOUT is the SORT program output.
  • SYSOUT specifies to send system output to JES (Job Entrey Subsystem), but it’s also possible to send the outpu to a dataset.
  • SYSIN tell the SORT program which fields of the SORTIN data records are to be sorted.

Enough for the moment, JCL is quite hard at beginning !

Tags: ,

Mapping Unix to z/OS concepts

August 28th, 2009 | No Comments | Posted in IBM system z |

Unix and z/OS have common points, but they have very different concepts.

With Unix we talk about “boot” a system, with z/OS we talk about IPL (Initial Program Load). IPL is a hardware function, not a program run on the system. The IPL function reads 24 bytes from an operator-specified or pre-configured device into memory starting at location zero.

With Unix we talk about “files”, with z/OS we talk about Datasets. Datasets are not unstructured streams of bytes, but rather are organized in various logical record and block structures determined by the DSORG (data set organization), RECFM (record format), and other parameters. Programmers utilize various access methods (such as QSAM or VSAM) in programs reading and writing data sets, their choice depending on given data set organization.

With Unix we have the system configuration data in the /etc, with z/OS we have PARMLIB which control how the system IPLs and how address spaces behave.

With Unix we have the Shell scripts, Awk, Perl,.., with z/OS we have REXX execs and CLISTS.

With Unix we have threads which are supported by the Kernel, with z/OS we have tasks or a service request block (SRB).

With Unix we edit data with Vi, emacs, sed, with z/OS we use ISPF, which is more powerful than you can think..

With Unix we have the ps and kill command, to view processes and kill them, with z/OS we have SDSF who allow to view and terminate a job.

Tags: ,