Fetching RDW of a VB file in Easytrieve

Ask/Clarify the questions on EASYTRIEVE

Moderators: DikDude, Moderator Group

Post Reply
jegatheesh
Member
Posts: 3
Joined: Sat Apr 20, 2013 1:05 pm

Fetching RDW of a VB file in Easytrieve

Post by jegatheesh » Sat Apr 20, 2013 1:10 pm

How can we read/fetch a RDW of a VB file used in Easytrieve. I just want to fetch the rdw of input vb file and pass to the output vb file.
Jacky

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Sat Apr 20, 2013 1:48 pm

Why? If you change the length of the data then the old rdw will be wrong. Easytrieve should handle the rdw internally. It should be of no concern to you.
Regards
Nic

jegatheesh
Member
Posts: 3
Joined: Sat Apr 20, 2013 1:05 pm

Post by jegatheesh » Sat Apr 20, 2013 4:05 pm

Hi Nic,

In cobol, we declare the vb file like below,

RECORD IS VARYING FROM 1 TO 400
DEPENDING ON INPUT-COUNT.

Here, the rdw value stores in the variable INPUT-COUNT. We can pass the rdw of the input file to the rdw of output file (OUTPUT-COUNT) while writing to the output.So that the rdw of both the files remains same. Like how, i want to pass the rdw of the input file to the output file while writing.
Jacky

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Sat Apr 20, 2013 7:35 pm

No, that is not the RDW. When you read your record in Cobol, if you ask it to, as you have shown coded, you get the length of the data.

The RDW is separate from the data. The first two bytes of the RDW shows the record-length of the current record which includes the length of the RDW.

In Easytrieve Plus you cannot access the RDW. However, there is a special variable, RECORD-LENGTH, which exists. It can be "qualified" by FILE-NAME to distinguish one RECORD-LENGTH or another.

What do you want to do with the RECORD-LENGTH?

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Sun Apr 21, 2013 12:21 am

The same thing(s) the COBOL code does . . . 8)

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Sun Apr 21, 2013 1:46 am

Maybe :-)

However, there's no need.

Code: Select all

MOVE filename TO ....
takes account of the RECORD-LENGTH of filename automatically.

There are other things which can be done using the RECORD-LENGTH, just wondered whether something unnecessary was being considered. Or something I've not thought of :-)

jegatheesh
Member
Posts: 3
Joined: Sat Apr 20, 2013 1:05 pm

Post by jegatheesh » Sun Apr 21, 2013 10:25 pm

Thanks Will. I tried using the RECORD-LENGTH variable and its working. Thanks again.
Jacky

macnano
Member
Posts: 2
Joined: Thu Sep 06, 2012 12:08 am

Length of variable field

Post by macnano » Mon Oct 06, 2014 11:05 pm

Is there a way to determine the length of a variable field in easytrieve which is similar to RECORD:LENGTH that tells us the length of the record?
Sprout

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Tue Oct 07, 2014 3:58 am

What do you mean by a variable-length field? If you mean an A 20 with "AB" abd "ABCEDF", then no, you'll have to count the trailing blanks yourself.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others