Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Let me start out by saying the original statement is NOT either Standard MUMPS or InterSystems Cache, or GT.M code. Even broadly guessing what was originally meant, the final S on the line isn't something you would do in MUMPS. A single S could be a SET command, but you still don't have any arguments telling what variable could be assigned, or what value should be assigned to it.</p> <p>The rest of my reply is trying to figure out what it could have meant.</p> <p>Your question seems to be broken by some software. either that on stackoverflow or the cut-and-paste process to put it here:</p> <p>I saw:</p> <p>I $P(GIH,,24)= S $P(GIH,,24)="C" S</p> <p>What is the meaning of two S's in above MUMPS statement?</p> <p>It is hard to figure out what you meant, since it would require hypothesizing where quotes might be and which ones could have been deleted by the transmission of the question.</p> <p>First of all, let's do something we can guess is reasonable. $P is usually an abbreviation for the built-in (intrinsic) function $PIECE. an I standing alone is probably an IF command and an S standing alone is probably a SET command. This runs into a problem with your example, because the format of a line of MUMPS code is COMMAND COMMAND-ARGUMENT.</p> <p>Aside Note: I also just tried to put the text COMMAND-ARGUMENT in "angle brackets" ie: with a less-than character at the beginning of the word and a greater-than character at the end. The text COMMAND-ARGUMENT just disappeared. Which means that stackoverflow sees it as HTML markup. I notice there is a Code marker on the top of this edit window which may or may not help.</p> <p>If we do the expansions to the code above, we get:</p> <p>IF $PIECE(GIH,,24)= SET $PIECE(GIH,,24)="C" SET</p> <p>When we expand the final S but it looks like a SET command, but without any set-argument.</p> <p>Note, if this was in a Cache system, we might have an example of extra spaces allowed by Cache, which are not allowed in Standard MUMPS, ie the S may have been the right hand side of an equality operator in the IF command. This would only make sense if Cache also allowed the argument of the SET command to be in code without an actual SET command. i.e.: </p> <p>IF $PIECE(GIH,,24)=S $PIECE(GIH,,24)="C" SET</p> <p>We still would have to deal with the two commas in a row for the $PIECE intrinsic function. Currently using two commas in a row to indicate a missing argument is only allowed in Programmer-written code, not when using built-in functions. So this might be a place where we can guess what you meant, or originally pasted in. </p> <p>If we put in double-quotes we run into the problem that $PIECE command (which separates a string based on a delimiter) would have an quoted string of zero length given as its second argument. Which is just as erroneous as having an empty argument. </p> <p>So if we hypothesize a quoted string that has angle brackets, we would get something this for your original line:</p> <p><code>IF $PIECE(GIH,"&lt;something&gt;",24)="&lt;something&gt;" SET $PIECE(GIH,"&lt;something&gt;",24)="C" SET</code></p> <p>Note: I just saw the Code marker allows use of grave accents to keep from assuming a line is HTML - which is good since grave accent is not a character used in MUMPS coding.</p> <p>As has been mentioned on another reply, the SET-$PIECE-ARGUMENT form is used to change the data stored in a database at a particular delimited substring location.</p> <p>So this code might be fine for guessing, but it has gone far afield of what you may or may not have done. So I'm stopping now until we get feedback that this is even close to what you wanted. As I said at the first, this is still not quite valid code.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload