??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲欧美日韩高清,97超碰在线免费,国产嫩草影院久久久久http://www.aygfsteel.com/xichengmylove/category/23633.htmlSOA、DataStage、Unix、Java EE、Oracle、Data Migration、Data Integrationzh-cnWed, 16 Jan 2008 02:41:24 GMTWed, 16 Jan 2008 02:41:24 GMT60ETL时先disable外键U束再load数据http://www.aygfsteel.com/xichengmylove/archive/2008/01/15/175486.html翼渐丰翼渐丰Tue, 15 Jan 2008 08:12:00 GMThttp://www.aygfsteel.com/xichengmylove/archive/2008/01/15/175486.htmlhttp://www.aygfsteel.com/xichengmylove/comments/175486.htmlhttp://www.aygfsteel.com/xichengmylove/archive/2008/01/15/175486.html#Feedback1http://www.aygfsteel.com/xichengmylove/comments/commentRss/175486.htmlhttp://www.aygfsteel.com/xichengmylove/services/trackbacks/175486.html Flexibility for Data Loads and Identification of Integrity Violations
You can disable integrity constraints temporarily so that large amounts of data can be loaded without the overhead of constraint checking. When the data load is complete,you can easily enable the integrity constraints, and you can automatically report any new rows that violate integrity constraints to a separate exceptions table.
看来oracleq点上做的比较完善,q可以将q反完整性约束的数据自动记录C个exception表中?

翼渐丰 2008-01-15 16:12 发表评论
]]>
在load的时候去掉sequential file的header和footerhttp://www.aygfsteel.com/xichengmylove/archive/2007/08/13/136494.html翼渐丰翼渐丰Mon, 13 Aug 2007 11:37:00 GMThttp://www.aygfsteel.com/xichengmylove/archive/2007/08/13/136494.htmlhttp://www.aygfsteel.com/xichengmylove/comments/136494.htmlhttp://www.aygfsteel.com/xichengmylove/archive/2007/08/13/136494.html#Feedback0http://www.aygfsteel.com/xichengmylove/comments/commentRss/136494.htmlhttp://www.aygfsteel.com/xichengmylove/services/trackbacks/136494.htmlҎ一Q?/span>
在sequential file stage中有个属性可以ignoreW一行。对于footerQ如果footer使用了与正文不同的格式,可以用用transformer stage?@INROWNUM stage来将footerL?br>Ҏ二:
在sequential file的filter option中用sed -e '$d' -e '1d'来讲header和footerL?br>Ҏ三:
写个before job subroutineQ可以先对这个文件做各种处理Q不q我想也是subroutine中调用DSExecute sed -e '$d' -e '1d'。当然Basic中也有专门对sequential file处理的函数?br>

翼渐丰 2007-08-13 19:37 发表评论
]]>
datastage中Orchadmin命o的用(转) http://www.aygfsteel.com/xichengmylove/archive/2007/08/08/135256.html翼渐丰翼渐丰Wed, 08 Aug 2007 07:37:00 GMThttp://www.aygfsteel.com/xichengmylove/archive/2007/08/08/135256.htmlhttp://www.aygfsteel.com/xichengmylove/comments/135256.htmlhttp://www.aygfsteel.com/xichengmylove/archive/2007/08/08/135256.html#Feedback0http://www.aygfsteel.com/xichengmylove/comments/commentRss/135256.htmlhttp://www.aygfsteel.com/xichengmylove/services/trackbacks/135256.htmlOrchadmin is a command line utility provided by datastage to research on data sets.
The general callable format is : $orchadmin [options] [descriptor file]

1. Before using orchadmin, you should make sure that either the working directory or the $APT_ORCHHOME/etc contains the file “config.apt” OR

The environment variable $APT_CONFIG_FILE should be defined for your session.
Orchadmin commands

The various commands available with orchadmin are
1. CHECK: $orchadmin check

Validates the configuration file contents like , accesibility of all nodes defined in the configuration file, scratch disk definitions and accesibility of all the nodes etc. Throws an error when config file is not found or not defined properly

2. COPY : $orchadmin copy
Makes a complete copy of the datasets of source with new destination descriptor file name. Please not that

a. You cannot use UNIX cp command as it justs copies the config file to a new name. The data is not copied.

b. The new datasets will be arranged in the form of the config file that is in use but not according to the old confing file that was in use with the source.

3. DELETE : $orchadmin <> [-f -x] descriptorfiles….
The unix rm utility cannot be used to delete the datasets. The orchadmin delete or rm command should be used to delete one or more persistent data sets.
-f options makes a force delete. If some nodes are not accesible then -f forces to delete the dataset partitions from accessible nodes and leave the other partitions in inaccesible nodes as orphans.
-x forces to use the current config file to be used while deleting than the one stored in data set.

4. DESCRIBE: $orchadmin describe [options] descriptorfile.ds
This is the single most important command.
1. Without any option lists the no.of.partitions, no.of.segments, valid segments, and preserve partitioning flag details of the persistent dataset.
-c : Print the configuration file that is written in the dataset if any
-p: Lists down the partition level information.
-f: Lists down the file level information in each partition
-e: List down the segment level information .
-s: List down the meta-data schema of the information.
-v: Lists all segemnts , valid or otherwise
-l : Long listing. Equivalent to -f -p -s -v -e

5. DUMP: $orchadmin dump [options] descriptorfile.ds
The dump command is used to dump(extract) the records from the dataset.
Without any options the dump command lists down all the records starting from first record from first partition till last record in last partition.
-delim ‘’ : Uses the given string as delimtor for fields instead of space.
-field : Lists only the given field instead of all fields.
-name : List all the values preceded by field name and a colon
-n numrecs : List only the given number of records per partition.
-p period(N) : Lists every Nth record from each partition starting from first record.
-skip N: Skip the first N records from each partition.
-x : Use the current system configuration file rather than the one stored in dataset.

6. TRUNCATE: $orchadmin truncate [options] descriptorfile.ds
Without options deletes all the data(ie Segments) from the dataset.
-f: Uses force truncate. Truncate accessible segments and leave the inaccesible ones.
-x: Uses current system config file rather than the default one stored in the dataset.
-n N: Leaves the first N segments in each partition and truncates the remaining.

7. HELP: $orchadmin -help OR $orchadmin -help
Help manual about the usage of orchadmin or orchadmin commands



翼渐丰 2007-08-08 15:37 发表评论
]]>
trim会drop掉记?/title><link>http://www.aygfsteel.com/xichengmylove/archive/2007/08/02/134104.html</link><dc:creator>翼渐丰</dc:creator><author>翼渐丰</author><pubDate>Thu, 02 Aug 2007 13:01:00 GMT</pubDate><guid>http://www.aygfsteel.com/xichengmylove/archive/2007/08/02/134104.html</guid><wfw:comment>http://www.aygfsteel.com/xichengmylove/comments/134104.html</wfw:comment><comments>http://www.aygfsteel.com/xichengmylove/archive/2007/08/02/134104.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xichengmylove/comments/commentRss/134104.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xichengmylove/services/trackbacks/134104.html</trackback:ping><description><![CDATA[当一条记录过来,某个字段为空Q而在transformer中又对该字段trim了,׃该字DؓI,不能trimQ所以DataStage会认是个错误Q从而把q个记录drop了,q与实际业务不符合,非主键字DؓIƈ不能把q条记录drop了。我们可以通过写一个判断来解决该问题:if LK_1.EMAIL <> '' then trim(LK_1.EMAIL) else LK_1.EMAIL <img src ="http://www.aygfsteel.com/xichengmylove/aggbug/134104.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xichengmylove/" target="_blank">翼渐丰</a> 2007-08-02 21:01 <a href="http://www.aygfsteel.com/xichengmylove/archive/2007/08/02/134104.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>DataStage中可以执行routineQ命令行以控制的地方http://www.aygfsteel.com/xichengmylove/archive/2007/08/02/134095.html翼渐丰翼渐丰Thu, 02 Aug 2007 11:29:00 GMThttp://www.aygfsteel.com/xichengmylove/archive/2007/08/02/134095.htmlhttp://www.aygfsteel.com/xichengmylove/comments/134095.htmlhttp://www.aygfsteel.com/xichengmylove/archive/2007/08/02/134095.html#Feedback0http://www.aygfsteel.com/xichengmylove/comments/commentRss/134095.htmlhttp://www.aygfsteel.com/xichengmylove/services/trackbacks/134095.html2 job sequence中有个stageQ可以在里面写控制job调度的地?br>3 每个job的properties中有个job control tab
4 命o行可以执行、导入job{,它通过dsjob实现Q在DS Manager的文档中q讲了有专门的命令行来导入job
5 可以~写shell来控制jobQ对dsjob命o做封装,可以传入参数{?br>对于上面q些概念q是很模p,先记录在此?

翼渐丰 2007-08-02 19:29 发表评论
]]>
trim全ؓnull的某个字D之后,输出?http://www.aygfsteel.com/xichengmylove/archive/2007/08/02/133997.html翼渐丰翼渐丰Thu, 02 Aug 2007 07:21:00 GMThttp://www.aygfsteel.com/xichengmylove/archive/2007/08/02/133997.htmlhttp://www.aygfsteel.com/xichengmylove/comments/133997.htmlhttp://www.aygfsteel.com/xichengmylove/archive/2007/08/02/133997.html#Feedback0http://www.aygfsteel.com/xichengmylove/comments/commentRss/133997.htmlhttp://www.aygfsteel.com/xichengmylove/services/trackbacks/133997.html

翼渐丰 2007-08-02 15:21 发表评论
]]>
job一直运行,数据不能插入数据?/title><link>http://www.aygfsteel.com/xichengmylove/archive/2007/08/01/133839.html</link><dc:creator>翼渐丰</dc:creator><author>翼渐丰</author><pubDate>Wed, 01 Aug 2007 09:33:00 GMT</pubDate><guid>http://www.aygfsteel.com/xichengmylove/archive/2007/08/01/133839.html</guid><wfw:comment>http://www.aygfsteel.com/xichengmylove/comments/133839.html</wfw:comment><comments>http://www.aygfsteel.com/xichengmylove/archive/2007/08/01/133839.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xichengmylove/comments/commentRss/133839.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xichengmylove/services/trackbacks/133839.html</trackback:ping><description><![CDATA[今天遇到一个问题,job不停的在那里q行Q然后link上的数据昄各个环节都是正确的,包括最后插入数据库的link上也昄了数据,但是最后数据库里ƈ没有数据。在Director的log中,日志在从两个源文件把所有数据load出来完之后,日志死在那里了?br>以前q个job是正的Q昨天由于重新load其中一个源文g的元数据Q所以出C上述问题。所以先前以为是׃load的新的源数据有问题,׃此处来找问题的原因,q且认ؓ可能是改了元数据Q在其他地方映射的时候有位置不对的地方,所以整了很久。因Z前是好好的,然后又以为是服务器的问题?br><br><span style="FONT-SIZE: 18pt; COLOR: #800080">q都是定势思维的错误,然后又一急,所以浪费了很多旉Q其实很多时候都是这PZ问题我们不能理性的好好思考?/span><br><br>其实问题很简单:<br>如果我们按照正常逻辑来分析的话,既然不能d数据库,肯定是数据不W合数据库对数据的约束,包括主键啊,非空啊,本问题就是由于在stage的不断流转中产生了很多空|使得最后待插入的数据长度远q大于数据库中定义的字段长度。由于在那里不断rejectQ所以媄响了速度Qjob一直在那里q行。最后用APT_STRING_PADDER,其设ؓ0x0Q用null代替I格Q搞定?br>psQ在插入数据库时使用一个reject文gҎ错有好处Q这栯看到reject是些什么数据,然后p知道Z么被reject了?br><span style="FONT-SIZE: 18pt; COLOR: #800080">同时我们可以得出如果最后插入数据库时很多数据被rejectQ但是你q没有用一个reject文g来接收这些reject掉的数据Q将使得job基本处于停滞状态?/span> <img src ="http://www.aygfsteel.com/xichengmylove/aggbug/133839.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xichengmylove/" target="_blank">翼渐丰</a> 2007-08-01 17:33 <a href="http://www.aygfsteel.com/xichengmylove/archive/2007/08/01/133839.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>DataStage Job重置的三U方?/title><link>http://www.aygfsteel.com/xichengmylove/archive/2007/08/01/133747.html</link><dc:creator>翼渐丰</dc:creator><author>翼渐丰</author><pubDate>Wed, 01 Aug 2007 02:17:00 GMT</pubDate><guid>http://www.aygfsteel.com/xichengmylove/archive/2007/08/01/133747.html</guid><wfw:comment>http://www.aygfsteel.com/xichengmylove/comments/133747.html</wfw:comment><comments>http://www.aygfsteel.com/xichengmylove/archive/2007/08/01/133747.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xichengmylove/comments/commentRss/133747.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xichengmylove/services/trackbacks/133747.html</trackback:ping><description><![CDATA[<p>当一个Job跑到一半终止了要还原,在DS Director中主要有三种Ҏ来还原:<br>1 Job-----Reset<br>2 Job-----Clear Status File<br>3 Job-----Cleanup Resource<br>具体l节也不懂,有时间慢慢研I?/p> <img src ="http://www.aygfsteel.com/xichengmylove/aggbug/133747.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xichengmylove/" target="_blank">翼渐丰</a> 2007-08-01 10:17 <a href="http://www.aygfsteel.com/xichengmylove/archive/2007/08/01/133747.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Datastage快捷?/title><link>http://www.aygfsteel.com/xichengmylove/archive/2007/07/24/132089.html</link><dc:creator>翼渐丰</dc:creator><author>翼渐丰</author><pubDate>Tue, 24 Jul 2007 09:00:00 GMT</pubDate><guid>http://www.aygfsteel.com/xichengmylove/archive/2007/07/24/132089.html</guid><wfw:comment>http://www.aygfsteel.com/xichengmylove/comments/132089.html</wfw:comment><comments>http://www.aygfsteel.com/xichengmylove/archive/2007/07/24/132089.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xichengmylove/comments/commentRss/132089.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xichengmylove/services/trackbacks/132089.html</trackback:ping><description><![CDATA[<span style="COLOR: #800080">Datastage Desiner的快捷键</span><br>1 关闭某个job <Ctrl+F4><br>2 <Ctrl+F6>同时打开了两个以上jobQ在不同的job之间切换?br><span style="COLOR: #800080">Datastage Director的快捷键</span><br> <img src ="http://www.aygfsteel.com/xichengmylove/aggbug/132089.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xichengmylove/" target="_blank">翼渐丰</a> 2007-07-24 17:00 <a href="http://www.aygfsteel.com/xichengmylove/archive/2007/07/24/132089.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>调用dsjob的shell scripthttp://www.aygfsteel.com/xichengmylove/archive/2007/07/18/130982.html翼渐丰翼渐丰Wed, 18 Jul 2007 02:32:00 GMThttp://www.aygfsteel.com/xichengmylove/archive/2007/07/18/130982.htmlhttp://www.aygfsteel.com/xichengmylove/comments/130982.htmlhttp://www.aygfsteel.com/xichengmylove/archive/2007/07/18/130982.html#Feedback0http://www.aygfsteel.com/xichengmylove/comments/commentRss/130982.htmlhttp://www.aygfsteel.com/xichengmylove/services/trackbacks/130982.html#######
################################################################################
#######
####### FILE: MasterControl.ksh
#######
####### DESCRIPTION: Starts a DataStage MasterControl type job passing
#######              all runtime parameter values
#######
#######
####### Date       Version   Developer      Description
####### ---------- --------- -------------- ------------------------------------
####### 2002-05-15 1.0       Ken Bland      Initial release
####### 2002-06-27 2.2       Ken Bland      FileSetDate/ProcessDate modifications
####### 2002-07-10 2.2       Steve Boyce    Added ProcessDate as 14th parameter
####### 2002-08-16 2.3       Steve Boyce    Now calls stored procedure
#######                                     GET_NEW_BATCH_NBR in datastage schema
#######                                     instead of deriving it and inserting
#######                                     here.
#######                                     Uses comSQLPlus.ksh and comPLSQL.ksh
#######                                     instead of SQLPlusStub.ksh.ksh
#######

PROG=`basename ${0}`
EXIT_STATUS=0

NOW=`date`
echo "${NOW} ${PROG} Initialization..."
echo

#######
####### CONFIGURATION ##########################################################
#######

if [ ${#} -ne 14 ]; then
   echo "${NOW} ${PROG} : Invalid parameter list."
   echo "${NOW} ${PROG} : The script needs 14 parameters:"
   echo "${NOW} ${PROG} :    JobName"
   echo "${NOW} ${PROG} :    ParameterFile"
   echo "${NOW} ${PROG} :    FileSetDate (YYYY-MM-DD)"
   echo "${NOW} ${PROG} :    BatchNumber"
   echo "${NOW} ${PROG} :    JobHierarchyFile"
   echo "${NOW} ${PROG} :    SourceSystemList"
   echo "${NOW} ${PROG} :    SubjectAreaList"
   echo "${NOW} ${PROG} :    ClearWorkArea"
   echo "${NOW} ${PROG} :    StartingMilestone"
   echo "${NOW} ${PROG} :    EndingMilestone"
   echo "${NOW} ${PROG} :    DebugMode"
   echo "${NOW} ${PROG} :    JobLinkStatisticChecksFile"
   echo "${NOW} ${PROG} :    ResurrectLogFile"
   echo "${NOW} ${PROG} :    ProcessDate (NULL|YYYY-MM-DD H24:MI:SS)"
   exit 99
fi

JobName="${1}"
ParameterFile="${2}"
FileSetDate="${3}"
BatchNumber="${4}"
JobHierarchyFile="${5}"
SourceSystemList="${6}"
SubjectAreaList="${7}"
ClearWorkArea="${8}"
StartingMilestone="${9}"
EndingMilestone="${10}"
DebugMode="${11}"
JobLinkStatisticChecksFile="${12}"
ResurrectLogFile="${13}"
ProcessDate="${14}"

echo "${NOW} ${PROG} JobName ${JobName}"
echo "${NOW} ${PROG} ParameterFile ${ParameterFile}"
echo "${NOW} ${PROG} FileSetDate ${FileSetDate}"
echo "${NOW} ${PROG} BatchNumber ${BatchNumber}"
echo "${NOW} ${PROG} JobHierarchyFile ${JobHierarchyFile}"
echo "${NOW} ${PROG} SourceSystemList ${SourceSystemList}"
echo "${NOW} ${PROG} SubjectAreaList ${SubjectAreaList}"
echo "${NOW} ${PROG} ClearWorkArea ${ClearWorkArea}"
echo "${NOW} ${PROG} StartingMilestone ${StartingMilestone}"
echo "${NOW} ${PROG} EndingMilestone ${EndingMilestone}"
echo "${NOW} ${PROG} DebugMode ${DebugMode}"
echo "${NOW} ${PROG} JobLinkStatisticChecksFile ${JobLinkStatisticChecksFile}"
echo "${NOW} ${PROG} ResurrectLogFile ${ResurrectLogFile}"
echo "${NOW} ${PROG} ProcessDate ${ProcessDate}"
echo

# Below will look in the parameters.ini file to determine the directory path each.
UserID=`whoami`
BinFileDirectory=`cat /.dshome`/bin
LogFileDirectory=`grep -w LogFileDirectory ${ParameterFile}|cut -d "=" -f2`
TempFileDirectory=`grep -w TempFileDirectory ${ParameterFile}|cut -d "=" -f2`
CommonScriptFileDirectory=`grep -w CommonScriptFileDirectory ${ParameterFile}|cut -d "=" -f2`
CommonLogFileDirectory=`grep -w CommonLogFileDirectory ${ParameterFile}|cut -d "=" -f2`
LogFileName=${CommonLogFileDirectory}/${PROG}_${JobName}.log
TEMPBATCHNBRLOG=${TempFileDirectory}/${PROG}_${JobName}_start.log
DATASTAGEPROJECT=`grep -w DATASTAGEPROJECT ${ParameterFile}|cut -d "=" -f2`
DSSERVER=`grep -w DSSERVER ${ParameterFile}|cut -d "=" -f2`
DSUSERID=`grep -w DSUSERID ${ParameterFile}|cut -d "=" -f2`
DSPASSWORD=`grep -w DSPASSWORD ${ParameterFile}|cut -d "=" -f2`

NOW=`date`
echo "${NOW} ${PROG} UserID ${UserID}"
echo "${NOW} ${PROG} BinFileDirectory ${BinFileDirectory}"
echo "${NOW} ${PROG} LogFileDirectory ${LogFileDirectory}"
echo "${NOW} ${PROG} TempFileDirectory ${TempFileDirectory}"
echo "${NOW} ${PROG} CommonScriptFileDirectory ${CommonScriptFileDirectory}"
echo "${NOW} ${PROG} CommonLogFileDirectory ${CommonLogFileDirectory}"
echo "${NOW} ${PROG} LogFileName ${LogFileName}"
echo "${NOW} ${PROG} TEMPBATCHNBRLOG ${TEMPBATCHNBRLOG}"
echo "${NOW} ${PROG} DATASTAGEPROJECT ${DATASTAGEPROJECT}"
echo "${NOW} ${PROG} DSSERVER ${DSSERVER}"
echo "${NOW} ${PROG} DSUSERID ${DSUSERID}"
echo "${NOW} ${PROG} DSPASSWORD *Protected*"
echo

#######
####### PARAMETER BUILD Without batch number ##################################
#######

if [ "${ProcessDate}" = "NULL" ]; then
   StartTimestamp=`date '+%Y-%m-%d %H:%M:%S'`
else
   StartTimestamp="${ProcessDate}"
fi
ParamList=" -param ParameterFile=${ParameterFile}"
ParamList="${ParamList} -param ProcessDate=\"${StartTimestamp}\""
ParamList="${ParamList} -param FileSetDate=${FileSetDate}"
ParamList="${ParamList} -param JobHierarchyFile=${JobHierarchyFile}"
ParamList="${ParamList} -param SourceSystemList=${SourceSystemList}"
ParamList="${ParamList} -param SubjectAreaList=${SubjectAreaList}"
ParamList="${ParamList} -param ClearWorkArea=${ClearWorkArea}"
ParamList="${ParamList} -param StartingMilestone=${StartingMilestone}"
ParamList="${ParamList} -param EndingMilestone=${EndingMilestone}"
ParamList="${ParamList} -param DebugMode=${DebugMode}"
ParamList="${ParamList} -param JobLinkStatisticChecksFile=${JobLinkStatisticChecksFile}"
ParamList="${ParamList} -param ResurrectLogFile=${ResurrectLogFile}"

#######
####### Get Batch Number and create ETL_BATCH_AUDIT record #####################
#######

echo "${NOW} ${PROG} About to get new BATCH_NBR and insert it into ETL_BATCH_AUDIT..."
${CommonScriptFileDirectory}/comPLSQL.ksh ${ParameterFile} "IRDSN" "IRUserID" \
                                           GET_NEW_BATCH_NBR \
                                              "${JobName}" \
                                              "${StartTimestamp}" \
                                              "${UserID}" \
                                              "${SourceSystemList}" \
                                              "${SubjectAreaList}" \
                                              "${ParamList}" \
                                              "${FileSetDate}" > ${TEMPBATCHNBRLOG}
SQL_EXIT_STATUS=$?
cat ${TEMPBATCHNBRLOG}
if [ "${SQL_EXIT_STATUS}" != 0 ]; then
   NOW=`date`
   echo "${NOW} ${PROG} Failure to connect/insert into ETL_Batch_Audit table!"
   exit ${SQL_EXIT_STATUS}
fi

#######
####### Get BATCH_NBR from batch number log file ##############################
#######
BatchNumber=`grep -w BATCH_NBR ${TEMPBATCHNBRLOG}|cut -d "=" -f2`
if [ -z "${BatchNumber}" ]; then
   NOW=`date`
   echo "${NOW} ${PROG} Failure to retrieve BATCH_NBR from ${TEMPBATCHNBRLOG}"
   exit ${SQL_EXIT_STATUS}
fi

#######
####### Add batch number to list of parameters #################################
#######
ParamList="${ParamList} -param BatchNumber=${BatchNumber}"

NOW=`date`
echo
echo ${NOW} ${PROG} Parameter list: ${ParamList}
echo

#######
####### DataStage EXECUTION ####################################################
#######

NOW=`date`
echo "${NOW} ${PROG} Executing DataStage dsjob program..."

echo ${BinFileDirectory}/dsjob -server ${DSSERVER} -user ${DSUSERID} -password ${DSPASSWORD} -run -wait ${ParamList} ${DATASTAGEPROJECT} ${JobName} 2>&1 > ${LogFileName}
echo
echo "${BinFileDirectory}/dsjob -server ${DSSERVER} -user ${DSUSERID} -password ${DSPASSWORD} -run -wait ${ParamList} ${DATASTAGEPROJECT} ${JobName} 2>&1 > ${LogFileName}"
echo

eval ${BinFileDirectory}/dsjob -server ${DSSERVER} -user ${DSUSERID} -password ${DSPASSWORD} -run -wait ${ParamList} ${DATASTAGEPROJECT} ${JobName} 2>&1 >> ${LogFileName}

jobwaiting=`grep "Waiting for job..." ${LogFileName}`
if [ "${jobwaiting}" != "Waiting for job..." ]; then
   NOW=`date`
   echo ${NOW} ${PROG} "DataStage failed to start the job"
   failedstart=1
else
   NOW=`date`
   echo ${NOW} ${PROG} "DataStage successfully started the job"
   failedstart=0
fi
NOW=`date`
echo ${NOW} ${PROG} "Retrieving job information"

${BinFileDirectory}/dsjob -server ${DSSERVER} -user ${DSUSERID} -password ${DSPASSWORD} -jobinfo ${DATASTAGEPROJECT} ${JobName} >> ${LogFileName}

#######
####### CHECK STATUS ###########################################################
#######

ERROR=`grep "Job Status" ${LogFileName}`
ERROR=${ERROR##*\(}
ERROR=${ERROR%%\)*}

if [ "${failedstart}" != 0 ]; then
   NOW=`date`
   echo ${NOW} ${PROG} "The job failed to start"
   AuditStatus="FAILURE"
   Comments="MasterControl aborted"
   EXIT_STATUS=1
else
   if [ "${ERROR}" = 1 -o "${ERROR}" = 2 ]; then
      NOW=`date`
      echo ${NOW} ${PROG} "The job completed successfully"
      AuditStatus="SUCCESS"
      Comments=""
      EXIT_STATUS=0
   else
      NOW=`date`
      echo ${NOW} ${PROG} "The job aborted"
      AuditStatus="FAILURE"
      Comments="MasterControl aborted"
      EXIT_STATUS=1
   fi
fi

FailedJobCount=`grep -i FAILED ${LogFileDirectory}/${JobName}.log|wc -l|cut -b1-9`
FailedJobCount=`expr ${FailedJobCount} + 0`
echo ${NOW} ${PROG} The number of failed jobs is [${FailedJobCount}]

if [ "${FailedJobCount}" != 0 ]; then
   NOW=`date`
   echo ${NOW} ${PROG} "The job had failed processes"
   AuditStatus="FAILURE"
   Comments="MasterControl had ${FailedJobCount} failed processes"
   EXIT_STATUS=1
fi
StoppedJobStreamCount=`grep "JOB STREAM STOPPED" ${LogFileDirectory}/${JobName}.his|wc -l|cut -b1-9`
StoppedJobStreamCount=`expr ${StoppedJobStreamCount} + 0`
if [ "${StoppedJobStreamCount}" != 0 ]; then
   NOW=`date`
   echo ${NOW} ${PROG} "The job stream was STOPped or KILLed"
   AuditStatus="FAILURE"
   Comments="MasterControl job stream was STOPped or KILLed"
   EXIT_STATUS=1
fi

#######
####### AUDIT ##################################################################
#######

echo
echo "${NOW} ${PROG} About to update ETL_BATCH_AUDIT with status information..."
EndTimestamp=`date '+%Y-%m-%d %H:%M:%S'`

SQLstring="UPDATE ETL_BATCH_AUDIT A \
              SET A.END_TIMESTAMP = TO_DATE('${EndTimestamp}','YYYY-MM-DD HH24:MI:SS'), \
                         A.STATUS = '${AuditStatus}', \
                       A.COMMENTS = '${Comments}', \
                A.RUNTIMESETTINGS = '${ParamList}' \
            WHERE (A.BATCH_NBR = ${BatchNumber});"

NOW=`date`
echo ${NOW} ${PROG} Audit SQL ${SQLstring}
SQLScriptFileName=${TempFileDirectory}/${PROG}_${JobName}_end.sql
echo ${SQLstring} > ${SQLScriptFileName}

${CommonScriptFileDirectory}/comSQLPlus.ksh ${ParameterFile} IRDSN IRUserID ${SQLScriptFileName}
SQL_EXIT_STATUS=$?
if [ "${SQL_EXIT_STATUS}" != 0 ]; then
   NOW=`date`
   echo ${NOW} ${PROG} Failure to connect/update into ETL_Batch_Audit table!
   exit ${SQL_EXIT_STATUS}
fi

#######
####### EXIT ###################################################################
#######

NOW=`date`
echo ${NOW} ${PROG} Complete, exiting with status [${EXIT_STATUS}]
exit ${EXIT_STATUS}


好东西,先收着Q再研究?/span>

翼渐丰 2007-07-18 10:32 发表评论
]]>
DataStage中不能删除Jobhttp://www.aygfsteel.com/xichengmylove/archive/2007/07/14/130268.html翼渐丰翼渐丰Sat, 14 Jul 2007 06:34:00 GMThttp://www.aygfsteel.com/xichengmylove/archive/2007/07/14/130268.htmlhttp://www.aygfsteel.com/xichengmylove/comments/130268.htmlhttp://www.aygfsteel.com/xichengmylove/archive/2007/07/14/130268.html#Feedback0http://www.aygfsteel.com/xichengmylove/comments/commentRss/130268.htmlhttp://www.aygfsteel.com/xichengmylove/services/trackbacks/130268.html在DataStage中job不能删除Q如果试着~译又出现如下错误:
Error calling subroutine: DSR_EXECJOB (Action=1); check DataStage is set up correctly in project ETUDES
(Subroutine failed to complete successfully (30107))

+

(40503) A call to an OLE server has failed, or a runtime error occured within the ole itself.

解决办法Q?br>1 首先q行命oQDELETE FROM DS_JOBS WHERE NAME = 'JobName'
2 再运行DS.CHECKER Q注意要q行DS.CHECKER必须要有exclusive access到project
Q通过如下命o可以看到有谁q连接到了服务器Qnetstat -a |grep dsrpc



翼渐丰 2007-07-14 14:34 发表评论
]]>
DataStage Basic学习W记http://www.aygfsteel.com/xichengmylove/archive/2007/07/12/129843.html翼渐丰翼渐丰Thu, 12 Jul 2007 06:46:00 GMThttp://www.aygfsteel.com/xichengmylove/archive/2007/07/12/129843.htmlhttp://www.aygfsteel.com/xichengmylove/comments/129843.htmlhttp://www.aygfsteel.com/xichengmylove/archive/2007/07/12/129843.html#Feedback0http://www.aygfsteel.com/xichengmylove/comments/commentRss/129843.htmlhttp://www.aygfsteel.com/xichengmylove/services/trackbacks/129843.html                                                            一 BASIC介绍

1 一般的BASICE序是如下一个格?br>[ label ] statement [ ; statement … ] <Return>
2 关于subroutine
a 如果嵌入CE序中用GOSUB调用Q如果在外部Q用CALL
b 使用returnq回CE序Q如果在return之前subroutinel束了,自动return
c 如果subroutine中有ABORT STOP CHAIN则永q回不到ȝ序?br>3 注释
以REM * ! $* 开头的为注?br>4 创徏一个BASIC E序的步?br>使用CREATE.FILE命o创徏一个type 1或type 19 DataStage file来保存BASICE序的源码?在DSEngine目录下运行CREATE.FILE命oQ它提CZ输入文g名等参数)

使用DataStage Editor或其他编辑器创徏BASICE序源码Q这个源码成Z刚才创徏的文件的一条记录?/p>

使用BASIC命o来编译你E序Q这创Z个包含目标代码的文g。目标文件的名字不重要,因ؓL通过源文件名来引用程序?/p>

可以用RUN命o来执行你的程序,使用RAID命o来调试你的程序?/p>


                                                                二、基知识
数据cd、变量和操作W?br>所有数据在内部都是以字W串存储Q在q行时{换ؓ具体cd?br>主要有三U数据类型:字符丌Ӏ数字型、和unknownQnullQ?/p>

字符?br>在BASIC源码中,字符串量是ASCII字符的序列,所以不能有0QnullQ和10QlinefeedQ字W,而是要用CHAR(0)和CHAR(10)
数字?br>范围?0(-307)?0(307)Q最?5位小?br>unknown
null在内部是由单一字节CHAR(128)代表的,是一个stringQ可以用pȝ变量@NULL.STR来引用它。在BASICE序中可以用系l变量@NULL来引用null倹{?br>一个字W串与nullq接l果为null

数组
dimensioned array
在向量(一l数l)中,W一个元素的index?
向量可以看做W二位ؓ1的二l数l(矩阵Q?br>矩阵和向量的W一个元素分别用vector.name(0)和matrix.name(0,0)表示。它可以在MATPARSE、MATREAD和MATWRITE语句中用来存储不合格的字Dc?/p>

动态数l?br>动态数l的最高层是字D,?F)分割。字D包含有(V)分割的值组成。每个值又可以包含?S)分割的subvalue?/p>

字符串的比较
字符串的比较是一个个的比较每个字W的ASCII的倹{如果两个字W串可以转换为数字,L比较两个数字的数值大。Q何gnull相比较的l果都是unknown。空串不是简单的{于0。空格看做小??/p>

字符串匹?br>X代表M字符 A代表所有字?N代表所有数?前面的数字代表重复次数。如果前面的数字?Q代表后面的字符重复0到Nơ的Lơ数都可以?/p>

0是false IZ是false null非true非false


?事务和隔ȝ?br>?br>锁有两种_度Q细_度Q记录锁定)和粗_度Q文仉定)
DataStage支持以下几种锁:
记录׃n?br>记录更新?br>文g׃n?br>文g意向QintentQ锁 介于׃n与排他之?br>文g排他?/p>

事务
事务可以嵌套
子事务在父事务提交或回滚之前开始的话,子事务将变成zd事务Q而父事务l存在但是是非活动的。当子事务提交或回滚之后Q父事务再ơ变为活动的?br>在最高层的事务提交之前,缓存所有子事务的数据库操作。当q行一个读取操作时Q首先会去读取缓存的数据Q如果找不到才会从数据库文g中读取?br>



翼渐丰 2007-07-12 14:46 发表评论
]]>
在Java中调用DataStage的jobhttp://www.aygfsteel.com/xichengmylove/archive/2007/07/10/129416.html翼渐丰翼渐丰Tue, 10 Jul 2007 12:13:00 GMThttp://www.aygfsteel.com/xichengmylove/archive/2007/07/10/129416.htmlhttp://www.aygfsteel.com/xichengmylove/comments/129416.htmlhttp://www.aygfsteel.com/xichengmylove/archive/2007/07/10/129416.html#Feedback0http://www.aygfsteel.com/xichengmylove/comments/commentRss/129416.htmlhttp://www.aygfsteel.com/xichengmylove/services/trackbacks/129416.htmlProcess p = Runtime.getRuntime().exec( MProperties.DS_EXE_PATH + "/dsjob -run -wait -param lowDate=" + lowDate + " -param highDate=" + highDatePlusOne + " -param dsOutDir=" + MProperties.DS_OUT_DIR + " -param IDB_user=" +MProperties.IDB_USER + " -param IDB_pass=" +
MProperties.IDB_PASS + " " + MProperties.DS_PROJECT + " " + MProperties.DS_JOB);
p.waitFor();
return p.exitValue() == 0;

另外如果有RTIQ更好的Ҏ如下Q?/span>
The best way for this to be accomplished is by using the RTI (Real Time Integration) capabilities that we added in 7.x. This allows you to fully expose a DataStage job as a service, to be then invoked via several different mechanisms, depending on your needs....

.....the job can be exposed as a classic web service, using SOAP over HTTP...we generate and publish the WSDL for this within RTI...

....the job can be exposed via our EJB binding and called appropriately

....the job can be exposed for contact via JMS, and either passed a text message or SOAP envelope....

Not only can you simply pass job parameters via this architecture, you can actually have the entire transformation job itself (columns on the ultimate input and output links) passed and returned to your calling client.

Additionally, the entire job control API, which you may already be familiar with in its API or command line implementations, has been exposed as a set of methods available via Web Services.
主要是通过job包装为web service或EJB或JMS来调用,可以传参敎ͼq可以将整个job本nQ最l的输入和输出链接)作ؓ参数传递或者返回到调用的客L?

翼渐丰 2007-07-10 20:13 发表评论
]]>
DataStage官方文档学习W记http://www.aygfsteel.com/xichengmylove/archive/2007/06/28/126727.html翼渐丰翼渐丰Thu, 28 Jun 2007 01:43:00 GMThttp://www.aygfsteel.com/xichengmylove/archive/2007/06/28/126727.htmlhttp://www.aygfsteel.com/xichengmylove/comments/126727.htmlhttp://www.aygfsteel.com/xichengmylove/archive/2007/06/28/126727.html#Feedback1http://www.aygfsteel.com/xichengmylove/comments/commentRss/126727.htmlhttp://www.aygfsteel.com/xichengmylove/services/trackbacks/126727.html通过右键dlink
鼠标右键点击起始stageQ按住右键移动鼠标到目标stage。还有一U方法就是把鼠标攑֜起始stage的边~等到变Z个小圆圈里面有一个叉的时候拖动鼠标到目标stage?br>
DataStage中默认和隐式cd转换时注意的问题
当从源向目标映射数据Ӟ如果cd不一_对于有些cd我们需要在modify或transfomer stage中通过函数q行转换Q对于有些系l会自动完成cd转换Q在cd转换q程中,注意以下几点Q?br>1 在变长到固定长度字符串的默认转换中,parallel jobs用空|ASCII 20Q字W来填充剩余长度。联pd前面做的一个parallel jobQ当目标是变长时Q当时源也是变长Q但是好像源的精度要些Q,但是字符串实际的长度没有指定的变镉K么长的话Q系l会自动用空|ASCII 20Q来填充Q具体在哪个stage填充的不知)Q而且环境变量APT_STRING_PADCHAR的默认g是空|ASCII 20Q?br>2 通过环境变量APT_STRING_PADCHAR可以改变默认的填充字WnullQASCII 0Q,同时一般还要加上trimp解决I格问题Q此问题非常普遍?br>3 有个PadString 函数可以用来用指定的字符来填充一个变长的字符串到指定的长度。这个函数的参数不能使固定长度字W串Q如果是固定长度的先转化为变ѝ?br> 
Copy Stage作ؓ占位W?/strong>
在job开发中Q当你暂时不知道该用哪个stageӞ可以使用copy stage作ؓ占位W,注意不要把Force属性设为TrueQ在不把Force设ؓTrueӞ复制在q行时进行优化?br>
使用Schema file来指定meta data
1 可以通过列定义和schema file两种方式来指定meta dataQ值得注意的一ҎNote that, if you use a schema file, you should ensure that runtime column propagation is turned on. Otherwise the column definitions specified in the stage editor will always override any schema file.卻I如果想通过schema file来指定meta dataQ必d上runtime column propagationQ否则L使用列定义来作ؓmeta data?
2 If you are using a schema file on an NLS system, the schema file needs to be in UTF-8 format.如果你的datastage使用了NLS systemQ那么schema file必须是UTF-8格式的。文档中说可以用Sequential stage来完成{码?br> 
通过Server Shared Container在Parallel Job中添加Server Job Stage
You create a new shared container in the DataStage Designer, add Server job stages as required, and then add the Server Shared Container to your Parallel job and connect it to the Parallel stages.在Designer中创Z个server shared containerQ添加需要的Server job stageQ再把server shared containerd到parallel jobq连接到其他parallel stage?br> 
几个环境变量的具体\?/span>
%SERVERENGINE% – DataStage engine account directory(normally C:\Ascential\DataStage\Engine on Windows and <dsadminhome>\Ascential\DataStage\DSEngine on UNIX).
%PROJECT% – Current project directory.
%SYSTEM% – System directory on Windows NT or /usr/lib on UNIX.

一句不太懂的话Q先做记?/span>
If NLS is enabled, avoid using the built-in Iconv and Oconv functions to map data unless you fully understand the consequences of your actions.在用了NLSӞ量避免使用Iconv and Oconv来映日期,因ؓ可能产生一些意想不到的l果?br>



翼渐丰 2007-06-28 09:43 发表评论
]]>
վ֩ģ壺 ٸ| ̰| ľ| Ӣ| | | ƽ| Ƹ| | Դ| | Ϫ| Ϫ| ¡| | | ɽ| Ĭ| | Ҧ| | Ͽ| ̳| ¦| ԭ| | | | Ӣ| ԭ| | | տ| Ľ| | | | ˮ| ߰| | |