Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [TECHNIQUE] Couple cool, large scale FEX management funzies
Go
New
Search
Notify
Tools
Reply
  
[TECHNIQUE] Couple cool, large scale FEX management funzies
 Login/Join
 
Master
posted
I'm on a large project where (among other things) I have had to make 2 specific changes to build my program test bed.

main_loop.bat:
@ECHO OFF

REM *****************************************************************************
REM * WARNING: THIS SCRIPT WILL UNMERCIFULLY UPDATE WHATEVER FILES ARE LISTED IN
REM *          FILE_LIST.TXT.  BE VERY CAREFUL.
REM *****************************************************************************
REM * Read the comments carefully and if you still don't understand look up the 
REM * commands before running.
REM *****************************************************************************
REM * I can't / won't be responsible for negative effects of this script.
REM *****************************************************************************

REM Step 0: Loop through a list of given files.
for /f %%a in (file_list.txt) do (

	REM Step 1: Tell the user what file is being processed.
	echo Processing %%a

	REM Step 2: Prepend the file contents to the beginning of the file in the list.
	REM Save the results to a temporary filename.  This example uses a 1 at the end 
	REM of the file name
	type mrnoedit_include_epic2012_report.txt %%a > %%a1

	REM Step 3: Since file cannot be opened for both input and output at the same 
	REM time, rename the file above from a temp name back to the production name.
	move /y %%a1 %%a
)


file_list.txt:
\\server\C$\ibi\WebFOCUS768\basedir\ehrupgdh\app\Standards_ccdpats.fex
\\server\C$\ibi\WebFOCUS768\basedir\ehrupgdh\app\Standards_edh4pats.fex
\\server\C$\ibi\WebFOCUS768\basedir\ehrupgdh\app\Standards_edhospts.fex
...(snip)...


mrnoedit_include_epic2012_report.txt:
-MRNOEDIT -INCLUDE EPIC2012_REPORT



File Before:
-*=====================================================================*
-*    COPYRIGHT 2008, MY COMPANY, INC.                                 *
-*                      INFORMATION DELIVERY                           *
-*=====================================================================*
-* PROGRAM:      Readmits Reporting by Nurse Unit
...(snip)...


File After:
-MRNOEDIT -INCLUDE EPIC2012_REPORT
-*=====================================================================*
-*    COPYRIGHT 2008, MY COMPANY, INC.                                 *
-*                      INFORMATION DELIVERY                           *
-*=====================================================================*
-* PROGRAM:      Readmits Reporting by Nurse Unit
...(snip)...




- ABT

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


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Reply With QuoteReport This Post
Master
posted Hide Post
Second task was to update a large list of MFDs (6000+) to point from one Data Adapter to another.

Update MFDs:
@ECHO OFF

REM *****************************************************************************
REM * WARNING: THIS SCRIPT WILL UNMERCIFULLY UPDATE FILES.  BE VERY CAREFUL.
REM *****************************************************************************
REM * Read the comments carefully and if you still don't understand look up the 
REM * commands before running.
REM *****************************************************************************
REM * I can't / won't be responsible for negative effects of this script.
REM *****************************************************************************

REM Step 0: read the output of the DIR command dynamically to produce a change list.
for /f %%a in ('dir /b c:\epic_2012\mfds\*.acx') do (

   REM Step 1: Tell the user what's hanppening
   echo Processing c:\epic_2012\mfds\%%a

   REM Step 2: Use SED to edit the file and change CLRTST_2012 to CLRPRD.  Add the CONNECTION flag
   REM to ensure it is only in the scope of the data adapter definition.  Hold the output to a 
   REM temporary directory with the same name.  Copy those files out to WebFOCUS server manually.
   sed "s/CONNECTION=CLRTST_2012/CONNECTION=CLRPRD/g" c:\epic_2012\mfds\%%a > c:\epic_2012\mfds\hstemp\%%a
)



MFD Before:
 SEGNAME=HSACC_CONFIG_BLK, TABLENAME=CLARITY.ACC_CONFIG_BLK, 
   CONNECTION=CLRTST_2012, KEYS=2, $



MFD After:
 SEGNAME=HSACC_CONFIG_BLK, TABLENAME=CLARITY.ACC_CONFIG_BLK, 
   CONNECTION=CLRPRD, KEYS=2, $



You can download a Windows port of SED here (http://gnuwin32.sourceforge.net/packages/sed.htm) and read more about it's capabilities here: http://ss64.com/bash/sed.html

- ABT

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


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
looks like a pretty handy tool.
You're American Ballet Theatre, right? well...that's your handle from now on Smiler




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteReport This Post
Master
posted Hide Post
I've got a Susannah name! Me and Frankie Martini are in the same club. Wink


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [TECHNIQUE] Couple cool, large scale FEX management funzies

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.