please give me the answers for these questions
1.in my jcl i have 5 steps
in my first step contains one ps file
i want to know that the ps file contains records r not
how can we know u sing jcl pgm
(is it listcat )
2.in my cursor declaration i gave with hold option
cursor is still open if i give commit
if i give rollback then what happen
is cursor is closed r not
3.my copy book length lrec is 80 i change it as 90
then what are the changes we will do in jcl pgms
Use idcams utility to find that ur file contains record or not.
Use the following code:
//STEP01 EXEC PGM=IDCAMS,COND=(0,NE)
//SYSPRINT DD SYSOUT=*
//FILE1 DD DSN=TEST.DATA,DISP=SHR
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
PRINT INFILE(FILE1) -
//* DON'T RUN STEP02 IF FILE IS EMPTY
//* A RETURN CODE OF 4 WOULD INDICATE NO RECORDS WERE FOUND
//STEP02 EXEC PGM=WHATEVER,COND=(4,EQ,STEP01)
The IDCAM step will return 4, if there is no records else it will give 0. So you will know that any record is present there or not in the PS file.
Find out how many programs are using that copy book. Compile all those programs with the change copybook. No need to change Run JCL .
I CAN ANSWER FOR U R 2ND QUESTION.
IF WE DECLARE CURSOR WITH "WITH HOLD" OPTION, THEN EVEN IF WE ISSUE COMMITT STATEMENT, THE CURSOR WILLNOT GET CLOSED. BUT IF WE ISSUE ROLLBACK STATEMENT, THEN ALL THE CURSORS AND CURSORS WITH "WITH HOLD" OPTION WILL BE GET CLOSED.