| Subcribe via RSS

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: ,

Terminology mapping between Oracle and DB2

August 28th, 2009 | 2 Comments | Posted in IBM DB2 |

For people wants move from Oracle to DB2, this a little terminology mapping:

Oracle DB2
Instance Instance
Redo logs Logs files
Statement cache Package cache
Datafiles DMS containers
Data cache Buffer pools
Data dictionary System catalog
Datafiles Containers
Segments Objects
Data blocks Pages
Database Link Federated System

And also, some useful mapping between Oracle and DB2 products:

Oracle DB2
Oracle EE DB2 Entreprise
Oracle Gateway DB2 Connect
SQL *PLUS DB2 CLP / DB2 CLP PLUS
PL/SQL SQL Procedural Language

You should also take care of the “package” term. For Oracle it’s a logical grouping of PL/SQL blocks that can be invoked by other PL/SQL applications, and for DB2 it’s a precompiled access plan for an embedded static SQL application stored in the server.

Tags: , ,

Queries on XML data with XQuery

August 26th, 2009 | No Comments | Posted in IBM DB2 |

We know how to store native XML data in our DB2 tables, and now we will see how we can access to these data. We can choose between standard SQL queries and XQuery.. or both ! The first solution, with a SQL query, only query at the column level of your table; this query will return the full XML data. The second solution, with XQuery, allow us to make a “query” inside our XML data.

For the SQL query, nothing more than a SELECT:

SELECT id, info from client

Easy, but not really powerful for XML data, let’s try with XQuery, who give us two functions for DB2. db2-fn:sqlquery and db2-fn:xmlcolumn. The first function retrieves a sequence that is the result of an SQL fullselect and the second retrieves a sequence from a column. One important thing you should keep in mind, SQL is not a case-sensitive language alors que XQuery is a case-sensitive language.

An example which return all the XML data from the “info” column:

XQUERY db2-fnxmlcolumn ('CLIENT.INFO')

Which is same as this SQL query:

SELECT info FROM client

Let’s see something more nice. This query will return all the elements in <name> , inside the “info” column, and with the <city> element which containt “Paris”:

XQUERY declare defaut element namespace "http://posample.org";
for $d in db2-fn:xmlcolumn('CLIENT.INFO')/clientinfo
  where $d/addr/city="Paris"
return <out>{$d/name}</out>

db2-fn:xmlcolumn retrieves the data from the “info” column in the “client” table. We add a $d variable, for each element of <clientinfo>, and we use a where to filter the <city> element which should be “Paris. To finish, we use <out> to output the data:

<out xmlns="http://posample.org">
  <name>Sophie Bool</name>
</out>

To finish, the same example with a SQL query inside the XQuery:

XQUERY declare default element namespace "http://posample.org";
for $d in db2-fn:sqlquery('SELECT info FROM client')/clientinfo
  where $d/addr/city="Paris
return <out>{$d/name}</out>

Enough for today, we will see next time how to do more complex and more powerful query with XQuery !

Tags: , , ,

Googles Voice is nice.. in United States !

August 25th, 2009 | No Comments | Posted in IT |
Google Voice

I’m glad to have an invitation on the Google Voice, this is a really good news. Only one point made me angry, why they send me an invitation if I can’t use in my country ?

Google Voice is not available in your country.
Thanks for visiting Google Voice. We’re not yet open for users outside the US, but are planning to expand our service to additional countries in the future.

I’m french, living in China, but Google Voice only work in United States.. So, thank you Google, now I only hope this service will be available soon in France or China ! Anyway, I’ve use a friend proxy to take a pretty easy number (+1 740 20000 11). Let’s see if I can use in the future.

Tags: , ,