This article has been dead for over three months
You
Hi, Im in bit of a jam here and I can't seem to figure this out.
Ive been looking for a little over a few hours for an answer to this but I can't seem to find a straight answer.
Well Im in my advanced portion of my class and we have this assignment that requires we load a pre-compiled table then use the table to calculate how much a call costs.
Well my book it covers the subject of how to do it but it doesn't explain how it works
FGTCLSP IT F 10 DISK
DTABCHARGE S 10 DIM(X)
D FROMFILE(GTCLSP)
That's how I have it written out in my program, I assume thats correct. X is not yet defined as this is what I am coming here for.
Im not sure as to how the file is loaded into the table
is it as I'm assuming:
Tabcharge1 = Field 1, tabcharge2 = field 2, etc, etc
which would mean its splinters the file which would mean I would have to reserve how many records there are by fields or does it store it by record?
then after solving that problem I have another question, if it stores as the first way I assumed (by field) how would i go about searching by increment, like how you would through a file(which is the way I would prefer to do this but the assignment requires it through a table) like I would know the field I want is the 4th and then after that it would be every 6(total amt of fields).
I know %Lookup is what Im supposed to use to find an exact match but this program is supposed to work with input that would change over time, making a search seem useless unless Im missing something. Thanks ahead of time.
Time is of the essence, THANKS!
Hi, Im in bit of a jam here and I can't seem to figure this out. Ive been looking for a little over a few hours for an answer to this but I can't seem to find a straight answer.
Well Im in my advanced portion of my class and we have this assignment that requires we load a pre-compiled table then use the table to calculate how much a call costs.
Well my book it covers the subject of how to do it but it doesn't explain how it works
FGTCLSP IT F 10 DISK DTABCHARGE S 10 DIM(X) D FROMFILE(GTCLSP)That's how I have it written out in my program, I assume thats correct. X is not yet defined as this is what I am coming here for.
Im not sure as to how the file is loaded into the table is it as I'm assuming: Tabcharge1 = Field 1, tabcharge2 = field 2, etc, etc
which would mean its splinters the file which would mean I would have to reserve how many records there are by fields or does it store it by record?
then after solving that problem I have another question, if it stores as the first way I assumed (by field) how would i go about searching by increment, like how you would through a file(which is the way I would prefer to do this but the assignment requires it through a table) like I would know the field I want is the 4th and then after that it would be every 6(total amt of fields).
I know %Lookup is what Im supposed to use to find an exact match but this program is supposed to work with input that would change over time, making a search seem useless unless Im missing something. Thanks ahead of time.
Time is of the essence, THANKS!
ok, scratch the whole how does it read it into a table. After reading through some notes I came to the realization how it works.
FGTCLSP IT F 24 DISK
DTABCHARGE S 24 DIM(X)
D FROMFILE(GTCLSP)
the first 24 indicates how many characters it reads at a time
the second indicates how large the table will store into each DIM.
since I was wrong about how the file is read/stored, it brings a new question to the table.
When assigning values to the table you can use different methods, such as CTDATA, and using ALT. well in my book it only shows 2 tables being used in conjunction with ALT, can I use more than just 2? and how is this achieved
would I use code such as
DTABFIRST S 10 DIM(20)
D FROMFILE(GTCLSP) PERRCD(1)
DTABSECOND S 10 DIM(20)
D ALT(TABFIRST) PERRCD(1)
DTABTHIRD S 10 DIM(20)
D ALT(TABSECOND)
Or would TABTHIRD have to reference TABFIRST?
thanks.