Friday, January 30, 2015

Unix: syntax error at line 8: `<<' unmatched

Issue Description:

On running a script, getting error as -
 

/apps/user/samplescript.sh: syntax error at line 4: `<<' unmatched

Script Code - 


export param1=/app/user/bteqscripts.sh
echo $param1
bteq <<-END > /dev/null
.SET WIDTH 3000;
 .RUN FILE = $param1;
 Select date;
 .QUIT;

  END


Issue Resolution:

There were space/spaces before END and which was causing this issue.  

Normally when we connect to thirdparty command from Unix like sftp, sqlplus, bteq, etc and want to pass the commands in the script we will need to use <<-TEXT. It will execute this commands till it finds TEXT. But One needs to make sure that there no leading and trailing spaces between TEXT, tabs are allowed though.

Wednesday, October 1, 2014

Teradata useful sites

Websitet to download latest documents of teradata database - 

http://www.info.teradata.com

Home > Data warehousing > Teradata Database > Teradata Database 14.10

Monday, June 30, 2014

Life Savers - shortcuts!!

Lenevo T 430

Scroll lock - Fn+K
Other way is to use On Screen Keyboard(OSK)

Tuesday, July 23, 2013

Datastage Log Errors - Part 1

Noting down some of the Log file Errors and their Resolutions - 

Error 1 -  'osh_conductor: APT_CONFIG_FILE setting does not point to a valid filename'
Resolution - Config file is missing. Check config file path in DS admin 

Error 2 - 'operator sync table cannot be created'
Resolution - terasync table is missing in the Database which Teradata Enterprise stage is referring to.

Error 3 - 'APT_CombinedOperatorController,0: [DataDirect][ODBC DB2 Wire Protocol driver][UDB DB2 for iSeries and AS/400]UPDATE OR INSERT SPECIFIES STRING TOO LONG X1URRF.  15 30 {0}'
Resolution - Check Data type and Precision of columns

Error 4 - 'APT_CombinedOperatorController,0: [DataDirect][ODBC DB2 Wire Protocol driver][UDB DB2 for iSeries and AS/400]F5900011   in PY02DTA    not valid for operation.  3 {0}'
Resolution - User doesnot  have insert or update access on that table

Datastage Helpful Points

Just noting down some of the observations which helped me with day to day work involved with Datastage..

  • While compiling a Datastage Job, if it gives error on passive stage then check if APT_CONFIG_FILE is present.
  • Teradata API Stage uses only ANSI SQL.
  • If reading multiple files from DS Sequence file and all of them have header records, then only header record of first file will be dropped.
  • If in between closecmd execution, DB gets disconnected then it will rollback all the transactions.
  • In Enterprise stage, Replace will not create table with column type as Unicode but wil l create as Latin only.
  • In API Stage, to improve performance increase Transaction size, use parallel mode and give hash partitioning . But don't use parallel mode when there are after SQL in that stage or it is used as source stage.
  • In API Stage, if User defined SQL is used then we need to add all the columns in using clause as it doesn't recognize column by column name but by sequence order. 
    • Ex. Using A, B, C Update Table SET Col1 = :B where col2 = :C ; Here if columns from job are in order D, F, G, H, A, B then :B = F

Sunday, May 12, 2013

Shorcut for Mac OS

I am listing here all the shortcuts that can be handy for new mac users - 

Command + A - Select all the contents
Command + C - Copy the selected contents
Command + V - Paste the copied contents

Command + Shift + 3 - Screenshot of the full screen and save the image on the desktop
Command + Shift + 4 - Allows the screen to be selected for screenshot and save the image on the desktop
Command+Control+Shift+3 - Screenshot of the fullscreen and copies to clipboard
Command+Control+Shift+4 - Allows the screen to be selected for screenshot and copies the image to clipboard

Wednesday, February 1, 2012

Microsoft Office Outlook - Adding Customized fields

Many times it happens while checking the emails one of the column gets deleted and you dont know how to get it back.
Or when you have archived your sent items, Format of this folder is similar to Inbox and it becomes difficult to check whom you have sent as it has From field rather than To field.

In order to customized this setting, you can follow following simple steps

  1. Right Click on Header Field [ Anywhere near From, subject, etc]
  2. Then Select Customize current view
  3. Click on Fields
  4. Add the Field you need to view and adjust its position by Move Up or Move Down Icons.