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
 

 

Lenerror in CICS VSAM
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Tue Jul 24, 2012 6:10 pm    Post subject: Lenerror in CICS VSAM
Reply with quote

Hi,
I have created the VSAM with variable record length as RECORDSIZE(16,80). File created successfully and copied the attached record in VSAM using REPRO.

In my program , i have tried to read the VSAM using below statement

Code:
EXEC CICS READ
        FILE('VSAM1')
        INTO (RECOR)
        RIDFLD(WS-MSG-KEY)
END-EXEC

Code:
WORKING STORAGE SECTION.
01  RECOR.
   05  WS-MSG-KEY         PIC X(10).
   05 WS-FLDCNT            PIC 9(02).
   05 WS-LAYOUT   OCCURS 1 TO 17 TIMES DEPENDING ON WS-FLDCNT.
     10 WS-FLDID     PIC X(02).
     10  WS-FLDLEN  PIC 9(02).

Code'd

While reading , i am getting lengtherror.
I need to complete this very soon. Please help me to solve this issue.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


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

PostPosted: Tue Jul 24, 2012 6:20 pm    Post subject:
Reply with quote

Did you look up what a length error means? From the CICS Application Programming Refernce manual:
Quote:
LENGERR
RESP2 values:

10
Neither the LENGTH option nor the SET option is specified on a READ command for a file with variable-length records or for a BDAM file with variable-length or undefined-format records.

11
The length of a record read with the INTO option specified exceeds the value specified in the LENGTH option; the record is truncated, and the data area supplied in the LENGTH option is set to the actual length of the record.

13
An incorrect length is specified for a file with fixed-length records.

Default action: terminate the task abnormally.
It sure likes the first condition applies -- you didn't specify LENGTH, you didn't specify SET and your program is attempting to read a variable-length VSAM file.

In other words, the system did exactly what the manual said it would do, and this is another PEBKAC problem.
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Wed Jul 25, 2012 10:05 am    Post subject:
Reply with quote

Hi ,

I have added the LENGTH parameter with data area which is length of INTO data area. Still i am facing , same error. The RESP is 22 and RESP2 as 11.


TRANSACTION: PAR1 PROGRAM: CBLFMTCV TASK: 0006330 APPLID: CICSM DISPLAY: 00
STATUS: COMMAND EXECUTION COMPLETE
EXEC CICS READ
FILE ('MQXMLF1 ')
INTO ('CUSTER_RSP11FS20OC03OF20OF10OF10OF20OF10OF03OF10FS10FS10')
LENGTH (80)
RIDFLD ('CUSTER_RSP')
EQUAL








OFFSET:X'000962' LINE:00104 EIBFN=X'0602'
RESPONSE: LENGERR EIBRESP=22

ENTER: CONTINUE




1000-DMAPKSDS-READ.
***********************************************************
EXEC CICS READ
FILE('MQXMLF1')
INTO(WS-DMAPKSDS)
LENGTH(WS-VSAM-LEN)
RIDFLD(WS-MSG-KEY)
END-EXEC
MOVE WS-DMAPKSDS TO WS-MESSAGE
PERFORM DISPLAY-MESSAGE
.



EXEC CICS HANDLE CONDITION
LENGERR(ERROR-HANDLE)
END-EXEC

MOVE WS-PARM-MSGID TO WS-MSG-KEY
MOVE LENGTH OF WS-DMAPKSDS TO WS-VSAM-LEN
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Jul 25, 2012 10:32 am    Post subject:
Reply with quote

please provide a listcat of the vsam file.

also, are you populating WS-VSAM-LEN before or after the read?
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Wed Jul 25, 2012 11:10 am    Post subject:
Reply with quote

Hi,

The Vsam len is populated before the READ statment and find the LISTCAT below

Code:

  LISTCAT ENTRIES(MQXML.POC.DMAPKSDS) ALL
0CLUSTER ------- MQXML.POC.DMAPKSDS
      IN-CAT --- CATALOG.MASTER.VZ17CAT
      HISTORY
        DATASET-OWNER-----(NULL)     CREATION--------2012.206
        RELEASE----------------2     EXPIRATION------0000.000
      SMSDATA
        STORAGECLASS -----PERMSC     MANAGEMENTCLASS---(NULL)
        DATACLASS --------(NULL)     LBACKUP ---0000.000.0000
        BWO STATUS------00000000     BWO TIMESTAMP---00000 00:00:00.0
        BWO---------------(NULL)
      RLSDATA
        LOG ----------------(NULL)   RECOVERY REQUIRED --(NO)     FRLOG ------------(NULL)
        VSAM QUIESCED -------(NO)    RLS IN USE ---------(NO)
0       LOGSTREAMID-----------------------------(NULL)
        RECOVERY TIMESTAMP LOCAL-----X'0000000000000000'
        RECOVERY TIMESTAMP GMT-------X'0000000000000000'
      PROTECTION-PSWD-----(NULL)     RACF----------------(NO)
      ASSOCIATIONS
        DATA-----MQXML.POC.DMAPKSDS.DAT
        INDEX----MQXML.POC.DMAPKSDS.IDX
0   DATA ------- MQXML.POC.DMAPKSDS.DAT
      IN-CAT --- CATALOG.MASTER.VZ17CAT
      HISTORY
        DATASET-OWNER-----(NULL)     CREATION--------2012.206
        RELEASE----------------2     EXPIRATION------0000.000
        ACCOUNT-INFO-----------------------------------(NULL)
      PROTECTION-PSWD-----(NULL)     RACF----------------(NO)
      ASSOCIATIONS
        CLUSTER--MQXML.POC.DMAPKSDS
      ATTRIBUTES
        KEYLEN----------------10     AVGLRECL--------------16     BUFSPACE-----------17408     CISIZE--------------8192
        RKP--------------------0     MAXLRECL--------------80     EXCPEXIT----------(NULL)     CI/CA-----------------90
        SHROPTNS(1,3)   RECOVERY     UNIQUE           NOERASE     INDEXED       NOWRITECHK     NOIMBED       NOREPLICAT
        UNORDERED          REUSE     NONSPANNED
      STATISTICS
        REC-TOTAL--------------2     SPLITS-CI--------------0     EXCPS------------------9
        REC-DELETED------------0     SPLITS-CA--------------0     EXTENTS----------------1
        REC-INSERTED-----------0     FREESPACE-%CI---------10     SYSTEM-TIMESTAMP:
        REC-UPDATED------------0     FREESPACE-%CA---------15          X'C9EB0B19368F88C4'
        REC-RETRIEVED---------16     FREESPC----------2203648
      ALLOCATION
        SPACE-TYPE------CYLINDER     HI-A-RBA---------2211840
        SPACE-PRI--------------3     HI-U-RBA----------737280
        SPACE-SEC--------------1
      VOLUME
        VOLSER------------CMTAS1     PHYREC-SIZE---------8192     HI-A-RBA---------2211840     EXTENT-NUMBER----------1
1IDCAMS  SYSTEM SERVICES                                           TIME: 10:46:55        07/25/12     PAGE      2
0       DEVTYPE------X'3010200F'     PHYRECS/TRK------------6     HI-U-RBA----------737280     EXTENT-TYPE--------X'00'
        VOLFLAG------------PRIME     TRACKS/CA-------------15
        EXTENTS:
        LOW-CCHH-----X'04760000'     LOW-RBA----------------0     TRACKS----------------45
        HIGH-CCHH----X'0478000E'     HIGH-RBA---------2211839
0   INDEX ------ MQXML.POC.DMAPKSDS.IDX
      IN-CAT --- CATALOG.MASTER.VZ17CAT
      HISTORY
        DATASET-OWNER-----(NULL)     CREATION--------2012.206
        RELEASE----------------2     EXPIRATION------0000.000
      PROTECTION-PSWD-----(NULL)     RACF----------------(NO)
      ASSOCIATIONS
        CLUSTER--MQXML.POC.DMAPKSDS
      ATTRIBUTES
        KEYLEN----------------10     AVGLRECL---------------0     BUFSPACE---------------0     CISIZE--------------1024
        RKP--------------------0     MAXLRECL------------1017     EXCPEXIT----------(NULL)     CI/CA-----------------33
        SHROPTNS(1,3)   RECOVERY     UNIQUE           NOERASE     NOWRITECHK       NOIMBED     NOREPLICAT     UNORDERED
        REUSE
      STATISTICS
        REC-TOTAL--------------1     SPLITS-CI--------------0     EXCPS------------------9     INDEX:
        REC-DELETED------------0     SPLITS-CA--------------0     EXTENTS----------------1     LEVELS-----------------1
        REC-INSERTED-----------0     FREESPACE-%CI----------0     SYSTEM-TIMESTAMP:            ENTRIES/SECT-----------9
        REC-UPDATED------------0     FREESPACE-%CA----------0          X'C9EB0B19368F88C4'     SEQ-SET-RBA------------0
        REC-RETRIEVED----------0     FREESPC------------32768                                  HI-LEVEL-RBA-----------0
      ALLOCATION
        SPACE-TYPE---------TRACK     HI-A-RBA-----------33792
        SPACE-PRI--------------1     HI-U-RBA------------1024
        SPACE-SEC--------------1
      VOLUME
        VOLSER------------CMTAS1     PHYREC-SIZE---------1024     HI-A-RBA-----------33792     EXTENT-NUMBER----------1
        DEVTYPE------X'3010200F'     PHYRECS/TRK-----------33     HI-U-RBA------------1024     EXTENT-TYPE--------X'00'
        VOLFLAG------------PRIME     TRACKS/CA--------------1
        EXTENTS:
        LOW-CCHH-----X'0010000A'     LOW-RBA----------------0     TRACKS-----------------1
        HIGH-CCHH----X'0010000A'     HIGH-RBA-----------33791
1IDCAMS  SYSTEM SERVICES                                           TIME: 10:46:55        07/25/12     PAGE      3
0         THE NUMBER OF ENTRIES PROCESSED WAS:
                    AIX -------------------0
                    ALIAS -----------------0
                    CLUSTER ---------------1
                    DATA ------------------1
                    GDG -------------------0
                    INDEX -----------------1
                    NONVSAM ---------------0
                    PAGESPACE -------------0
                    PATH ------------------0
                    SPACE -----------------0
                    USERCATALOG -----------0
                    TAPELIBRARY -----------0
                    TAPEVOLUME ------------0
                    TOTAL -----------------3
0         THE NUMBER OF PROTECTED ENTRIES SUPPRESSED WAS 0
0IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
0
0IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 0


Code'd
Back to top
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Wed Jul 25, 2012 11:55 am    Post subject: Reply to: Lenerror in CICS VSAM
Reply with quote

If you run EDF you will see the value of WS-VSAM-LEN after your Read.
This is the (minimum) value CICS wants you to have in the variable before the read.
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Wed Jul 25, 2012 1:02 pm    Post subject:
Reply with quote

While doing CEDF , WS-VSAM-LEN is 80 after read statment. I have shown above. I have tried wiht average value (what i gave in RECORDSIZE(16,80)) in LENGTH parameter. For this also , i am getting the same error.


Do i need to give 4 bytes for VB VSAM file. IF so, Where, how i have to add this 4 bytes.?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Jul 25, 2012 1:43 pm    Post subject:
Reply with quote

you need to populate the odo object with 17 before you populate ws-vsam-len
with length of function.
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Wed Jul 25, 2012 1:54 pm    Post subject:
Reply with quote

I am beginner in VSAM. Can you please tell me what is ODO object.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Jul 25, 2012 4:04 pm    Post subject: Reply to: Lenerror in CICS VSAM
Reply with quote

ODO is Cobol, not VSAM. We use it as an abbreviation for "Occurs Depending On".

It is being suggested that you set the value of the Occurs Depending On to 17 "before you populate ws-vsam-len with length of function."
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Wed Jul 25, 2012 4:19 pm    Post subject:
Reply with quote

That is not possible...i can set the value from VSAM record which is being read. please guide me - do i need to add 4 bytes for VB VSAM file.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Jul 25, 2012 4:29 pm    Post subject: Reply to: Lenerror in CICS VSAM
Reply with quote

What is not possible?

No, you do not need four bytes...
Back to top
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Wed Jul 25, 2012 4:51 pm    Post subject: Reply to: Lenerror in CICS VSAM
Reply with quote

The WS-FLDCNT has a value in the read record, which tells you how many occurances of the WS-LAYOUT there are in the record.
Cobol reserves the maximum length of the WS-LAYOUT, which is 17 occurances, as you know that will be the maximum. This is perfect.
Mentioned also in this post is the SET option.
Why dont you change the read to the following for test purposes:
Code:
EXEC CICS READ
        FILE('VSAM1')
        SET(Address of RECOR)
        RIDFLD(WS-MSG-KEY)
END-EXEC

Put the 01 RECOR in Linkage Section. You dont have to supply the LENGTH.
One other strange thing is that you keep the searched key in the RECOR-structure.
This normally is a separate data item outside of the record-structure , and must be when using the SET-option.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Jul 25, 2012 5:48 pm    Post subject:
Reply with quote

I could not fix your brakes so I made your horn louder

Thamilselvi,

has nothing to do with VSAM or CICS.

This is pure COBOL.
The LENGTH OF function for a structure which contains an ODO clause,
will return the length based on the size of the table.
The size of the table depends on the value of the ODO object
Code:
OCCURS DEPENDING ON WS-CNT

for further clarification WS-CNT is the ODO object in the above line of code.

why can you not MOVE 17 TO WS-FLDCNT
prior to the LENGTH OF statement
prior to the read??????????
Back to top
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Wed Jul 25, 2012 6:03 pm    Post subject: Reply to: Lenerror in CICS VSAM
Reply with quote

It would be nice if you show us how the WS-VSAM-LEN is declared and how it it given a value and what value EDF shows for this variable BEFORE execution.
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Thu Jul 26, 2012 9:31 am    Post subject:
Reply with quote

Hi,

Please find the screen shots here...


[/img]
Code:
TRANSACTION: PAR1 PROGRAM: CBLFMTCV TASK: 0006742 APPLID: CICSM    DISPLAY:  00
 STATUS:  ABOUT TO EXECUTE COMMAND                                             
 EXEC CICS READ                                                               
  FILE ('MQXMLF1 ')                                                           
  INTO ('CUSTER_RSP11FS20OC03OF20OF10OF10OF20OF10OF03OF10FS10FS10')           
  LENGTH (56)                                                                 
  RIDFLD ('CUSTER_RSP')                                                       
  EQUAL                                                                       
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
 OFFSET:X'000936'    LINE:00105          EIBFN=X'0602'                         
                                                                               
                                                                               
ENTER:  CONTINUE                                                               




Code:
TRANSACTION: PAR1 PROGRAM: CBLFMTCV TASK: 0006742 APPLID: CICSM    DISPLAY:  00
 STATUS:  COMMAND EXECUTION COMPLETE                                           
 EXEC CICS READ                                                               
  FILE ('MQXMLF1 ')                                                           
  INTO ('CUSTER_RSP11FS20OC03OF20OF10OF10OF20OF10OF03OF10FS10FS10')           
  LENGTH (80)                                                                 
  RIDFLD ('CUSTER_RSP')                                                       
  EQUAL                                                                       
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
 OFFSET:X'000936'    LINE:00105          EIBFN=X'0602'                         
 RESPONSE: LENGERR                       EIBRESP=22                           
                                                                               
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Thu Jul 26, 2012 10:36 am    Post subject:
Reply with quote

Hi,

this vsam accessing program is subprogram. when i try using set option , i am getting severe error on linkage section.

IGYPS0037-S "DFHCOMMAREA" was not a uniquely defined name. The definition to be used could not be determined from the context. The reference to the name was discarded.


I am gettting the VSAM key from calling program in dfhcommarea.
Back to top
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Thu Jul 26, 2012 11:59 am    Post subject: Reply to: Lenerror in CICS VSAM
Reply with quote

Strange that you cant see that the length before the read is:
Code:
LENGTH (56)

and the length of the record read is:
Code:
LENGTH (80)

Thats why you get the LENGERR.

The DFHCOMMAREA is just a simple cobol-error that you should be able to find out yourself. The errormessage tells you.
If you still have problems with this, show us the code, I mean the real code, otherwise answeres tend to be guesses.
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Thu Jul 26, 2012 12:30 pm    Post subject: Re: Reply to: Lenerror in CICS VSAM
Reply with quote

Peter cobolskolan wrote:
Strange that you cant see that the length before the read is:
Code:
LENGTH (56)

and the length of the record read is:
Code:
LENGTH (80)

Thats why you get the LENGERR.

The DFHCOMMAREA is just a simple cobol-error that you should be able to find out yourself. The errormessage tells you.
If you still have problems with this, show us the code, I mean the real code, otherwise answeres tend to be guesses.
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Thu Jul 26, 2012 12:32 pm    Post subject:
Reply with quote

Hi,

I have attached my program. Cn you please chk and help me to sought the length error issue..
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 -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 pm
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm


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