.G Command

The .G command gets the specified statement from its current position and moves it to the top of the stack. If desired, this statement can then be modified with the .M command or appended with the .A command (these commands are only used on stack statement 1).

Format

.Gn [(process)]

Parameter(s)

n

Number of the stack statement to get and move to the top of the stack.

process

Number of a process other than your own. This option allows you to get a statement from the stack of another process and copy it to your own stack. It does not move or delete the statement from the stack of the other process. You must have SYS2 privileges to use this option.

The rest of the statements (until n) will move down one position in the stack.

Recalling a Stack Statement

The following example lists the top 10 statements and moves statement 6 to the top of the stack:

>.L10

001 LIST CUSTOMERS LAST-NAME FIRST-NAME

002 LIST CUSTOMERS LAST-NAME

003 SORT CUSTOMERS BY LAST-NAME LAST-NAME

004 WHO

005 WHERE

006 LIST CUSTOMERS WITH LAST-NAME EQ "SMITH"

007 WHO

008 SP-ASSIGN HS

009 ED CLIENTS MNEWBERRY

010 SP-ASSIGN HS

 

>.G6

LIST CUSTOMERS WITH LAST-NAME EQ "SMITH"

 

>.L

001 LIST CUSTOMERS WITH LAST-NAME EQ "SMITH"

002 LIST CUSTOMERS LAST-NAME FIRST-NAME

003 LIST CUSTOMERS LAST-NAME

004 SORT CUSTOMERS BY LAST-NAME LAST-NAME005 WHO

006 WHERE

007 WHO

008 SP-ASSIGN HS

009 ED CLIENTS MNEWBERRY

010 SP-ASSIGN HS

 

>

The original statement 1 (LIST CUSTOMERS LAST-NAME FIRST-NAME) becomes statement 2.

See Also

TCL Stacker Command Reference