Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Issue with rewrite a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
Gopalakrishnan V

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Tue Jul 31, 2012 4:51 pm    Post subject: Issue with rewrite a file
Reply with quote

I got an issue in rewrite a file.
File length = 100
actual key length = 10
partial key length (WS-FILE-KEY) = 3

step1 :

read a file with a partial key in update mode to
rewrite
Code:

EXEC CICS READ                         
     UPDATE                           
     FILE   ('file name')               
     INTO   (cop-book area)         
     RIDFLD (WS-FILE-KEY)             
     LENGTH  (WS-FILE-LENGTH)         
     KEYLENGTH (LENGTH OF WS-FILE-KEY)
     GENERIC                           
     RESP   (WS-RESPCODE)             
END-EXEC.   


after read update i just update the fields from wrokin storage variables.


step2:
tryig to rewrite the file
Code:

EXEC CICS REWRITE             
     FILE   ('file name')     
     FROM   (copy book area)
     LENGTH (WS-FILE-LENGTH) 
     RESP   (WS-RESPCODE)     
END-EXEC.                     



but i am getting EIBRESP 21 eibresp2 110

but i have coded length correctly
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Jul 31, 2012 5:23 pm    Post subject:
Reply with quote

i can understand why you are confused.

this is a CICS issue, not a COBOL issue.

start from this post
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8195
Location: East Dubuque, Illinois, USA

PostPosted: Tue Jul 31, 2012 5:55 pm    Post subject:
Reply with quote

Moved to CICS.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Tue Jul 31, 2012 6:00 pm    Post subject: Reply to: Issue with rewrite a file
Reply with quote

Sorry for "jumping the gun" with the delete, Robert :-)
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8195
Location: East Dubuque, Illinois, USA

PostPosted: Tue Jul 31, 2012 6:01 pm    Post subject:
Reply with quote

WHY do you think this is a length issue? I see nothing to indicate a length problem -- your response code is ILLOGIC, meaning you're trying to do a REWRITE when it isn't possible to do one.

What are the EIBRESP and EIBRESP2 fields from the READ for UPDATE command you did? Since you cannot change the key value between the read for update and the rewrite, and you used a GENERIC key instead of a full key, just how are you planning on providing the generic key portion to do the REWRITE (hint: CICS doesn't support generic keys for REWRITE)?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8195
Location: East Dubuque, Illinois, USA

PostPosted: Tue Jul 31, 2012 6:02 pm    Post subject:
Reply with quote

No problem, Bill -- we got this one moved to the right place.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Jul 31, 2012 6:56 pm    Post subject:
Reply with quote

Bill,
thx for the 'DELETE',
saved me from another of my flames!

IMUO:

In CICS do not use HANDLEs. Access and process the return codes (resp and resp2).
problem with HANDLE is that each HANDLE is for a specific code,
and if your API CALL returns an UN-HANDLEd condition, off you go executing illogical statements.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Tue Jul 31, 2012 7:45 pm    Post subject: Reply to: Issue with rewrite a file
Reply with quote

You're specifying the full-keylength so why do you need GENERIC?

Get rid of GENERIC and try it again....
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 File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us