It never gets to the second database! Hence trace never showed me whether
that was wrong or not but I did have a CHDIR so I would have spotted it if
it were wrong.

Nevertheless, I'd be grateful if you could try it with the loop - only one
iteration should do - and see if it fails for you.

Regards,
Alastair.


----- Original Message ----- 
From: "MikeB" <[EMAIL PROTECTED]>
To: "RBG7-L Mailing List" <[email protected]>
Sent: Tuesday, January 11, 2005 11:22 PM
Subject: [RBG7-L] - Re: Fw: [RBG7-L] - Unload/Input problem (Bug #71799)
W98SE


> I don't know what your directory structure (is / was), but if the two
databases
> were not in the same directory, the while would fail because it tries to
> connect to rrbyw4 while still in the concomp directory.  The following
does
> successfully work with the while loop:
> CLS
> SET NULL -0-
> Set var vDbFilePath = 'f:\rb7\samples\'
> DISCONNECT
>
> SET VAR vdblist      TEXT = NULL
> SET VAR vitemname    TEXT = NULL
> SET VAR vcycle1   INTEGER = NULL
>
> SET VAR vdblist = 'ConComp,RRBYW4'
> SET VAR vcount  = (itemcnt(.vdblist))
> SET VAR vcycle1 = 0
> WHILE vcycle1 < .vcount THEN
>
>   SET VAR vcycle1     = (.vcycle1 + 1)
>   SET VAR vitemname   = NULL
>   --  SET VAR vitemname   = 'ConComp'
>   SET VAR vitemname   = (SSUB(.vdblist, .vcycle1))
>   SET VAR voutputfile = (.vitemname + '.RLD')
>   SET VAR voutputlob  = (.vitemname + '.LOB')
>   SET VAR vcurrfiles  = (.vitemname + '.RB?')
>   SET VAR vrenfiles   = (.vitemname + '._B?')
> -- You have to get to the folder correctly
>   Set var vDbFolder = (.vDbFilePath + .vItemName)
>   CHDIR &vDbFolder
>
>   CONNECT .vitemname
>   set var vMsg = ('Begin Unload of ' + .vitemname)
>   PAUSE 4 USING .vmsg
>   OUTPUT .voutputfile
>   UNLOAD ALL
>   WRITE 'Return'
>   OUTPUT SCREEN
>   set var vMsg = ('End Unload of ' + .vitemname)
>   PAUSE 4 USING .vmsg
>   DISCONNECT
>   PAUSE 4 USING 'Renaming Files'
>   RENAME .vcurrfiles .vrenfiles
>   PAUSE 4 USING 'Inputting Reload File'
>  -- INPUT .voutputfile
>   RUN .voutputfile
>   DISCONNECT
>   PAUSE 4 USING 'Deleting Files'
>   DELETE .voutputfile
>   DELETE .voutputlob
>   DELETE .vrenfiles
>   CHDIR \rb7\autorent
> ENDWHILE
> CLS
> PAUSE 2 USING 'Done'
> RETURN
>

Reply via email to