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
 

 

VSAM - Length Errror in CICS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: VSAM - Length Errror in CICS
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

Moderator


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

PostPosted: Wed Aug 08, 2012 5:31 pm    Post subject:
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    Post subject:
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    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Wed Aug 08, 2012 6:10 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Reply to: VSAM - Length Errror in CICS
Reply with quote

It seems that you haven't learned anything, since the last post of the same problem: http://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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7233

PostPosted: Wed Aug 08, 2012 7:07 pm    Post subject: Reply to: VSAM - Length Errror in CICS
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    Post subject:
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

Moderator


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

PostPosted: Wed Aug 08, 2012 8:08 pm    Post subject:
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    Post subject:
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    Post subject:
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    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 START AND CANCEL blayek CICS 1 Wed Dec 07, 2016 3:27 am
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 SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am


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