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

FOCUS Database query


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lanand1985

New User


Joined: 05 Jun 2007
Posts: 3
Location: chennai

PostPosted: Fri Jan 16, 2015 2:15 pm
Reply with quote

Hi,
In database I have rows like below.

990000
999154
999155
....

Due to a bug, instead of 990000 getting incremented, the value changed to 999154 and is getting incremented.

My requirement is to fetch the value that is less than 999154 and increment by 1. that is 999001, 999002, etc..

REPOSITION gives the latest row inserted 999155. I am looking for REPOSITION with WHERE clause syntax and examples.

i.e. FOCUS equivalent of the below DB2 query

SELECT ID from table where ID < 999000
Back to top
View user's profile Send private message
lanand1985

New User


Joined: 05 Jun 2007
Posts: 3
Location: chennai

PostPosted: Fri Jan 16, 2015 4:18 pm
Reply with quote

Hi,
Please help about this FOCUS query. Not much materials/examples to refer.

Thanks.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1565
Location: Andromeda Galaxy

PostPosted: Fri Jan 16, 2015 9:02 pm
Reply with quote

Hi,

You might for one time fix the data by using query like

SELECT ID from table where ID >= 999000 AND ID < 999155

and then Modify your actual query

Also check this link for FOCUS documentation
Back to top
View user's profile Send private message
lanand1985

New User


Joined: 05 Jun 2007
Posts: 3
Location: chennai

PostPosted: Sun Jan 25, 2015 7:38 pm
Reply with quote

I am still struggling to fix this.

REPOSITION SHIP_MEMO_ID ;
NEXT SHIP_MEMO_ID
WHERE SHIP_MEMO_ID LT '499999'

The above query is throwing FOC401 error. Can anyone help me with FOCUS equivalent of the below query.

SELECT SHIP_MEMO_ID FROM TABLE
WHERE SHIP_MEMO_ID < 499999
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Jan 26, 2015 7:57 pm
Reply with quote

What does the Focus manual say about the error. It is a Focus error so the message is not in the IBM manuals and most people will not have access to the Focus manuals.
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Help in writting SQL query DB2 1
No new posts Need Help with on of the coalesce query DB2 4
No new posts Mainframe ISPREDIT Macro query TSO/ISPF 3
No new posts DFSORT Output file order query DFSORT/ICETOOL 2
No new posts Query on JCL DFSORT/ICETOOL 5
Search our Forums:

Back to Top