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
 

 

Without OCCURS CLAUSE can we select row

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
rambabu110
Warnings : 1

New User


Joined: 06 Feb 2006
Posts: 10
Location: Bangalore

PostPosted: Mon May 05, 2008 8:43 am    Post subject: Without OCCURS CLAUSE can we select row
Reply with quote

Hi,

1)On What base(means what situations)we go for Redefines clause? other than memory usage. icon_question.gif

2)without OCCURS CLAUSE can we select row by using Select Query many number of rows?On What base(means what situations)we go for Occurs clause?
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: Mon May 05, 2008 8:53 am    Post subject:
Reply with quote

Hello,

1. redefines can be used for decomposition (i.e. to break down a date from x(8) to cc,yy,mm,dd) or when the same area has multiple definitions (i.e. a file with multiple record formats).

2. occurs has nothing to do with db2/cursors/select. etc. SQL prohibits "repeating groups" which is what occurs is used for.
Back to top
View user's profile Send private message
rambabu110
Warnings : 1

New User


Joined: 06 Feb 2006
Posts: 10
Location: Bangalore

PostPosted: Tue May 06, 2008 7:40 am    Post subject:
Reply with quote

2)without CURSORS can we select row by using Select Query many number of rows?On What base(means what situations)we go for Occurs clause?
Back to top
View user's profile Send private message
rambabu110
Warnings : 1

New User


Joined: 06 Feb 2006
Posts: 10
Location: Bangalore

PostPosted: Tue May 06, 2008 7:41 am    Post subject:
Reply with quote

rambabu110 wrote:
2)without CURSORS can we select row by using Select Query many number of rows?On What base(means what situations)we go for
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: Tue May 06, 2008 7:47 am    Post subject:
Reply with quote

Hello,

If an embedded select (in a program) returns more than one row, it will raise an error.

If the result of your query (in a program) is more than one rows, you would use a cursor.

When using a cursor, you declare the cursor, open the cursor, and fetch rows until all have been processed.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Sat May 10, 2008 4:03 am    Post subject: Reply to: Without OCCURS CLAUSE can we select row
Reply with quote

ram,

you are confusing both OCCURS and CURSORS. read the manuals andpost if it is still not clear.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm
No new posts Select first 2 group data vice_versa DFSORT/ICETOOL 10 Mon Jun 13, 2016 2:21 pm
No new posts Query to select Null row on priority RahulG31 DB2 24 Thu Jan 21, 2016 5:45 pm
No new posts Can I use sort to select sample recor... Steve Ironmonger DFSORT/ICETOOL 3 Tue Nov 10, 2015 10:02 pm


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