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

VSAM - Length Errror in CICS


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Wed Aug 08, 2012 4:53 pm
Reply with quote

Hi,

I am facing Lenerr while reading the Variable length VSAM file. My program read the vsam file by key which is from linkage section. My program is working fine if i run CEMT SET FILE(fname) stmt for each and every run. My program only reads the VSAM file.

For same key and without SET FILE stmt, the program is working fine.
For differect key and without SET FILE stmt, it throws lenerror
For differect key and with SET FILE stmt, the program is working fine.

Can anyone help me to run the program succefully without submitting the SET FILE command for each run?
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


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

PostPosted: Wed Aug 08, 2012 5:31 pm
Reply with quote

Are you trying to read one file or multiple file?

Could you please eloborate your problem as I coudnt understand it?
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Wed Aug 08, 2012 5:40 pm
Reply with quote

I am reading 1 VSAM file. My program read only once the vsam file.
Code:
  WORKING-STORAGE SECTION.                         
 *                                                 
  01 WS-DMAPKSDS.                                 
    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:
  LINKAGE SECTION.                                           
                                                             
   01 DFHCOMMAREA.                                           
     02 WS-PARM-MSGID             PIC X(10).                 
     02 FILLER                    PIC X(01).                 
     02 WS-PARM-DATA              PIC X(9939).               
 *                                                           



Code:
 MOVE WS-PARM-MSGID   TO WS-MSG-KEY         
                         WS-MSGID           
 MOVE LENGTH OF WS-DMAPKSDS TO WS-VSAM-LEN   
           


Code:
 **********************************************************
  1000-DMAPKSDS-READ.                                     
 **********************************************************
       EXEC CICS READ                                     
                 FILE('MQXMLF1')                           
                 INTO(WS-DMAPKSDS)                         
                 RIDFLD(WS-MSG-KEY)                       
                 LENGTH(WS-VSAM-LEN)                       
       END-EXEC                                           
       MOVE WS-DMAPKSDS TO WS-MESSAGE                     
       PERFORM DISPLAY-MESSAGE                             
       .                                                   
                                                           
 **********************************************************
  1000-EXIT.                                               
 **********************************************************
       EXIT                                               
       .                                                   
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Wed Aug 08, 2012 5:44 pm
Reply with quote

The problem is need to run SET FILE cmd for every run of my program. So that, my program runs fine without length error.

if my program receives same key for multiple run, then the program is running without SET FILE command.

If my program receives different key for multiple run, then the program is running with SET FILE command.

I want to run my program successfully for different keys without SET FILE command( for each run).
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Aug 08, 2012 6:10 pm
Reply with quote

What is your CEMT SET FILE doing -- open? close? enable? disable? something else?

This sounds like a region set up issue -- in which nobody at this forum will be able to help you; only someone working at your site could possibly help you with region set up issues.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Aug 08, 2012 6:32 pm
Reply with quote

Quote:
MOVE LENGTH OF WS-DMAPKSDS TO WS-VSAM-LEN


ws-dmapskds contains an odo.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Aug 08, 2012 6:46 pm
Reply with quote

and how do you know that there is a length error?
you have no RESP or RESP2 code in your API CALL.

this is the same as this thread
Back to top
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Wed Aug 08, 2012 6:53 pm
Reply with quote

It seems that you haven't learned anything, since the last post of the same problem: ibmmainframes.com/viewtopic.php?t=58940

Why dont you just code LENGTH(80) to avoid the problem, and keep on reading the manual on ODO!?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Aug 08, 2012 7:07 pm
Reply with quote

At best what you are doing is attempting to read with the length of the previous record or whatever else happens to be lying around. This will "work" sometimes, as long as the next record read is equal to or less than the length of the previous record.

Your maximum record length is 80. The length of your definition varies according to the value of the ODO variable.

So, you need to work out "some way" to give your command a value of 80 for the read. It's not that difficult.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Aug 08, 2012 8:07 pm
Reply with quote

i just got this PM

Quote:
You have all been punked! haha
Thamilselvi
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


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

PostPosted: Wed Aug 08, 2012 8:08 pm
Reply with quote

Thamilselvi wrote:
The problem is need to run SET FILE cmd for every run of my program. So that, my program runs fine without length error.

if my program receives same key for multiple run, then the program is running without SET FILE command.

If my program receives different key for multiple run, then the program is running with SET FILE command.

I want to run my program successfully for different keys without SET FILE command( for each run).


If I understood your problem correctly why not make use of STARTBR and READNEXT

So for STARTBR pass lowvalues for each call

For Readnext pass the keys

So that you dont need to use SET command everytime
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Aug 08, 2012 8:11 pm
Reply with quote

Pandora-Box,

problem is that there is little conceivable impact of a SET command
on a length error situation.

that, as well as most of his post(s) is pure BS.
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Thu Aug 09, 2012 1:01 pm
Reply with quote

Hi ,
Thanks for all your support. My program is working fine. I gave maximium length of the record. icon_biggrin.gif
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Using API Gateway from CICS program CICS 0
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top