View previous topic :: View next topic
|
Author |
Message |
vimalonline Warnings : 1 New User
Joined: 08 Apr 2006 Posts: 14 Location: In front of my PC
|
|
|
|
Hi,
Am trying to read the last record in ESDS file. We should move the high values to RIDFIELD to get the last record..right?
In the below code, pls temme wat should i move to ESDS-RBA to get the last record.
Thanks for ur help
Code: |
WORKING-STORAGE SECTION.
77 ESDS-RBA PIC S9(8) COMP.
77 FINAL-REC PIC X(80).
77 WK-LEN PIC X(280).
PROCEDURE DIVISION.
MOVE ???? TO ESDS-RBA. ========== ?
MOVE 280 TO WK-LEN.
EXEC CICS READ
DATASET('FILE')
INTO(FINAL-REC)
RIDFLD(ESDS-RBA)
LENGTH(WK-LEN)
RBA
END-EXEC.
EXEC CICS
SEND TEXT FROM (FINAL-REC)
LENGTH(280)
ERASE
FREEKB
END-EXEC.
EXEC CICS RETURN
END-EXEC. |
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
From the STARTBR command in CICS Application Programming Reference:
Quote: |
RIDFLD(data-area)
specifies the record identification field. The contents can be a key, a relative byte address, or relative record number (for VSAM data sets), or a block reference, physical key, and deblocking argument (for BDAM data sets). For a relative byte address or a relative record number, the format of this field must be fullword binary. For a relative byte address, the RIDFLD can be greater than or equal to zero. For a relative record number, the RIDFLD can be greater than or equal to 1.
For VSAM, a full record id of X'FF's indicates that the browse is to be positioned at the end of the data set in preparation for a backwards browse using READPREV commands. |
So do a STARTBR with RIDFLD of HIGH-VALUES then a READPREV. I don't think you can do it with just a READ. |
|
Back to top |
|
|
vimalonline Warnings : 1 New User
Joined: 08 Apr 2006 Posts: 14 Location: In front of my PC
|
|
|
|
Robert Sample wrote: |
From the STARTBR command in CICS Application Programming Reference:
Quote: |
RIDFLD(data-area)
specifies the record identification field. The contents can be a key, a relative byte address, or relative record number (for VSAM data sets), or a block reference, physical key, and deblocking argument (for BDAM data sets). For a relative byte address or a relative record number, the format of this field must be fullword binary. For a relative byte address, the RIDFLD can be greater than or equal to zero. For a relative record number, the RIDFLD can be greater than or equal to 1.
For VSAM, a full record id of X'FF's indicates that the browse is to be positioned at the end of the data set in preparation for a backwards browse using READPREV commands. |
So do a STARTBR with RIDFLD of HIGH-VALUES then a READPREV. I don't think you can do it with just a READ. |
But We cant use HIGH-VALUES since RBA is declared as s9(8) comp.
Even i cant use X'FF' for this purpose. am getting compilation error. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Set the signed RBA fullword to negative 1 (X'FFFFFFFF') and all will be forgiven.
Bill |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
BILL IS CORRECT,
TRY
MOVE -1 TO RSDS-RBA
EXEC CICS STARTBR
EXEC CICS READPREV |
|
Back to top |
|
|
|