MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Initialize an output record in Eazytrieve

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
rajiv_garg08
Beginner


Joined: 24 Mar 2006
Posts: 6
Topics: 2

PostPosted: Mon Apr 03, 2006 8:24 am    Post subject: Initialize an output record in Eazytrieve Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Apr 03, 2006 8:43 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
rajiv_garg08
Beginner


Joined: 24 Mar 2006
Posts: 6
Topics: 2

PostPosted: Tue Apr 04, 2006 6:26 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Apr 04, 2006 7:56 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group