DATA Step, Macro, Functions and more

reset retained variables when switching concatenated files

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

reset retained variables when switching concatenated files

Hello,

I have a process in mainframe that reads multiple files concatenated under the same ddname.

Is it possible to reset retained variables at the start of each file being read?

 

Thanks

 

Ubaldo


Accepted Solutions
Solution
‎01-27-2016 03:54 PM
Super User
Posts: 11,343

Re: reset retained variables when switching concatenated files

Posted in reply to shikoulitz

Yes. You'll likely need to modify your infile statement. The option EOV=variable

specifies a variable that SAS sets to 1 when the first record in a file in a series of concatenated files is read. The variable is set only after SAS encounters the next file. Like automatic variables, the EOV= variable is not written to the data set.

 

So you add EOV=NewFile (or similar to your INFILE statement);

 

If NewFile then do;

   <statements to reset for the new file>

end;

View solution in original post


All Replies
Solution
‎01-27-2016 03:54 PM
Super User
Posts: 11,343

Re: reset retained variables when switching concatenated files

Posted in reply to shikoulitz

Yes. You'll likely need to modify your infile statement. The option EOV=variable

specifies a variable that SAS sets to 1 when the first record in a file in a series of concatenated files is read. The variable is set only after SAS encounters the next file. Like automatic variables, the EOV= variable is not written to the data set.

 

So you add EOV=NewFile (or similar to your INFILE statement);

 

If NewFile then do;

   <statements to reset for the new file>

end;

Occasional Contributor
Posts: 12

Re: reset retained variables when switching concatenated files

thank you, ballardw,

I looked for it only into the z/OS companion manual....

 

Thanks you again

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 188 views
  • 1 like
  • 2 in conversation