IBM Mainframe Tutorials
192 FOLLOWERS
This blog is created to help people understand different concepts of IBM mainframes and it will be updated on a regular basis with the new topics and also adding more details to the existing ones.
IBM Mainframe Tutorials
3y ago
DATE:
The ISO format date in DB2 is CCYY-MM-DD in the range of 0001-01-01 to 9999-12-31.
COBOL host variable equivalent: PIC X(10)
DB2 supports ISO data format CCYY-MM-DD.
Example:
CREATE TABLE reading_lists(
user_id INT NOT NULL,
book_id INT NOT NULL,
added_on DATE DEFAULT CURRENT_DATE,
PRIMARY KEY(user_id, book_id)
);
INSERT INTO reading_lists(user_id, book_id) VALUES(1,1);
Converting COBOL field data to DB2 host variable format:
Example: 20200514
01 WS-DATE.
05 WS-YEAR   ..read more
IBM Mainframe Tutorials
3y ago
Goto 3.4 and type in the GDG name. Press Enter.
Then where u give B for Browse , E for Edit
type in LISTCAT ENT(/) ALL and press ENTER.
Or
The ISPF Dataset Utility (=3.2) can generate the LISTCAT command for you and then execute it.
Take option 3.2
Enter the name of the GDG base and take option V (VSAM Utilities).
Under "Process Request" take option 3. Under "Data Type" you can leave it blank or take option 4 and hit enter.
On the next screen make sure there is a (/) slash next to "Edit IDCAMS command". Under "Name, History, Volume, ALLOcation, All" put ALL and hit enter.
This will generate ..read more
IBM Mainframe Tutorials
3y ago
The maximum limit of a GDG file is 255 generations.
Say, you have created a GDG base with the limit of 50 generations and later you want to increase its limit to maximum (255 generations), then you need to Alter GDG base like below.
//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
ALTER GDG.BASE.NAME LIMIT(255)
/*
Once the above job is successful, the limit of GDG file GDG.BASE.NAME ..read more
IBM Mainframe Tutorials
3y ago
Consider I have a VB file of length 321 bytes (4 for RDW + 317 actual length) and wanted to remove duplicate records from a file.
Here is the sample JCL:
//REMODUPL EXEC PGM=SORT
//SORTIN DD DSN=INPFILE1,DISP=SHR
//SYSIN DD *   ..read more
IBM Mainframe Tutorials
3y ago
SDSF means System Display and Search Facility
It is a utility that allows user to monitor, control or view the output of jobs in the system.
It is a component of IBM's mainframe operating system, z/OS.
Once the job is submitted, it is common to use SDSF to check the status of the job like completed/running/failed...
To start using SDSF,
type SDSF;ST or S;ST on the start window/command line
ST :Displays current status of all the jobs
Following are the most commonly used SDSF options:
DA : Displays Active/currently running jobs
I : Input Queue - Shows jobs waiting for execution&nb ..read more
IBM Mainframe Tutorials
3y ago
IEBEDIT(Edit Job stream) Utility:
1. It is used to run selected job step(s) in particular JCL.
Ex. I have a JCL with 10 steps and wanted to run only STEP10,
//IEBEDITX JOB (MVSQuest),'IEBEDIT TEST',
// CLASS=N,MSGCLASS=H,NOTIFY=7SYSUID
//*
//SUBMIT EXEC PGM=IEBEDIT
//SYSUT1 DD DSN=USERID.TEST.JCL(JCLINP),DISP=SHR
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
EDIT START=JOBA,TYPE=INCLUDE,STEPNAME=(STEP10)
//*
JCLINP contains 10 steps
START => specifies job name ..read more
IBM Mainframe Tutorials
3y ago
Instream procedure should be defined before EXEC statement.
Example:
//INSTPROC PROC
// statements
// ----
// ----
// PEND
//STEP01 EXEC PGM=pgm1
//FILE1 DD DSN=file-name
//STEP02 DD INSTPROC
//STEP03 DD INSTPROC
Cataloged Procedure:
Cataloged procedures will be stored in separate PDS. This PDS name should be specified in JCLLIB ORDER. If the procedure is not found in the specified library, then SYS1.PROCLIB will be checked.
We can add/modify the parmeters in steps of Cataloged procedure without even chan ..read more
IBM Mainframe Tutorials
3y ago
VSAM - Virtual Storage Access Method
A VSAM cluster is a logical definition for a VSAM data set and has one or two components. viz.,
Index component - Contains pointers to all data records to access them
Data component - Contains actual records
VSAM commands:
All the following operations (including CREATE and DELETE) should be done through IDCAMS utility.
ALTER - To modify the attributes of VSAM file.
REPRO - To load the data into VSAM data set (from sequential file to VSAM file), to copy the data from one VSAM file to another VSAM file.
LISTCAT - To get the catalog information of a VSAM ..read more
IBM Mainframe Tutorials
3y ago
Whenever you get an error 'INPUT FIELD 'field-name' NOT ENTIRELY WITHIN INPUT RECORD' while LOADing the data to a DB2 table,
Please check whether the length of the field-name in DB2 table is equal to the length of the corresponding field-name in LOAD file. The length of both the fields SHOULD match.  ..read more
IBM Mainframe Tutorials
3y ago
ENVIRONMENT DIVISION is optional.
DATA DIVISION is optional.
In IDENTIFICATION DIVISION, except PROGRAM-ID. everything else is optional.
From Column 8-11, we call AREA-A where we should code DIVISIONS, SECTIONS, PARAGRAPHS and 01 group level items.
From column 12-72, we call AREA-B where we will code rest of the Cobol statements other than DIVISIONS, SECTIONS, PARAGRAPHS and 01 group level items.
If you specify SELECT OPTIONAL file ASSIGN TO filename, and if filename is not present physically then the program will NOT abend. Files with OPTIONAL can be ..read more