Wednesday, April 22, 2009

COBOL and Mainframe Job Search

COBOL and Mainframe Job Search

Sunday, April 19, 2009

Difference between MAP AND MAPSET

Difference between MAP AND MAPSET

Representation of one screen format is called Map (Screen panel). One or more maps linkedited together makes up a mapset (load module). Mapset must have an entry in the PPT. Mapset name has two parts. Generic name (1-7 chars which is used in app pgm) and suffix (1 char to identify the device type)

EMPMAP DFHMSD TYPE=MAP,
MODE=INOUT,
LANG=COBOL,
STORAGE=AUTO,
TIOAPFX=YES,
CNTL=(FREEKB,FRSET,PRINT)

EMPMAP DFHMDI SIZE=(LL,CC)
LINE=NN,
COLUMN=MM,
JUSTIFY=LEFT/RIHT

DFHMSD TYPE=DSECT ===> mapset
DFHMDI ===> MAP
DFHMDF ===> FIELD

Only one mapset is allowed in one assembly run.

What is BMS BASIC MAPING SUPPORT

BASIC MAPING SUPPORT

Contents of the CICS screen defined thru BMS is called a MAP which is written in assembly language.

Primary functions of BMS


  1. Removal of device dependent codes from Application Program
  2. Removal of constant information from Application program (Headers, Titles...)
  3. Construct NMDS - Native Mode Data Stream
  4. Text handling
  5. Terminal Paging & Message routing
  6. Contents of the screen defined thru’ BMS is called Map.
  7. Map is a program written in assembly language.
  8. BMS macros are available for Map coding.
  9. Maps are of two types. Physical Map & Symbolic Map
In order to display formatted screen, a terminal ( eg. 3278) must receive a series of data stream called Native Mode Data Stream(NMDS) which is a mixture of Buffer Control Characters(BCCs) and text data, based on the hardware protocol. Since NMDS is designed for a particular terminal, it is both device dependent and format dependent. So if NMDS is used, re-coding is required whenever there is change in the terminal device or screen format. To remove this device and format dependency from application program, CICS provides a facility called BMS Remove device dependent codes - by placing them (3270 BCCs) in maps
eg. screen size
Remove constant information - by placing the default constants in maps Terminal Paging : Allows combination of several small mapped data areas into one or more pages of output.
Message Routing : Allows sending of messages to one or more terminals.

Saturday, April 18, 2009

COBOL STATEMENTS NOT ALLOWED IN CICS PROGRAMS

File management is handled by CICS. So, FILE SECTION, OPEN, CLOSE, NON CICS READ, WRITE etc are not allowed. Same is the case with ACCEPT, DISPLAY, EXHIBIT, TRACE, STOP RUN, GOBACK

COBOL Interview Questions FAQs and more 1

I was preparing for an Mainframe cobol interview. So i thought of jot down some of the important questions which comes to my mind as and when i revise the topic. It might be useful for someone some day.

Let us start with the bare basics and then proceed to higher levels.

1) Cobol full form - Acronym for COmmon Business-Oriented Language

2) Structure of cobol program

IDENTIFICATION DIVISION
PROGRAM-ID.
AUTHOR
INSTALLATION
DATE-WRITTEN
DATE-COMPILED
SECURITY
.
ENVIRONMENT DIVISION
CONFIGURATION SECTION
SOURCE-COMPUTER
OBJECT-COMPUTER
SPECIAL-NAMES
INPUT-OUTPUT SECTION.
FILE CONTROL.
I-O-CONTROL.
.
DATA DIVISION
FILE SECTION.
WORKING-STORAGE SECTION.
.
PROCEDURE DIVISION

3) PICTURE CLAUSE CODE CHARACTER

9 ==> Indicates a numeral
X ==> Indicates an alpha numeric character
A ==> Alphabet or a space
V ==> Assumed decimal point
P ==> Assumed decimal point (point lies outside the data item)
S ==> Indicates a signed data item

4) What is VALUE clause in cobol

Defines an initial value of a data item. Normally used for initialization.
eg. 01 VAR-1 PIC X(5) VALUE SPACES

5) What is a FILE SECTION in cobol

Contains a file description entry followed by one or more record descrition entries for each of the files used in a program.

6) What are the edit characters for numeric data in cobol?

The following characters can be used in PICTURE clause to indicate numeric editing in cobol

Z ==> Used for zero suppression and replaced by space characters

* ==> Same as Z but instead of blanks the zeroes are suppressed by replacing it with *

$ ==> Single currency sign can appear at the leftmost position of a picture.

- ==> a minus sign can appear in the left or right most part of pic clause. If value of the item is negative then a minus sign is inserted otherwise a space is inserted.

+ ==> same as a minus sign. But if the item is negative, a minus sign is inserted instead of +.

CR ==> Can appear in the right most position of a pic clause only. It will appear only if item is negative. Otherwise two spaces will be added.

DB ==> Can appear in the right most position of a pic clause only. It will appear only if item is negative. Otherwise two spaces will be added.

. ==> To indicate a decimal point and cannot appear more than once. Both period and V cannot appear in the same picture.

, ==> Acts as an insertion character and inserted wherever it appears. There can be more than one comman in a picture. if we move 246 to *,***,** then we will get ****2,46 (The first comma will be replaced with space in this case and all similar cases)

B ==> For inserting blanks. Can be more than one blank

0 ==> A zero appering i a picture will be treated in the same way as a B except that 0 will be inserted.

/ ==> Can appear anywhere in the picture.

BLANK WHEN ZERO ==> It is an editing clause which may be used along with a picture. This will set the entire data item to blanks if the value is zero. Cannot be used with *.

7) What is a USAGE clause. What are the common usages?

Computer can store data in more than one internal form. A programmer can specify the internal form of data so as to facilitate the use of the data item more efficiently. Broadly there are two kinds of internal reprecentation. Computational and display.

The popular computational usages are

COMP
COMP-1
COMP-2
COMP-3

8) What is COMP, COMP-1, COMP-2 AND COMP-3?

COMP ==> Pure binary. Depending on size of data item, it can be stored either in a half word or in full word.

COMP-1 ==> Represented in one word in the floating point form. The number is actually represented in hexadecimal. It is suitable for arithmatic operations. Picture clause cannot be specified for COMP-1 items.

COMP-2 ==> Usage is same as comp1 but instead of one word, COMP-2 is represented internally in two words. The advantage is increased precission of the data which means more significant digits. A picture clause cannot be specified for COMP-2 items.

COMP-3 ==> In this form the numeric data is represented in the decimal form but one digit takes half a byte. The sign is stored seperately as the rightmost half byte regardless of whether S is specified in the PICTURE or not. The hexadecimal number C or F denotes a positive sign and the hexadecimal number D denotes a negative sign.

For more COBOL FAQs, click the relevant links in this page.

Friday, April 17, 2009

Management programs and control Tables in CICS

Programs

Program Control PCP
File control FCP
Terminal Control TCP
Storage Control SCP
Task Control KCP
Temporary Storage TSP
Transient Data TDP
Interval Control ICP
Journal Control JCP

Tables


Processing Progm Table PPT
File Control Table FCT
Terminal Control Table TCT
Program Control Table PCT
Temporary Storage Table TST
Destination Control Table DCT
Resource control Table RCT

Thursday, April 16, 2009

Difference between conversational and pseudo conversational programs in CICS

Conversational (Mode of communication between prog and terminal by sending messages ==> Results in waste of CPU Resources as cpu has to wait till the human responds) & Pseudo conversational (Make it look like conversational but CPU is not tied up). Pseudo conversational mode = RECEIVE ==> SEND ==> RETURN TRANSID('TSK123').

Wednesday, April 15, 2009

Physical map and symbolic map in CICS Difference

What is the difference between Physical map and symbolic map in CICS?



PHYSICAL MAP AND SYMBOLIC MAP = Physical map is a map used by CICS (CSECT) which ensures device independence in the application program. Symbolic map is a map used by application program (DSECT). It ensures device and format independance in an application program.

Differnce between QMF and Spufi

QMF (Query Management Facility) is a query/reporting environment with the ability to format reports. SPUFI is just a quick and dirty SQL execution engine. If you need to produce nice-looking reports, enable user input to a query, or store your queries and reports for future usage, QMF is a much better technology for doing so.QMF also offers data formatting and translation capabilities that are difficult (sometimes impossible) to accomplish using SPUFI and SQL alone.A typical end-user might have difficulty using SPUFI because it requires using data sets to store your SQL statements and pass them to DB2. The results are also delivered to another data set. Most end users are not comfortable managing and manipulating mainframe data sets. QMF, on the other hand, stores its queries in tables and hides this fact from the user with a nice interface for saving and recalling SQL queries (and results). Keep in mind, though, that SPUFI comes for free with DB2 whereas QMF is an add-on product and costs money. Not every DB2 customer will have QMF, whereas every DB2 (mainframe) customer will have SPUFI.

OK, now, what does SPUFI stand for? The answer: SQL Processor Using File Input.

CICS Fullform. What is CICS?

CICS stands for Customer information control system. It is an online transaction processing module usually used in IBM Mainframes.

According to wiki CICS (Customer Information Control System) is a transaction server that runs primarily on IBM mainframe systems under z/OS and z/VSE.

CICS is a transaction manager designed for rapid, high-volume online processing. This processing is mostly interactive (screen-oriented), but background transactions are possible.

While CICS has its highest profile among financial institutions such as banks and insurance companies, over 90 percent of Fortune 500 companies are reported to rely on CICS (running on z/OS) for their core business functions, beside many governments. CICS is used in bank-teller applications, ATM systems, industrial production control systems, insurance applications and many other types of interactive application.

Recent CICS Transaction Server enhancements include support for Web services and Enterprise Java Beans (EJBs). IBM began shipping the latest release, CICS Transaction Server - Version 3.2, in June 2007.

Transactions

A CICS transaction is a set of operations which together perform a task. Usually, the majority of transactions are relatively simple tasks such as requesting an inventory list or entering a debit or credit to an account. On IBM System z servers, CICS easily supports thousands of transactions per second, making it a mainstay of enterprise computing.

CICS applications comprise transactions which can be written in numerous programming languages, including COBOL, PL/I, C, C++, IBM Basic Assembly Language, REXX, and Java.

Each CICS program is initiated using a transaction identifier. CICS screens are sent as a construct called a map, a little program created with BMS (Basic Mapping Support) assembler macros. The end user inputs data, which is made accessible to the program by receiving a map from CICS. CICS screens may contain text that is highlighted, has different colors, and/or blinks. An example of how a map can be sent through COBOL is given below.

EXEC CICS
SEND MAPSET(MPS1) MAP(MP1)
END-EXEC.

[edit] CICS Family

Although when CICS is mentioned, people usually mean CICS Transaction Server, the "CICS Family" refers to a portfolio of transaction servers, connectors (called CICS Transaction Gateway) and CICS Tools.

CICS on distributed platforms is called TXSeries and it is available on AIX, Windows, Solaris and HP-UX. CICS is also available on other operating systems, notably i5/OS, OS/2. The z/OS implementation (i.e., CICS Transaction Server for z/OS) is by far the most popular and significant.

[edit] Structure

In the z/OS environment, a CICS installation comprises one or more regions, spread across one or more z/OS system images. Although it processes interactive transactions, each CICS region may be started as a batch address space with standard JCL statements: it's a job that runs indefinitely. Alternatively, each CICS region may be started as a started task. Whether a batch job or a started task, CICS regions may run for days, weeks, or even months before shutting down for maintenance (MVS or CICS).

Each region comprises one major task — the "Quasi-Reentrant Task Control Block" (or QR TCB for short), on which every transaction runs. When certain services are required (such as access to DB2 data), other tasks (or TCBs) are used. Transactions marked Threadsafe don't return to the QR TCB when their use of a service is complete.

Installations are divided into multiple address spaces for a wide variety of reasons, such as:

* application separation,
* function separation,
* avoiding the workload capacity limitations of a single region, or address space.

A typical installation consists of a number of distinct applications. Each application usually has its own "Terminal-Owning Region" (TOR) and one or more "Application-Owning Regions" (AORs), though other topologies are possible. For example, the AORs might not perform File I/O. Instead there would be "File-Owning Regions" (FORs) that performed the File I/O on behalf of transactions in the AOR.

[edit] History

The first release of CICS was made available on July 8, 1969, not long after IMS. It was originally developed in the United States at IBM's Palo Alto lab. In 1974, CICS development shifted to IBM's programming labs in Hursley, United Kingdom, where work continues today. An earlier, single thread, transaction processing system IBM MTCS existed prior to CICS and an 'MTCS-CICS bridge' , a type of middleware, was developed to allow these transactions to execute under CICS with no change to the original application programs.

When CICS was first released, it supported programs written in IBM Assembler, PL/I and COBOL. Programs needed to be quasi-reentrant in order to support multiple concurrent transaction threads. Its modular design meant that, with judicious "pruning", theoretically it could be executed on a computer with just 32K of physical memory (including the operating system). In actual practice, however, CICS was a resource hog[citation needed]needing vastly superior processing capacity (mainly CPU power and main storage size) in order to deliver any measure of useful work[citation needed].

Each unique CICS "Task" or transaction was allocated its own dynamic memory at start-up and subsequent requests for additional memory were handled by a call to the "Storage Control program" (part of the CICS nucleus - or "kernel"), which is analogous to an operating system.

Because application programs could be shared by many concurrent threads, the use of static variables embedded within a program (or use of operating system memory) was restricted (by convention only).

Unfortunately, many of the "rules" were frequently broken, especially by COBOL programmers who were frequently unaccustomed to the internals of their programs or else did not use the necessary restrictive compile time options. This resulted in "non-re-entrant" code that was often unreliable, leading to many spurious storage violations and entire CICS system crashes.

The entire partition, or region, operated with the same memory protection key including the CICS kernel code and so program corruption and CICS control block corruption was a frequent cause of system downtime.

These shortcomings nevertheless persisted for multiple new releases of CICS over a period of more than 20 years and, as stated above, were often critical applications used by large banks and other financial institutions.

It was possible to provide a good measure of advance protection by performing all testing under control of a monitoring program that also served to provide Test/Debug features. One such software offering was known as OLIVER, which prevented application programs corrupting memory using instruction simulation.

System calls to CICS (for example to read a record from a file) were elicited by a macro call and this gave rise to the later terminology "Macro-level CICS". An example of a call to the "File Control Program" of CICS might look like this:-

DFHFC TYPE=READ,DATASET=myfile,TYPOPER=UPDATE,....etc

This was converted by a pre-compile Assembly which expanded the conditional assembly language macros to their COBOL or PL/I CALL statement equivalents. Thus preparing a HLL application was effectively a "two-stage" compile; output from the Assembler fed straight into the HLL compiler as input.

[edit] Command-level CICS

During the 1980s, IBM at Hursley produced a "half-way house" version of CICS which supported what became known as "Command-level CICS". This release still supported the older programs but introduced a new layer of execution to the new Command level application programs.

A typical Command-level call was given in the first MAPSET example above. This was pre-processed by a pre-compile batch translation stage, which converted the embedded Command-level commands (EXECs) into Call statements to a stub subroutine. So, preparing application programs for later execution still required two stages. It was possible to write "Mixed mode" applications using both Macro-level and Command-level statements.

At execution time, the carefully built Command-level commands were converted back using a run-time translator ("The EXEC Interface Program"; part of the CICS-supplied nucleus) to the old Macro-level call, which was then executed by the mostly-unchanged CICS nucleus programs.

CEDF: This IBM-produced "Command Execution Diagnostic Facility" helped debug 'EXEC CICS' commands by showing before and after results. The "OLIVER" software predated this free add-on by more than 10 years, and yet CEDF came without any form of memory protection. It was, however, complementary to OLIVER, and both could be used simultaneously.

The Command-level-only CICS introduced in the early 1990s offered some advantages over earlier versions of CICS. However, IBM also dropped support for Macro-level application programs written for earlier versions. This meant that many application programs had to be converted or completely rewritten to use Command-level EXEC commands only, usually by programmers without exposure to earlier versions or to the original code.

By this time, there were perhaps millions of programs worldwide that had been executing fairly reliably; for decades in many cases. Rewriting them inevitably introduced new bugs without necessarily adding new features.

[edit] Run-time conversion

It was, however, possible to execute old Macro-level programs using conversion software such as "Command CICS" produced by APT International, a former CICS Software Specialist company which had earlier produced OLIVER, described above. It was possible to take advantage of the new features of later versions of CICS while, at the same time, retaining the original unaltered codebase. It is believed that there are still programs running today using this same technology. The overhead was minimal, since additional overhead was limited to the CICS calls only.

[edit] Z notation

Part of CICS was formalized using the Z notation in the 1980s and 1990s in collaboration with the Oxford University Computing Laboratory, under the leadership of Sir Tony Hoare. This work won a Queen's Award for Technological Achievement.

[edit] New programming styles

Recent CICS Transaction Server enhancements include support for a number of modern programming styles.

CICS Transaction Server Version 2.1 introduced support for Enterprise Java Beans (EJB). CICS Transaction Server Version 2.2 supported the Software Developers Toolkit. CICS provides the same runtime container as IBM's WebSphere product family so EJB applications are portable between CICS and Websphere and there is common tooling for the development and deployment of EJB applications.

Also introduced with CICS TS 2.1 was the capability for CICS transactions to be invoked via an HTTP request. This allowed CICS transactions to participate as servers in a POX or REST conversation.

CICS Transaction Server 2.3 added new EJB tracing capabilities, and new JCICS classes, allowing the invocation of CICS services using Java. End-to-end debugging was also introduced, making it easier to debug applications, from the Java client to the CICS application.

The Web services support in CICS Transaction Server Version 3.1 enables CICS programs to be Web service providers or requesters. CICS supports a number of specifications including SOAP Version 1.1 and Version 1.2, and Web services distributed transactions (WS-Atomic Transaction).

The CICS Web Services Assistant includes two batch processing utilities, DFHWS2LS and DFHLS2WS, which are used to map WSDL to programming language structures and vice versa, respectively.

The input to DFHWS2LS is a set of control statements governing its processing and file containing WSDL for a web service to be accessed. The output is a set of language structures, each corresponding to a method in the WSDL, and a WSBIND file. This utility is intended for use by an application developer who wishes to access a web service as a client and has been provided its WSDL.

In this case, the application developer populates the language structure corresponding to the method they wish to invoke, writes the structure to the DFHWS-BODY CICS container, and executes the INVOKE WEBSERVICE API. Execution of the API is synchronous, on return the DFHWS-BODY contains the response from the invoked web service mapped to a language structure.

The input to DFHLS2WS is a set of control statements governing its processing and file containing the language structure corresponding to the invocation parameters of a CICS application program. The output is the WSDL corresponding to the language structure, and a WSBIND file. This utility is intended for use by an application developer who wishes to expose a program's functionality as a web service.

In this case, the application program is invoked when an HTTP request for its services is received by the CICS region. The application program sees the request as language structure in either a CICS container or a commarea, which one is governed by the control statements fed into DFHLS2WS. The application program performs its processing and writes the response back to the language structure with which it was invoked.

In either case, whether the CICS application is acting as a web services client or server, the mapping of data to and from XML is governed by the generated WSBIND file. The message body is wrapped in, and unwrapped from, a SOAP envelope by CICS Web Services "plumbing" code external to the application program.

The connections between a web service, the WSBIND file, the WSDL, and the CICS transaction requesting or providing the service is done with CICS system level definitions and a configuration file.

Also introduced with CICS TS 3.1 was the capability for CICS applications to act as HTTP clients. This allowed CICS transactions to participate as clients in a POX or REST conversation.

CICS TS can be extended with additional programming features using SupportPacs. For example SupportPac CA8K introduces support for RSS and Atom, and SupportPac CA1S adds support for the PHP scripting language, using the same Java-based PHP engine as Project Zero.