Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Finding which variable used for SQL Query

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: Finding which variable used for SQL Query
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Aug 06, 2010 11:34 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Mon Aug 09, 2010 7:33 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts SQL Query optimization. arunsoods DB2 12 Sun Sep 04, 2016 6:27 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us