IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

If i give rollback what happen to the CURSOR state


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anil_koneti

New User


Joined: 21 Apr 2005
Posts: 5

PostPosted: Sat May 14, 2005 11:06 am
Reply with quote

hi friends,
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
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Sat May 14, 2005 2:05 pm
Reply with quote

1. See this:

ibmmainframes.com/viewtopic.php?t=590&highlight=idcams+print
Back to top
View user's profile Send private message
subhasis_50

Moderator


Joined: 09 Mar 2005
Posts: 363
Location: Earth

PostPosted: Tue May 17, 2005 11:23 am
Reply with quote

Hi,
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) -
DUMP COUNT(1)
/*
//* 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.

Qn 3.
Find out how many programs are using that copy book. Compile all those programs with the change copybook. No need to change Run JCL .

Thanks
Subhasis
Back to top
View user's profile Send private message
shivakumar .b
Warnings : 1

New User


Joined: 11 May 2005
Posts: 18
Location: bangalore

PostPosted: Tue May 17, 2005 4:49 pm
Reply with quote

HI ANIL,
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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts How to give complex condition in JCL . CLIST & REXX 30
No new posts Can you give me examples of programs ... CLIST & REXX 22
No new posts Is SQLCODE -811 possible while fetchi... DB2 1
No new posts Restart logic by using cursor name in... DB2 1
No new posts Seeking Resolution for SQKCODE -991 o... DB2 2
Search our Forums:

Back to Top