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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why my stem variable is not working

Status
Not open for further replies.

Arungs

Programmer
Jun 19, 2003
9
US
Hi friends,

this is my code..
PARMS.= ' '
DO I = 1 TO JOBS.0 /*working*/
PARSE VAR JOBS.I PARMS.I /*working*/
/*PARMS.I = JOBS.I*/ /*working*/
SAY PARMS.I /*working*/
END
DO I = 1 TO PARMS.0 /*NOT WORKING*/ :-(
SAY PARMS.I /*NOT WORKING*/
END

can anybody help me out of this ???
thanks,
Arun
 
Arungs,

You are intializing PARMS. and then you start filling it up from 1 to JOB.0 using the
Code:
DO I = 1 to JOB.0
statement.

This DO statement fills up PARMS.1, PARMS.2 etc till PARMS.n where 'n' is the value of JOB.0. Your PARM.0 never got a value.

This is the problem, you will have to give us more details as to what you are trying to accomplish for us to provide you a solution.

Prakal.
 
Sorry!!..If I'm not clear
actually I want to copy data from stem1 to stem2 based on some condition.
but i'm not able to access my stem2 using stem2.0 after I copying it..
also I'm not able to write into a dataset from a stem
I coded as ..
'EXECIO * DISKW TST ( STEM PARMS. FINIS';"FREE FI(TST)"

Thanks,
Arun
 
If you are doing this copy 'on condition' as you say, then your output stem might not have the same number of records as your input stem.

If your output stem is always the same as your input stem you could do PARMS.0 = JOBS.0.

You might be better doing something like;

Drop PARMS.
Cnt = 0
do i = 1 to JOBS.0
if JOBS.i =
<on condition> then do
Cnt = Cnt + 1
PARMS.cnt = JOBS.i
end
PARMS.0 = Cnt


After this you will have a properly formatted PARMS. stem.
 
If you are doing an unconditional copy, you could use;

Code:
do i = 0 to JOBS.0 
    PARMS.I = JOBS.I
end

Prakal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top