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

Finding which variable used for SQL Query


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
SOMASEKHAR REDDY
Currently Banned

New User


Joined: 21 Nov 2007
Posts: 14
Location: BAGALORE

PostPosted: Fri Aug 06, 2010 5:56 pm
Reply with quote

01 WS-COUNT PIC 9(01).
02 WS-COUNT1 PIC 9(01).
.
.
.




PROCEDURE DIVISION
.
.
.
EXEC SQL
SELECT COUNT(*) INTO :WS-COUNT
FROM EMP TABLE
END-EXEC
.
.
ADD 1 TO WS-COUNT1


MY QUESTION IS WS-COUNT IS USING IN SQL QUERY BUT WS-COUNT1 IS NOT IS USING IN SQL QUERY

HOW I CAN IDENTIFY ONLY SEEING IN DECLARATION OF WORKING- STORAGE SECTION(WITH OUT SEEING IN PROCEDURE DIVISION) THIS WS-COUNT VARIABLE IS USING IN SQL QUERY WS-COUNT1 VARIABLE NOT USING IN SQL-QUERY IS IT POSSIBLE

please any give any one answer to me
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 06, 2010 6:50 pm
Reply with quote

only when the old-school host variable sql BEGIN DECLARE and END DECLARE statements are there, could the assumption be made.
Back to top
View user's profile Send private message
SOMASEKHAR REDDY
Currently Banned

New User


Joined: 21 Nov 2007
Posts: 14
Location: BAGALORE

PostPosted: Fri Aug 06, 2010 6:57 pm
Reply with quote

I HAVE ANSWERED LIKE THAT BUT he he not decalred between declare and end decalre

he will declare only like normal vraible declare.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Aug 06, 2010 7:01 pm
Reply with quote

Do a search of the source code and see where it is used!
Back to top
View user's profile Send private message
SOMASEKHAR REDDY
Currently Banned

New User


Joined: 21 Nov 2007
Posts: 14
Location: BAGALORE

PostPosted: Fri Aug 06, 2010 7:25 pm
Reply with quote

by seeing only workin-storage section
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Aug 06, 2010 8:02 pm
Reply with quote

Some questions are so stupid that they can not be answered, if you can't look at the procedure division you can't really tell how anything in working storage is used.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Aug 06, 2010 11:34 pm
Reply with quote

Hello,

FWIW - the code shown is invalid and would not compile. . .
Back to top
View user's profile Send private message
SOMASEKHAR REDDY
Currently Banned

New User


Joined: 21 Nov 2007
Posts: 14
Location: BAGALORE

PostPosted: Mon Aug 09, 2010 5:51 pm
Reply with quote

I didn't get could you please explai detail.....pleasee
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Aug 09, 2010 6:00 pm
Reply with quote

using the subject as a question
SOMASEKHAR REDDY wrote:
Post subject: I didn't get could you please explai detail.....pleasee


does not really make it easy to determine the purpose of your post.

FWIW, why don't you try compiling?

also, it it time to start reading the manual.

the count function returns a large integer
Back to top
View user's profile Send private message
SOMASEKHAR REDDY
Currently Banned

New User


Joined: 21 Nov 2007
Posts: 14
Location: BAGALORE

PostPosted: Mon Aug 09, 2010 7:00 pm
Reply with quote

that question is interview question of value source technology.this question is asked to one of my friend by interviewer.


i think that is stupid question only.. why pepoles asked that type of questions really i don't know
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Aug 09, 2010 7:33 pm
Reply with quote

SOMASEKHAR REDDY wrote:
i think that is stupid question only.. why pepoles asked that type of questions really i don't know
Well, sometimes I feel - just tell them what they want to listen. As someone told me some time back that among many duties of his regular job one duty was "to read the programmers mind" icon_eek.gif - probably if you want to do good in an interview, read the interviewer's mind. icon_biggrin.gif

Once I was asked, what is KEEP in DISP?

I started - if your shop is SMS managed ...

and He started looking at his cell phone...

I was distracted on that gesture but I continued the answer...if your shop is SMS managed ...it does not make difference if you use KEEP or CATLG...

He interrupted in between and asked me what is this "SMS" in your answer?

And I ended up my interview explaining him about SMS!


Well, I was selected later - so all was well, in the end icon_smile.gif
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 Finding and researching jobs All Other Mainframe Topics 0
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts VB to FB - Finding LRECL SYNCSORT 4
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top