Jump to content

Recommended Posts

Posted

I have the following code that reads from an table that has two columns in it Company name and FNAME (filename):

 

-SET &I=0;

-REPEAT Listing WHILE &I LT &LINES;

-READFILE CompanyList

- &CompanyName

- &FNAME

-INCLUDE companies.fex

-SET &I = &I +1;

-Listing

 

 

Each time through the loop it pulls a row of data and passes it off to companies.fex where FNAME is used to open a specific excel file and process the data creating a table using the value in CompanyName

My problem is when it gets to the next procedure instead of using the values in the variables, I get prompted to enter in.

TABLE FILE &FNAME

PRINT *

ON TABLE HOLD AS &CompanyName FORMAT XFOCUS

 

If I just check the values of the variables I see that the correct information has been passed throught.

- &CompanyName

- &FNAME

Just and update: Im not sure why but with the exception of the prompting issue the program runs as expected. I can enter any value into the prompt and the program just ignores that input and uses the original data in the variable.

Any suggestions

Posted

Thanks @david.beagan fixed the issue. I figured it was something simple that I was forgetting. I only get the following warnings and thats just fine.

(FOC2906) WARNING: &CompanyName WILL BE OVERWRITTEN BY -READFILE CompanyList

(FOC2906) WARNING: &FNAME WILL BE OVERWRITTEN BY -READFILE CompanyList

 

As for the indenting, I do remember something about the commands must begin in column 1. I actually indented the code to make it easier to cut/paste into here, but after reading the above post I noticed that my code was still indented and ran the program.

It had have no problems with executing the indented code, I have since removed the indentation just in case.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...