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
 
REWRITE of VB record problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
to_sreeni

New User


Joined: 08 Jul 2009
Posts: 17
Location: bangalore

PostPosted: Thu Aug 13, 2009 12:01 pm    Post subject: REWRITE of VB record problem
Reply with quote

Hi,

I have a problem with the rewrite of VB record in PL1.

The file properties are RECFM=VB, LRECL=800.

I have read a record into 796 structure. Then based on some condition, i have modifies two fields (in the read record with no change to the length) and then tried to rewrite the record.

It is giving an error message (Record Length is greater) in the rewrite statement.

Can you please advise on this problem?

Thanks,
Sreenivas
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Aug 13, 2009 12:06 pm    Post subject:
Reply with quote

What are the actual error messages and codes issued, and what does it say in the manual regarding these.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 998
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Aug 13, 2009 1:35 pm    Post subject:
Reply with quote

Also, do you READ INTO or READ SET(pointer)?

Garry.
Back to top
View user's profile Send private message
to_sreeni

New User


Joined: 08 Jul 2009
Posts: 17
Location: bangalore

PostPosted: Mon Aug 17, 2009 2:36 pm    Post subject:
Reply with quote

Hi

We Read the record into a structure (796 char).

When we try to rewrite the record , it is giving a condition error 22.

Please help.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1060
Location: Oostende, Belgium

PostPosted: Mon Aug 17, 2009 3:15 pm    Post subject:
Reply with quote

This works, adapt to your needs:

Code:

test: proc options(main) reorder;
dcl sysprint file;
dcl infile   file record update env(vb recsize(800));
 
dcl 1 * union,
      2 inrec      char     (796) var,
      2 *,
        3 *        fixed bin (15),
        3 yourrec,
          4 f1     char       (4),
          4 f2     char       (3);
 
read file(infile) into(inrec);
f1 = 'XXXX';
rewrite file(infile) from(inrec);
 
read file(infile) into(inrec);
f2 = 'XXX';
rewrite file(infile) from(inrec);
end test;


Don't know what unions are? RTFM!
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 -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm

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