clist error in rexx



IBM's Command List programming language & Restructured Extended Executor

clist error in rexx

Postby senthil » Sat Jun 13, 2009 4:20 pm

hi all,
i am working in rexx, and my task is to update a file and used the following syntax
"execio * diskru outrec(stem out. "

i have to replace a particular string in a record ,which i have it in a variable st
do i = 1 to out.0
 if pos('string',out.i) > 0 then
  st = out.i
 /*after changes in st*/
push st
'execio 1 diskw outrec"

i got an error saying that "A commamnd entered in clist is invalid".
though the file is updating as i intented,i could not execute the code again,while doing so i got the above error
if i try to execute again i got
"EXTRANEOUS INFORMATION IS IGNORED" which contains records of file to be updated.
so i tried to empty things from stack as
do until queued() = 0
parse pull stackitem
end

after the diskrw command,but still i am facing the same problem.
that particular file is to be updated lot of time whwnever i find strings to be replaced.
that is i have diskw command number of times(say more than 7) in my code.
Is emptying stack is the only solution?
somebody provide me with a solution...........
thanks..............
Thanks
Senthil Kumar
senthil
 
Posts: 12
Joined: Mon Jun 01, 2009 3:23 pm
Has thanked: 0 time
Been thanked: 0 time

Re: clist error in rexx

 

Re: clist error in rexx

Postby MrSpock » Sat Jun 13, 2009 4:33 pm

I'm confused by the mish-mash of code that you've posted. You have 2 choices:

1. You can read 1 record at a time using DISKRU (stem variable or data stack), make changes to that 1 record, and then write the updated 1 record using DISKW.

Or,

2. You can read the entire file using DISKR into a stem variable, loop through the stem variables and apply the changes, and then write he entire file back using DISKW.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: clist error in rexx

Postby senthil » Sun Jun 14, 2009 10:59 am

let me tell you the flow.
open a file
read the entire file and write into an output file
close all the files
open the output file in rewrite mode
now changes like(change all '> =' to ' =')(for ex)
this happens n number of times in the file
it is updating as intented but the above mentioned error occurs
now please tell me weather the method i tried to empty the stack was correct?
if not please tell me the solution?
thanks...........
Thanks
Senthil Kumar
senthil
 
Posts: 12
Joined: Mon Jun 01, 2009 3:23 pm
Has thanked: 0 time
Been thanked: 0 time

Re: clist error in rexx

Postby MrSpock » Mon Jun 15, 2009 4:43 pm

Could you either

- post the current version of your exec.

And/Or

- post a runtime TRACE of your exec.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: clist error in rexx

Postby senthil » Tue Jun 16, 2009 10:23 am

Mrspock,
Thank you.The problem is being solved.
The method i used to empty the stack was correct,but was placed wrongly.
Thanks again for spending your valuable time for this..........



thanks........
Thanks
Senthil Kumar
senthil
 
Posts: 12
Joined: Mon Jun 01, 2009 3:23 pm
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post