Page 1 of 2
Need information about VGET
Posted:
Fri Jun 08, 2012 10:24 am
by surime72
hi guys,
VGET (ABC) PROFILE,
for example ihad screen in that abc fields has some values ex ABC
------
123
456
789
.
.
.
vvc
while i was using VGET (ABC) PROFILE,it displaying only 'vvc'
can any one explain what is vget & how we will get all the values of ABC
Re: vegt
Posted:
Fri Jun 08, 2012 11:01 am
by NicC
You really need to read up in the manual - probably the ISPF Dialogue Developer's Guide and Reference (SC34-4821-07 is the version I have) easily obtainable via Google. In summary: ISPF provides 3 areas of storge where you can store data(variables). You store variables in the pool using VPUT and retrieve them by VGET. The exact syntax iand pools are in the manual - use it, play with it, come back if, after exhaustive playing, you stil have problems. Remember - they are scalar variable names not arrays and each variable can only hold one value so if you repeatedly VPUT a variable wih different values the latest value over-writes the last value.
That posibly covers what you have done wrong. If it does not then post your relevant bits of code - using the code tags or the post will be deleted, at worst, or locked, at best.
Re: vegt
Posted:
Fri Jun 08, 2012 11:23 am
by surime72
i was new to this forum i dont no how to keep in black scerren,
was new to ispf dialog developing,
CALL ISPLINK ('VGET ','(PARTNO) ', 'SHARED');
it getiing only last row in the screen
Re: vegt
Posted:
Fri Jun 08, 2012 12:00 pm
by NicC
To get the code tags do not use the Quick Reply button but the 'Post Reply' button at bottom left. there are formatting buttons there including one for code. Highlight what you want to appear green-on-black and click on the code button. Use the Preview button to see what it will look like once posted. Below the preview will be your input box so that you can make changes before previewing again. Once happy, click the Submit button. You can also get to the full editor by clicking on Quick Reply and then the 'Full editor' button which is beside the submit button.
Now - you are VGETting the variable PARTNO. When you display it it will show only the LAST value VPUT to PARTNO as that will overwrite the vaalue that was in PARTNO before just like any other assignment to a variable whether it be in a pool or in your program. If you want to save lots of partnos then you have to save them - either to an ISPF table or a dataset just like you would any other data.
Re: vegt
Posted:
Fri Jun 08, 2012 12:27 pm
by surime72
P2200_VALIDATE_PARTNO: PROCEDURE;
CALL ISPLINK ('VGET ','(PARTNO) ', 'PROFILE');
EXEC SQL
SELECT I_PART INTO :WI_PART FROM EPPS.EOGPREC
WHERE I_PART = :PART_N;
IF (WI_PART ¬= PART_N)
THEN DO;
IF PFKEY = 'PF05' THEN
EXEC SQL
DECLARE CURPART CURSOR FOR
SELECT PART_NO FROM PRDT.TBPART04
WHERE PART_NO = :PART_N;
EXEC SQL
EXEC SQL
OPEN CURPART;
IF (SQLCODE ¬= 0) THEN
DO;
TABLE_ID = 'EOGPREC';
CALL P9000_SQL_ERROR;
RETURN;
END;
EXEC SQL
FETCH CURPART
INTO :VPARTNO;
IF SQLCODE = 0
THEN DO;
CALL ISPLINK('SETMSG ', 'INVNA700');
CALL ISPLINK('TBDISPL', 'INVNP700');
END;
END;
==> Scroll ===> CS
END;
/* EXEC SQL
SELECT I_PART INTO :WI_PART FROM EPPS.EOGPREC;
IF (WI_PART ¬= VPARTNO)
THEN DO; */
EXEC SQL
UPDATE EPPS.EOGPREC
SET I_PART = :PART_N
WHERE I_PART = :WI_PART;
IF SQLCODE = 0
THEN DO;
CALL ISPLINK ('TBDELETE','INVNT701');
CALL ISPLINK('SETMSG ', 'INVNA700');
CALL ISPLINK('TBDISPL', 'INVNP700');
END;
END;
END;
END;
END;
IF SQLCODE ¬= 0 & SQLCODE ¬= 100
THEN DO;
TABLE_ID = 'EOGPREC ';
CALL P9000_SQL_ERROR;
RETURN;
END;
IF SQLCODE = 100
THEN DO;
CALL ISPLINK ('VPUT ','(C)','PROFILE');
CALL ISPLINK
('DISPLAY', 'INVNP701');
IF C = 'Y' THEN DO;
PLANNAME = 'PRDT101';
CALL ISPLINK ('VPUT','(PARTNO)','PROFILE');
BUFF = 'CMD(%DB2EXEC PGMNAME('||PLANNAME||'))';
CALL ISPLINK ('CONTROL','DISPLAY','SAVE');
CALL ISPLINK('SELECT',L33,BUFF);
CALL ISPLINK ('CONTROL','DISPLAY','RESTORE');
END;
IF C = 'N' THEN DO;
CALL ISPLINK
('DISPLAY', 'INVNP700');
END;
END;
CALL ISPLINK
('DISPLAY', 'INVNP701');
CALL ISPLINK ('VPUT ','(CREATE)','PROFILE');
CALL ISPLINK
('DISPLAY', 'INVNP701');
CALL ISPLINK ('TBDISPL', 'INVNT701', 'INVNP701');
EXEC SQL
CLOSE CURPART;
RETURN;
END;
Re: vegt
Posted:
Fri Jun 08, 2012 12:29 pm
by surime72
thank u nicc,
here my requirement is if the user updated in screen need to check in master table and need to update child table,
was new to this ispf dialog,,,
Re: vegt
Posted:
Fri Jun 08, 2012 2:56 pm
by NicC
Well, I see you VGET and VPUT PARTNO but those are the only two references I can spot. You have VPARTNO PART_N PART_NO etc but these are never associated with PARTNO.
BTW - thanks for using the code tags.
Re: Need information about VGET
Posted:
Fri Jun 08, 2012 3:15 pm
by surime72
CALL ISPLINK ('VDEFINE','(PARTNO )',PART_N ,'CHAR ',LEN10);
and the ramaining varibles are defined in my program,
Re: Need information about VGET
Posted:
Fri Jun 08, 2012 3:24 pm
by surime72
and what is the way to select all rows from panel to program
Re: Need information about VGET
Posted:
Fri Jun 08, 2012 7:07 pm
by Pedro
The VGET only gets the current row of the table. You need to move to the top, then access each table row, one at a time. Use TBSKIP.
But I do not think you will need VGET, just TBSKIP to get the next row values.