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
 

 

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: 6966
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: 7905
Location: Bellevue, IA

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: 7224

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: 7905
Location: Bellevue, IA

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: 7905
Location: Bellevue, IA

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: 6966
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: 2502
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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