Sunteți pe pagina 1din 1

DB2 processor

Dos command : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command


"I:\Implementation\Customization\ZOSDB2\CAS\CAS_DB2_replace.ps1"

Ps1 code :

$TxtFiles = Get-ChildItem "S:\CAS\Database" *.TXT -rec

foreach ($file in $TxtFiles)


{

$content=(Get-Content "S:\CAS\Database\$file")

if ($file.Name -notmatch "COLUMN.TXT")


{
$content -Replace '255[" "]{8}\x00.*$', '0 xx' | Set-Content
"S:\CAS\Database\$file"
}
}

CICS processor

Dos command :
i:\Implementation\Customization\Script_to_Preprocess_CICS\Python34\python.exe
i:\Implementation\Customization\Script_to_Preprocess_CICS\CICS_Preprocess.py %1
Python command

import os
import sys

'''rootDir = os.getcwd()
'''
rootDir = sys.argv[1]
print ('path : '+sys.argv[1])

for root, subdirs, files in os.walk(rootDir):


for fl in files:
if ".csd" in fl :
filename=os.path.join(root,fl)
print ('file: ' + filename)
with open(filename, 'r') as f:
lines = f.readlines()
o = open(filename, 'w')
for line in lines:
if "DEFINE " in line:
outline=''.join(["",line.strip(),'\n'])
else:
outline = ''.join(["DEFINE ",line.strip(),'\n'])
o.writelines(outline)

S-ar putea să vă placă și