Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chain Problems

Status
Not open for further replies.

jsplice

Programmer
Jun 3, 2003
88
US
Hello everyone. To anyone who helped me in the past: thank you. And to anyone who can help with this problem, thank you in advance.

I'm having trouble determining what is wrong with a single chain command. Here is the error I'm receiving:

Factor 1 @@SO# is not valid for the specified operation.

Here is the definition and use of the field, along with the chain command:

Code:
D @@SO#           S              9A 

C     @@SO#         Chain     MSOFMT

In this case, MSOFMT is the record format name of the file. As you can see, @@SO# is not a keylist, it is simply a stand alone varible. Here is the DDS from the file showing the keyed fields:

Code:
A            MSOSO#         9A         TEXT('ORDER NUMBER') 

A          K MSOSO#

MSOSO# is the only keyed field in the file, so this is not an issue concerning the order of key fields. As you can see, MSOSO# and @@SO# are both 9A fields, so there is not problem there.

There's obviously something I'm missing, but does anyone know what it is?




 
I havn't worked much in RPG for a while but here are a few suggestions. Are you getting the error on a compile or on run time?

First thing to check is the format.
I don't know which version of RPG IV you are using or which editor you are using but if you are using PDM RPG Pre-Free Format you need to check Factor 1 ( i.e. the @@SO# ) is left justified on the fixed format factor 1 position.

I could be wrong, but I though you read a file format and wrote a record format. Is the MSOFMT the name of the file? This may need changing.

Next thing is to check, do you need an indicator on the far right in the left most position. I don't think it is mandatory in RPG IV but it is how I coded for chain failure for a decade.

Third is the compile library list.
Are you sure the compile is looking at the file with the key? Check with a WRKOBJ Filename.



Dazed and confused
(N+, MCAD .NET)
 
jsplice,
I think that something is perharps missing on the F spec of the file.
Could you pls paste it here ?
 
Mercury2 - I think you could be right. The file needs to be specified as keyed?.

Dazed and confused
(N+, MCAD .NET)
 
He shouldn't need an indicator, it looks like he's in RPGIV (by the presence of a D spec).

Maybe the K is missing from the "Record address type" column of the F-spec. If there's no K, it will assume you're using a relative record number to retrieve the record and since your field is character, it won't allow it.

So I think Mercury's probably right.
 
Are you sure you have specified the file correctly,, the one you are chaining to. To use older terms,,, you cannot chain to a file you have specified, as input primary,, you need to have it full procedural, as least. Also,, even though you are using RPG IV,, do you need to specify a KLIST,, to use an older term?
 
Well, that was a silly mistake. The K was in fact missing. That seems to have solved the problem. I was pretty burnt out when I was trying to solve this problem on Saturday, so it's one of those small things I overlooked. Thanks everyone for the help.


John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top