web of unni

About | GuestBook | Add WebOfUnni to Google ToolBar

Download Day

July 11, 2007

finding the distro name of linux

Filed under: linux — unni @ 6:39 am

Here is some tips to find out which is your linux distro

Use commands

cat /proc/version

cat /etc/issue

dmesg | head -1

use script

#/bin/bash
#by www.webofunni.co.nr
kernel=`uname -r`
machine=`uname -m`
if [ -f /etc/redhat-release ] ; then
distro=`cat /etc/redhat-release`
elif [ -f /etc/SuSE-release ] ; then
distro=`cat /etc/SuSE-release`
elif [ -f /etc/mandrake-release ] ; then
distro=`cat /etc/mandrake-release`
elif [ -f /etc/debian_version ] ; then
distro=`cat /etc/debian_version`
fi
echo -e “Your distro : ${distro} \nKernel version : ${kernel} \nmachine : ${machine}”

July 6, 2007

building a mainframe in home

Filed under: mainframe — unni @ 7:10 pm

Actually i am thinking of building a mainframe in my home i got this idea from a blog from sipples but in his blog he actually planning to build a real mainframe in his home but i like to emulate it in my pc. So how can i emulate a mainframe in my pc ?

I downloaded the mainframe emulator hercules from http://www.hercules-390.org/hercules-3.04-native.exe and i downloaded the tur(N) key mvs from http://www.ibiblio.org/jmaynard/turnkey-mvs-3.zip and i installed them

in my pc to get my pc converted into a mainframe . After a lot of trial and error methods and new user cook book details i got my login screen

specifying compiler options

Filed under: mainframe — unni @ 7:08 pm

We will discuss something about specifying compiler options for cobol compiler ie: IGYCRCTL

there are many methods by which we can specify compiler options one is to use CBL or PROCESS statements before IDENTIFICATION DIVISION. we will see the syntax of CBL and PROCESS now

>–CBL—option list———-><

>–PROCESS–option list——-><

for example if you want to specify LIB compiler option use

CBL LIB

IDENTIFICATION DIVISION. ……………………………………………………………………………
……………………………………………………

we can specify different compiler options by separating them by space

ie CBL LIB NODYNAM

for more details visit cbl&process at ibm

The other option is to use the parm parameter in the exec statement which invokes the IGYCRCTL for example give //STEP1 EXEC PGM=IGYCRCTL,PARM=’LIB’

Link editing MAIN and SUB program in IGYCRCTL Cobol compiler

Filed under: mainframe — unni @ 7:04 pm

The following is the IGYWCL procedure which calls the cobol compiler IGYCRCTL (In line 04 ) . Now let us see
how we can modify it to make the CALL statement work with this procedure

————————————————-IGYWCL—————————————————–
01 //IGYWCL PROC LNGPRFX=’IGY310′,SYSLBLK=3200,
02 // LIBPRFX=’CEE’,
03 // PGMLIB=’&&GOSET’,GOPGM=GO
04 //COBOL EXEC PGM=IGYCRCTL,REGION=2048K
05 //STEPLIB DD DSNAME=&LNGPRFX..SIGYCOMP,
06 // DISP=SHR
07 //SYSPRINT DD SYSOUT=*
08 //SYSLIN DD DSNAME=&&LOADSET,UNIT=SYSDA,
09 // DISP=(MOD,PASS),SPACE=(TRK,(3,3)),
10 // DCB=(BLKSIZE=&SYSLBLK)
11 //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
12 //SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
13 //SYSUT3 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
14 //SYSUT4 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
15 //SYSUT5 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
16 //SYSUT6 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
17 //SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
18 //LKED EXEC PGM=HEWL,COND=(4,LE),REGION=1024K
19 //SYSLIB DD DSNAME=&LIBPRFX..SCEELKED,
20 // DISP=SHR
21 //SYSPRINT DD SYSOUT=*
22 //SYSLIN DD DSNAME=&&LOADSET,DISP=(OLD,DELETE)
23 // DD DDNAME=SYSIN
24 //SYSLMOD DD DSNAME=&PGMLIB(&GOPGM),
25 // SPACE=(TRK,(10,10,1)),
26 // UNIT=SYSDA,DISP=(MOD,PASS)
27 //SYSUT1 DD UNIT=SYSDA,SPACE=(TRK,(10,10))
——————————————————————————————————————-

In this procedure line 01 to 17 is compiler procedure and line 18 to 27 is used for link edit. The line 19 is to identify syslib
syslib is the system library here it is CEE.SCEELKED where the cobol compiler link edit files reside .

Ok now we will see how The CALL statement will impliment

First create a main cobol file let the content in main be

01 ID DIVISION.
02 PROGRAM-ID. MAIN.
03 DATA DIVISION.
04 PROCEDURE DIVISION.
05 MAIN.
06 DISPLAY ‘THIS IS FROM MAIN PROG’.
07 CALL ‘SUB’.
08 STOP RUN.

Create a sub program let it be

01 ID DIVISION.
02 PROGRAM-ID. SUB.
03 PROCEDURE DIVISION.
04 MAIN.
05 DISPLAY ‘I AM FROM SUB’.
06 EXIT PROGRAM.

Compile sub program first and put the load module in say ESCUB12.UNNI.LOAD then compile main but you
will get an error saying that Module sub unresolvable it is because the module sub is not in SYSLIB
to remove this error create a jcl to compile main as like below

1 //COMPIL JOB NOTIFY=&SYSUID,CLASS=A,
2 // MSGCLASS=H,MSGLEVEL=(1,1),LINES=(1,CANCEL)
3 //JOBPROC JCLLIB ORDER=SYS2.SAMPLE.PROCLIB ** DO NOT CHANGE **
4 //COBC EXEC IGYWCL,
5 // PGMLIB=ESCUB22.UNNI.LOAD,
6 // GOPGM=MAIN
7 //COBOL.SYSIN DD DSN=ESCUB12.UNNI.PDS(MAIN),DISP=SHR
8 //LKED.SYSLIB DD DSN=ESCUB12.UNNI.LOAD,DISP=SHR
9 // DD DSN=CEE.SCEELKED,DISP=SHR

See line 8 and 9 we are overriding the SYSLIB in IGYWCL and creating a new syslib That is concatenated PDS of
the load library of SUB and the SYSTEM LIBRARY
Now compile MAIN hope your Main program resides in ESCUB12.UNNI.PDS
After compiling main run the load module main hope you will get the following result
—————————————————–
THIS IS FROM MAIN PROG
I AM FROM SUB
——————————————————

Created and maintained by Unnikrishnan
Hosted by Host cats