View previous topic :: View next topic
|
Author |
Message |
to_sreeni
New User
Joined: 08 Jul 2009 Posts: 17 Location: bangalore
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
What are the actual error messages and codes issued, and what does it say in the manual regarding these. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Also, do you READ INTO or READ SET(pointer)?
Garry. |
|
Back to top |
|
|
to_sreeni
New User
Joined: 08 Jul 2009 Posts: 17 Location: bangalore
|
|
|
|
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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
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 |
|
|
|