View previous topic :: View next topic |
Author |
Message |
rajiv_garg08 Beginner
Joined: 24 Mar 2006 Posts: 6 Topics: 2
|
Posted: Mon Apr 03, 2006 8:24 am Post subject: Initialize an output record in Eazytrieve |
|
|
Hey Guys,
Is there anyway to initialize an output record in Eazytrieve?
There are say a 100 fields in the output file....of which, only 5 are being populated....the rest should be initialized(depending on whether a field is alphanumeric/numeric) |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Apr 03, 2006 8:43 am Post subject: |
|
|
rajiv_garg08,
Why not simply use a Move statement to initialize the fields?
Code: |
MOVE ZERO TO Field-1 field-4 field5 field-7
MOVE SPACE TO field-2 field-3 field-6
|
Another option is to define a working storage variable with init fields and move it to the output file fields.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
rajiv_garg08 Beginner
Joined: 24 Mar 2006 Posts: 6 Topics: 2
|
Posted: Tue Apr 04, 2006 6:26 am Post subject: |
|
|
Hi
Thanks for the quick reply. But i want to initialize all the varibles without using move statement as this is very time consuming. I am looking for something like INITIALIZE verb in COBOL.
Can you please provide how to use RESET option in Easytrieve. Thanks |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Tue Apr 04, 2006 7:56 am Post subject: |
|
|
rajiv_garg08,
You just code a proc for initializing the output fields and call it every time. Even with initialize verb you need to code each and every field of the output as there is no level number concept in easytrieve. In cobol you initialize the 01 level and all the fields defined below it are initialized based on the field definition. However that is not true with easytrieve. you do not have the 01 level type definition. so you are forced to use the individual fields.
Quote: |
Can you please provide how to use RESET option in Easytrieve
|
The RESET option is used only for W working storage fields. When coded on the field definition for a W field, RESET returns the field to its initial value whenever JOB or SORT is executed. RESET can be used with the OCCURS option for array fields but cannot be used for redefined fields (fields having overlay redefinition). When RESET is specified on a field in conjunction with the OCCURS option, the length of the resulting array cannot be greater than 65,520 bytes. Multiple fields specified with RESET options are reset in the order of the field definitions. The only exception to RESET is when W working fields are referenced in report processing. RESET is not performed during the printing of spooled reports.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|