View previous topic :: View next topic
|
Author |
Message |
Thamilselvi
New User
Joined: 22 Jun 2012 Posts: 57 Location: Chennai
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Are you trying to read one file or multiple file?
Could you please eloborate your problem as I coudnt understand it? |
|
Back to top |
|
|
Thamilselvi
New User
Joined: 22 Jun 2012 Posts: 57 Location: Chennai
|
|
|
|
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 |
|
|
Thamilselvi
New User
Joined: 22 Jun 2012 Posts: 57 Location: Chennai
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
MOVE LENGTH OF WS-DMAPKSDS TO WS-VSAM-LEN |
ws-dmapskds contains an odo. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Peter cobolskolan
Active User
Joined: 06 Feb 2012 Posts: 104 Location: Sweden
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
i just got this PM
Quote: |
You have all been punked! haha
Thamilselvi |
|
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Thamilselvi
New User
Joined: 22 Jun 2012 Posts: 57 Location: Chennai
|
|
|
|
Hi ,
Thanks for all your support. My program is working fine. I gave maximium length of the record. |
|
Back to top |
|
|
|