Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Writing xml file using -Write command

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Writing xml file using -Write command
 Login/Join
 
Member
posted
Hi,

I am working on webfocus server 7.6.11, i am new to webfocus .

probelm Description:
I am reading one xml file using FILEDEF copmmand and writing in to another xml.
I am able to write a file properly , but after that if use any copy command or Rename command i am getting error like " The process cannot access the file because it is being used by another process.".

Please see my code

-SET &ECHO =ALL;
-SET &LOGDIR = 'E:\';
-SET &FILE == 'WORKFILE.XML';
-SET &WORKDIR =&LOGDIR;
-SET &FILENAME=&FILE;
-SET &FDFILE=&WORKDIR | &FILE;
-SET &OUTRES =&WORKDIR | 'YYRESULT.XML;
-SET &OUTRES1 ='YYRESULTNEW.XML';
-*APP FI TMPFILE DISK &OUTRES
FILEDEF TMPFILE DISK &OUTRES(LRECL 200 RECFM F
FILEDEF GPRS DISK &FDFILE
TABLE FILE GPRS
PRINT
FIELD1
ON TABLE HOLD AS INPTXT FORMAT ALPHA
END
-RUN
-SET &ECHO =ON;
-READLOOP
-READ INPTXT NOCLOSE &FIELD1.A120.
-IF &IORETURN NE 0 GOTO ENDLOOP ;
-WRITE TMPFILE NOCLOSE &FIELD1
-GOTO READLOOP
-ENDLOOP
-RUN

-SET &WORKNAME='DOS REN ' | &OUTRES | ' ' | &OUTRES1 ;
&WORKNAME

Out put:

--------------------------------------------------------------------------------

No HTML Output!

--------------------------------------------------------------------------------

-SET &LOGDIR ='E:\';
-SET &FILE == 'WORKFILE.XML';
-SET &WORKDIR =E:\;
-SET &FILENAME=WORKFILE.XML;
-SET &FDFILE=E:\ | WORKFILE.XML;
-SET &OUTRES =E:\ | 'YYRESULT.XML';
-SET &OUTRES1 ='YYRESULTNEW.XML';
APP FI TMPFILE DISK E:\YYRESULT.XML
FILEDEF GPRS DISK E:\WORKFILE.XML
TABLE FILE GPRS
PRINT
FIELD1
ON TABLE HOLD AS INPTXT FORMAT ALPHA
END
-RUN
1
0 NUMBER OF RECORDS IN TABLE= 2657 LINES= 2657
0
-READLOOP
-READ INPTXT NOCLOSE &FIELD1.A120.
-IF 0 NE 0 GOTO ENDLOOP ;
-WRITE TMPFILE NOCLOSE
-GOTO READLOOP
-READLOOP
-READ INPTXT NOCLOSE &FIELD1.A120.
-IF 0 NE 0 GOTO ENDLOOP ;
-WRITE TMPFILE NOCLOSE < !DOCTYPE Log SYSTEM "CELLO_AVAILABILITY2_LOG.dtd">
-GOTO READLOOP
-READLOOP
-READ INPTXT NOCLOSE &FIELD1.A120.
-IF 0 NE 0 GOTO ENDLOOP ;
-WRITE TMPFILE NOCLOSE
-GOTO READLOOP
-READLOOP
-READ INPTXT NOCLOSE &FIELD1.A120.
-IF 0 NE 0 GOTO ENDLOOP ;
-WRITE TMPFILE NOCLOSE
-GOTO READLOOP
-READLOOP
-READ INPTXT NOCLOSE &FIELD1.A120.
-IF 0 NE 0 GOTO ENDLOOP ;
-WRITE TMPFILE NOCLOSE CELLO_AVAILABILITY2_LOG
-GOTO READLOOP
-READLOOP
-READ INPTXT NOCLOSE &FIELD1.A120.
-IF 0 NE 0 GOTO ENDLOOP ;
-WRITE TMPFILE NOCLOSE
-GOTO READLOOP
-READLOOP
-READ INPTXT NOCLOSE &FIELD1.A120.
-IF 0 NE 0 GOTO ENDLOOP ;
-WRITE TMPFILE NOCLOSE 2010 6 16
-GOTO READLOOP
-READLOOP
-READ INPTXT NOCLOSE &FIELD1.A120.
-IF 0 NE 0 GOTO ENDLOOP ;
-WRITE TMPFILE NOCLOSE 18 48 13
-GOTO READLOOP
-READLOOP
-READ INPTXT NOCLOSE &FIELD1.A120.
-IF 0 NE 0 GOTO ENDLOOP ;
-WRITE TMPFILE NOCLOSE

-GOTO READLOOP
-READLOOP
-READ INPTXT NOCLOSE &FIELD1.A120.
-IF 0 NE 0 GOTO ENDLOOP ;
-WRITE TMPFILE NOCLOSE
-GOTO READLOOP
-READLOOP
-READ INPTXT NOCLOSE &FIELD1.A120.
-IF 0 NE 0 GOTO ENDLOOP ;
-WRITE TMPFILE NOCLOSE

-GOTO READLOOP
-READLOOP
-READ INPTXT NOCLOSE &FIELD1.A120.
-IF 0 NE 0 GOTO ENDLOOP ;
-WRITE TMPFILE NOCLOSE

-GOTO READLOOP
-READLOOP
-READ INPTXT NOCLOSE &FIELD1.A120.
-IF 1 NE 0 GOTO ENDLOOP ;
-ENDLOOP
-RUN
-SET &WORKNAME='DOS REN ' | E:\YYRESULT.XML | ' ' | YYRESULTNEW.XML ;
DOS REN E:\YYRESULT.XML YYRESULTNEW.XML

The process cannot access the file because it is being used by another process.

Please give suggestion on this , it would be appreciate your help.

This message has been edited. Last edited by: Kerry,


7.6.11, Windows
Excel,html,pdf,xml
 
Posts: 6 | Registered: February 18, 2011Report This Post
<FreSte>
posted
Before you do the rename you have to close the file with:

-CLOSE TMPFILE

.. but I think you donot have to have the NOCLOSE in your example during reading and writing (there is no -RUN in the loop)

This message has been edited. Last edited by: <FreSte>,
 
Report This Post
Expert
posted Hide Post
FreSte is right, the -RUN will force a close on the file, so be cause you do not have a -RUN you can omit the NOCLOSE.

It is also good programming practice to issue a -CLOSE anyway after you have finished with WRITING the file.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Writing xml file using -Write command

Copyright © 1996-2020 Information Builders