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
 

 

UPDATE option on READNEXT command in CICS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
MARINA JOSEPH

New User


Joined: 11 Jun 2009
Posts: 61
Location: chennai

PostPosted: Fri Jun 19, 2009 5:27 pm    Post subject: UPDATE option on READNEXT command in CICS
Reply with quote

Hi all,

I am trying to access a KSDS file sequentially.
How do i use UPDATE option on READNEXT command in CICS?
Can somebody provide me the syntax.
It throws me token not found error.


Thanks,
Marina.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7936
Location: Bellevue, IA

PostPosted: Fri Jun 19, 2009 5:33 pm    Post subject:
Reply with quote

Perhaps if you provided the actual CICS statements you're using first ....
Back to top
View user's profile Send private message
MARINA JOSEPH

New User


Joined: 11 Jun 2009
Posts: 61
Location: chennai

PostPosted: Fri Jun 19, 2009 5:38 pm    Post subject: Reply to : UPDATE option on READNEXT command in CICS
Reply with quote

Below is the code snippet i have been using.
It throws me token not found error.


EXEC CICS READNEXT
DATASET('KSDS')
INTO(WS-FILE-VAR)
RIDFLD(WS-EMPNO)
UPDATE
RESP(WS-RESP-CODE)
END-EXEC.

/*UPDATING KSDS FILE*/
EXEC CICS REWRITE
DATASET('KSDS')
FROM(WS-FILE-VAR)
RESP(WS-RESP-CODE)
END-EXEC.


Thanks,
Marina.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Jun 19, 2009 6:00 pm    Post subject:
Reply with quote

this link which is the syntax and this link explains the TOKEN keyword and the definition of data-area and its use.

possibly that is your problem. if so, you will need to modify your REWRITE.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Jun 19, 2009 8:38 pm    Post subject: Reply to: UPDATE option on READNEXT command in CICS
Reply with quote

Don't do this! You may lock-out (deadly embrace) due to the file being in LSR. You need to save the current key, issue an ENDBR, issue a READ for UPDATE then a REWRITE, then take the saved-key, move the last byte to a the last byte of a redefined binary-fword (clears it to LOW-VALUES first), add 1, then move this updated last byte to the last byte of the saved-key. Now, issue a STARTBR (using the saved-key) and it should point you to the next record or you'll get a NOTFND, which means EOF. You can really mess up the CRP (current record pointer) if you don't follow similar steps.

Browses can be notoriously inefficient, but with the help of LSR, the non-efficiency level is reduced.

When a "Browsed" file is defined to LSR, the "QR" TCB can do other work while the browsing is occurring. However, when the file is NOT defined to LSR (known as NSR), the "QR" must wait until the Browsing has completed and if the browsing tales a while, you could back up tasks waiting to be dispatched and you DO NOT want to do this.
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Sat Jun 20, 2009 10:24 am    Post subject:
Reply with quote

Quote:
It throws me token not found error


please post the error you are receiving that says token not found, never heard of this condition in a CICS read.

In addition, in the Mainframe world, we normally use the
term "returns error", not "throws error"
Back to top
View user's profile Send private message
MARINA JOSEPH

New User


Joined: 11 Jun 2009
Posts: 61
Location: chennai

PostPosted: Thu Jun 25, 2009 5:09 pm    Post subject:
Reply with quote

Hi all,

I have a doubt regarding browsing in ESDS file.
In the examples I see they are moving LOW-VALUES to the RIDFLD before using STARTBR.

MOVE LOW-VALUES TO ESDS-KEY.
EXEC CICS STARTBR
DATASET(‘ESDS’)
RIDFLD(ESDS-KEY)
RBA


This means they are starting from the beginning of the file.

Is it allowed to position elsewhere say for eg:- at the 5th record or do we always have to start from the beginning of the file.

MOVE 5 TO ESDS-KEY
EXEC CICS STARTBR
DATASET(‘ESDS’)
RIDFLD(ESDS-KEY)
RBA


Thanks,
Marina.
Back to top
View user's profile Send private message
MARINA JOSEPH

New User


Joined: 11 Jun 2009
Posts: 61
Location: chennai

PostPosted: Thu Jun 25, 2009 5:09 pm    Post subject: BROWSING IN ESDS FILE
Reply with quote

Hi all,

I have a doubt regarding browsing in ESDS file.
In the examples I see they are moving LOW-VALUES to the RIDFLD before using STARTBR.

MOVE LOW-VALUES TO ESDS-KEY.
EXEC CICS STARTBR
DATASET(‘ESDS’)
RIDFLD(ESDS-KEY)
RBA


This means they are starting from the beginning of the file.

Is it allowed to position elsewhere say for eg:- at the 5th record or do we always have to start from the beginning of the file.

MOVE 5 TO ESDS-KEY
EXEC CICS STARTBR
DATASET(‘ESDS’)
RIDFLD(ESDS-KEY)
RBA


Thanks,
Marina.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7936
Location: Bellevue, IA

PostPosted: Thu Jun 25, 2009 5:27 pm    Post subject:
Reply with quote

What did the manual (link at the top of the page) tell you?
Back to top
View user's profile Send private message
MARINA JOSEPH

New User


Joined: 11 Jun 2009
Posts: 61
Location: chennai

PostPosted: Thu Jun 25, 2009 5:32 pm    Post subject:
Reply with quote

There no examples or code snippets in the manual.
Its just explanations.

In case someone has had previous experience they would ahve a better idea about this.


Thanks.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7936
Location: Bellevue, IA

PostPosted: Thu Jun 25, 2009 5:43 pm    Post subject:
Reply with quote

I thought the CICS Language Reference manual was pretty clear:
Quote:
STARTBR specifies the record in a file, or in a data table, on a local or a remote system, where you want the browse to start. No records are read until a READNEXT command (or, for VSAM and tables, a READPREV command) is executed.

A browse operation, where direct means browse of the base data set (using the primary key), may be:

* A direct browse of a key sequenced data set (KSDS or data-table) by record key.

* A direct browse of an entry sequenced data set (ESDS) by relative byte address (RBA).
You cannot give it record number for ESDS but you can give it RBA. If your ESDS is fixed length, finding the RBA becomes multiply record number desired by record length and adjust for offset. If the ESDS is variable length, then you may have to experiment some to see how it works.
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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CICS to Webservices safexc CICS 1 Sun Jan 22, 2017 5:49 pm
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts CICS transaction slow response time vasanthz All Other Mainframe Topics 3 Thu Jan 19, 2017 1:31 am
No new posts INDEPENDENT CICS TS 4.1 MRO REGION UP... Kyle Carroll CICS 0 Wed Dec 14, 2016 6:55 pm
No new posts CICS START AND CANCEL blayek CICS 1 Wed Dec 07, 2016 3:27 am


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