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
 

 

FOCUS Database query

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: FOCUS Database query
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    Post subject: Help please.. URGENT
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: 1529
Location: Andromeda Galaxy

PostPosted: Fri Jan 16, 2015 9:02 pm    Post subject:
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    Post subject: Reply to: FOCUS Database query
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: 1715
Location: UK

PostPosted: Mon Jan 26, 2015 7:57 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics 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 IMS Database backup info ashek15 IMS DB/DC 14 Wed Nov 16, 2016 5:29 am
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 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