0403-057 Syntax error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting 0403-057 Syntax error
# 1  
Old 06-25-2012
0403-057 Syntax error

I am getting the error :

Code:
rocfm/wls_subload/in/processed_files/tel_input_additional_checked_all_mandatory.txt: 0403-057 Syntax error at 
line 1 : `|' is not expected.
>>>>ALL MANDATORY FIELDS CHECKING IS SUCCESSFUL count is 0
 
rocfm/wls_subload/in/processed_files/tel_input_additional_checked_all_mandatory.txt: 0403-057 Syntax error at 
line 1 : `|' is not expected.
>>>>ALL MANDATORY FIELDS CHECKING IS SUCCESSFUL count is 0
rocfm/wls_subload/in/processed_files/tel_input_additional_checked_product_type_mandatory.txt: 0403-057 Syntax 
error at line 1 : `|' is not expected.
>>>>PRODUCT TYPE CHECKING IS SUCCESSFUL count is 0
 
error 1 : 
0403-057 Syntax error
error 2 : count =0

That files contains 4 records

The input file is as given below

Code:
vi rocfm/wls_subload/in/pro
onal_checked_product_type_mandatory.txt <
rocfm/wls_subload/in/processed_files/tel_input_additional_checked_product_type_mandatory.txt" 4 lines, 98 ch
aracters
[Press return to continue] 
7099440||A||C|1|||20091224
6043171||D||I|1|||20010601
2502467||||||||
70994421||||||||
~



script :

Code:
#!/usr/bin/ksh
# Filename: filter_subscribers_exist_only_in_tel_main.sh
# Function: to run all subscriber exist only in tel scripts
# Auther : # Location: rocfm/wls_subload/resources/step/main_scripts
#######################################
 
INPUT_GEN_PATH=rocfm/wls_subload/resources/syncsort/scripts/input_generation
tel_PATH=rocfm/wls_subload/resources/syncsort/scripts/phone_exist_tel
INPUT_FILE_PATH=rocfm/wls_subload/in
PR_FILE_PATH=rocfm/wls_subload/in/processed_files
 
echo "1. #>>>>>>REMOVING DUPLICATE SUBSCRIBERS#"
$INPUT_GEN_PATH/tel_input_remove_duplicates.sh
echo "1.finished #>>>>>>REMOVEDDUPLICATES FROM tel SUBSET# tel_input_remove_duplicates.sh"
 
echo "2. #>>>>>>CHECKING MANDATORY FIELDS IN SUBSET FILE#"
$INPUT_GEN_PATH/tel_input_check_all_mandatory.sh
echo "2. finished #>>>>>>CHECKED MANDATORY FIELDS IN tel SUBSET FILE# tel_input_check_all_mandatory.sh"
chmod 777 $PR_FILE_PATH/tel_input_checked_all_mandatory.txt
COUNT_MAND_SUBSET=`$PR_FILE_PATH/tel_input_checked_all_mandatory.txt | wc -l`
if [ $COUNT_MAND_SUBSET -gt 0 ]; then
echo ">>>>>MANDATORY FIELDS ARE NOT HAVING VALUES OR INVALID VALUES count is $COUNT_MAND_SUBSET"
else 
echo ">>>>ALL MANDATORY FIELDS CHECKING SUCCESSFUL count is $COUNT_MAND_SUBSET" 
fi
echo "3. #>>>>>>FILTERING ACTIVE AND SUSPENDED SUBSCRIBERS IN SUBSET FILE#"
$INPUT_GEN_PATH/tel_input_act_and_susp_phones.sh
echo "3. finished #>>>>FILTERED ACTIVE AND SUSPENDED SUSBCRIBERS FROM SUBSET# tel_input_act_and_susp_phones.sh"
echo "4. #>>>>>>FILTERING CANCELLED SUBSCRIBERS IN SUBSET FILE#"
$INPUT_GEN_PATH/tel_input_cancelled_phones.sh
echo "4. finished #>>>>>>FILTERED CANCELLED SUBSCRIBERS FROM SUBSET# tel_input_cancelled_phones.sh"
echo "5. #>>>>>>REMOVING DUPLICATE SUBSCRIBERS FROM FULL SET FILE#"
$INPUT_GEN_PATH/tel_input_additional_remove_duplicates.sh
echo "5. finished #>>>>>>REMOVED DUPLICATES FROM FULL SET# "
 
echo "6. #>>>>>>REMOVING EMPTY SUBSCRIBERS IN FULL SET FILE#"
$INPUT_GEN_PATH/tel_input_additional_remove_empty.sh
echo "6. finished #REMOVED EMPTY SUBSCRIBERS IN FULL SET# tel_input_additional_check_all_mandatory.sh"
 
echo "7. #>>>>>>CHECKING ALL MANDATORY FIELDS IN FULL SET FILE#"
$INPUT_GEN_PATH/tel_input_additional_check_all_mandatory.sh
echo "7. finished #>>>>CHECKED ALL MANDATORY FIELDS IN FULL SET# tel_input_additional_check_all_mandatory.sh"
echo "8. #>>>>>>CHECKING PRODUCT TYPE FIELDS IN FULL SET FILE#"
$INPUT_GEN_PATH/tel_input_additional_check_product_type_mandatory.sh
echo "8. finished #>>>>CHECKED MANDATORY PRODUCT TYPE ADDITIONAL FIELDS IN FULL SET# tel_input_additional_check_product_type_mandatory.sh"
chmod 777 $PR_FILE_PATH/tel_input_additional_checked_all_mandatory.txt
COUNT_MAND_FULLSET=`$PR_FILE_PATH/tel_input_additional_checked_all_mandatory.txt|wc -l`
if [ $COUNT_MAND_FULLSET -gt 0 ]; then
echo ">>>>>MANDATORY FIELDS ARE NOT HAVING VALUES count is $COUNT_MAND_FULLSET"
else 
echo ">>>>ALL MANDATORY FIELDS CHECKING IS SUCCESSFUL count is $COUNT_MAND_FULLSET" 
fi
chmod 777 $PR_FILE_PATH/tel_input_additional_checked_product_type_mandatory.txt
COUNT_MAND_PRTYPE=`$PR_FILE_PATH/tel_input_additional_checked_product_type_mandatory.txt | wc -l`
if [ $COUNT_MAND_PRTYPE -gt 0 ]; then
echo ">>>>>PRODUCT TYPE IS HAVING INVALID VALUE count is $COUNT_MAND_PRTYPE"
else 
echo ">>>>PRODUCT TYPE CHECKING IS SUCCESSFUL count is $COUNT_MAND_PRTYPE" 
fi
echo "9. #>>>>>>FILTERING ACTIVE AND SUSPENDED SUBSCRIBERS FROM FULL SET FILE#"
$INPUT_GEN_PATH/tel_input_additional_act_susp_phones.sh
echo "9. finished #>>>>>SELECTED ACTIVE AND SUSPENDED RECORDS FROM ADDITIONAL# tel_input_additional_act_susp_phones.sh"
 
echo "################## finished input file generation for tel from RCODS#################"
 
 
echo "10. #>>>>>>REMOVING DUPLICATE SUBSCRIBERS FROM ROCFM FILE#"
$INPUT_GEN_PATH/rocfm_input_remove_duplicates.sh
echo "10. finished #REMOVED DUPLICATES FROM ROCFM# rocfm_input_remove_duplicates.sh"
echo "11. #>>>>>>FILTERING ACTIVE AND SUSPENDED SUBSCRIBERS FROM ROCFM FILE#"
$INPUT_GEN_PATH/rocfm_input_act_and_susp_phones.sh
echo "11. finished #FILTERED ACTIVE AND SUSPENDED SUSBCRIBERS IN ROCFM# rocfm_input_act_and_susp_phones.sh"
echo "12. #>>>>>>FILTERING CANCELLED SUBSCRIBERS FROM ROCFM FILE#"
$INPUT_GEN_PATH/rocfm_input_cancelled_phones.sh
echo "12. finished #FILTERED CANCELLED SUBCRIBERS FROM ROCFM# rocfm_input_cancelled_phones.sh"
echo "################## finished input file generation for ROCFM from NIKKIRA DB#################"
 
 
echo "################## finished input file generation #################"
 
echo "13. #>>>>>>FILTERING SUBSCRIBERS THAT EXIST ONLY IN tel -RCODS DB ,NOT IN NIKKIRA/ROCFM#"
$tel_PATH/phones_only_in_tel_filter.sh
echo "13. finished #FILTERED SUBSCRIBERS THAT EXIST ONLY IN tel# phone_only_tel_filter.sh"
echo "14. #>>>>>>REMOVING DUPLICATE SUBSCRIBERS AFTER FILTERING#"
$tel_PATH/phones_only_tel_remove_duplicates.sh
echo "14. finished #REMOVED DUPLICATES AFTER FILTER SUSBCRIBERS# phones_only_tel_remove_duplicates.sh"
echo "15. #>>>>>>ADDING ADDITIONAL 43 FIELDS TO SUBSET FILE#"
$tel_PATH/phones_only_in_tel_add_additionals.sh
echo "15. finished #ADDED ADDITIONAL FIELDS TO FINAL FILE# phones_only_in_tel_additionals.sh"
 
 
echo "################## finished SUBSCRIBERS EXIST ONLY IN tel , YOU CAN FIND FINAL PRODUCT IN rocfm/wls_subload/out/phones_exist_only_in_tel_fullset_final.txt#################"
 
#exit $?

can you please help me

Thanks

Last edited by Corona688; 09-14-2012 at 12:52 PM..
# 2  
Old 06-25-2012
This code is trying to execute your date file:
Code:
COUNT_MAND_FULLSET=`$PR_FILE_PATH/tel_input_additional_checked_all_mandatory.txt|wc -l`

Change it to this:
Code:
COUNT_MAND_FULLSET=`wc -l $PR_FILE_PATH/tel_input_additional_checked_all_mandatory.txt`

# 3  
Old 09-13-2012
FILE_ID EXTRACTION FROM FILE NAME AND SAVE IT IN CSV FILE AFTER LOOPING THROUGH EACH FOLDERS

My files are located in UNIX Server, i want to extract file_id and file_name from each file .and save it in a CSV file. How do I do that?
I have folders in unix environment, directory structure is structured as follows
year folder -> inside 12 months folders -> inside 30/31 days folders

I ran ls command folder
year as follows
2009 2010 2011 2012
I ran cd command for year 2012
Code:
$ cd 2012

I ran ls command for 2012 year folder
Code:
$ ls 
01 02 03 04 05 06 07 08 09

then I ran command for september
Code:
$ cd 09 
$ ls 
01 02 03 04 05 06 07 08 09 10 11 12 13 
$ cd 13 
$ ls 
sasmm_fsbc_durds_id00020532_t20100313192606.dat.trnsfr.gz 
sasmm_fsbc_durds_id00020513_t20120913003312.dat.trnsfr.gz

there are folders for each year like 2009,2010,2011 and 2012
and folder has 12 folders for each months like 01,02,03,04,05,06,07,08,09,10,11,12
and each month folder has 31 folders for days like 1,2,3, etc... 29,30,31

inside each day folder has files..
the file name is as follows,
Code:
sasmm_fsbc_durds_id00020532_t20100313192606.dat.trnsfr.gz 
sasmm_fsbc_durds_id00020513_t20120913003312.dat.trnsfr.gz

I want to have one csv file and that file needs to have two columns , one is for file_id and
second field is for file name.
to obtain file_id value ,loop through each folders and get file name, then read file name and
get substring between "sasmm_fsbc_durds_id000" and _t and store it in file_id column and store
file name in file_name column.

in above example for file sasmm_fsbc_durds_id00020532_t20100313192606.dat.trnsfr.gz
read file name sasmm_fsbc_durds_id00020532_t20100313192606.dat.trnsfr.gz
cut 20532 and save it in a file_id clumn and the whole file name in second column = sasmm_fsbc_durds_id00020532_t20100313192606.dat

CSV file will look like

Code:
file_id           file_name 
20532           sasmm_fsbc_durds_id00020532_t20100313192606.dat 
20513           sasmm_fsbc_durds_id00020513_t20120913003312.dat

file_id is to be cut from the file name , if you look at the file name closely, you can see;
after 000 , file_ids in above file name examples , they are 20532 and 20513.

How do I loop through year 2012 and 12 months folders and 31 days folders inside it and create
csv file which has data as shown above?
I am very new unix, please help me out.. If you provide a code , that would be great..
thanks..


output CSV file look like this

Code:
file_id           file_name 
20532           sasmm_fsbc_durds_id00020532_t20100313192606.dat 
20513           sasmm_fsbc_durds_id00020513_t20120913003312.dat


Last edited by Corona688; 09-14-2012 at 12:53 PM..
# 4  
Old 09-14-2012
To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)



Selective use of color to highlight a single word or phrase can be useful at times, but large blocks of color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

0403-057 Syntax error at line 399 : `"' is not matched

Hi Everyone, I am getting strange behavior, same script runs fine without any error in one AIX machine, whereas on another it is throwing this error "0403-057 Syntax error at line 399 : `"' is not matched", I also ran the script in debug mode. This is the output, still doesn't say anything.... (2 Replies)
Discussion started by: sid1987
2 Replies

2. Shell Programming and Scripting

0403-057 Syntax error at line 17 : `(' is not expected.

Hi, While executing my code i am getting below Error: ./check_disk1: 0403-057 Syntax error at line 55 : `(' is not expected. My code is : #!/bin/ksh PROGNAME=`basename $0` STATE_OK=0 STATE_WARNING=1 STATE_CRITICAL=2 STATE_UNKNOWN=3 OS=$(uname) AWK="/usr/bin/awk"... (6 Replies)
Discussion started by: abodage
6 Replies

3. Shell Programming and Scripting

[Solved] 0403-057 Syntax error for if statement

I am getting the following error when I am running a script in ksh when trying to execute an if statement comparing two numerical values tstmb.sh: 1.5321e+08: 0403-057 Syntax error Below is my code snippet. #!/bin/ksh set -x TODAY=$(date +%y%m%d) for file in $(ls -rt *.log | tail... (11 Replies)
Discussion started by: kiran1112
11 Replies

4. AIX

0403-057 Syntax error at line 17 : `(' is not expected.

Hi, I am new to shell scripting.i am trying to mail after my backup completed. Here is my shell script: if ; then egrep (ERROR|error|Error|RMAN-) ${/backup/RMANBKUP/spool/shelltest.log} > /dev/null if ; then RESULT_MSG=WARNING: Errors occurred during the ${ORACLE_SID} Rman... (3 Replies)
Discussion started by: faruqms
3 Replies

5. Shell Programming and Scripting

0403-057 Syntax error at line : `}' is not expected.

i dont know where m i mistaking.. please help me out with this issue :( thanks in advance:rolleyes: one_main() { a=100 while ; do clear echo "##############################################" echo ":: CURRENTLY YOU ARE IN RC AND OC MARKING ::" echo... (1 Reply)
Discussion started by: Puneet sinha
1 Replies

6. Shell Programming and Scripting

0403-057 Syntax error at line 169 : `"' is not matched.

Hi, I am getting this error in my attached shell script, kindly help as soon as possible: Thanks, Andre (2 Replies)
Discussion started by: damoon
2 Replies

7. Shell Programming and Scripting

[Solved] 0403-057 Syntax error `<' is not matched

curr_time=`date +%Y%m%d%H%M` curr_date=`date +%Y%m%d` zero=0 script_path="/home/wccuser1/wcc/Scripts/bulk_file_ftp" file_dir="/home/wccuser1/wcc/Bulk_Files" todays_file_count=`ls -ltr | grep $curr_date | awk '{print $9}' | wc -l` todays_file=`ls -ltr | grep $curr_date | awk '{print $9}'` if... (5 Replies)
Discussion started by: gagandeep
5 Replies

8. Shell Programming and Scripting

ksh: 0403-057 Syntax error: `done' is not expected.

Hi I am getting error 'ksh: 0403-057 Syntax error: `done' is not expected.' when running below script any one can provide inputs on this. ------------------------ if then echo "Report Name |Modification Date|Report File Size|Owner" >SOX_`date +'%Y%m%d'` while read line do... (2 Replies)
Discussion started by: karnatis
2 Replies

9. Shell Programming and Scripting

0403-057 Syntax error at line 52 : `)' is not expected.

Can someone please tell me wht is wrong with the following peice of code? I keep getting the following error - 0403-057 Syntax error at line 52 : `)' is not expected. case "${option_count}" in 1) java -Xms256m -Xmx1536m "${APPLNAME}" "${ACTION_TYPE}" > "${LOGFILE}" 2>... (2 Replies)
Discussion started by: Veenak15
2 Replies

10. UNIX for Dummies Questions & Answers

0403-057 Syntax error at line 70. pls help

Hi All, I got a script from one of the unix forums for reporting on filesystem usage and wanted to use it but it keeps giving me the following error. 0403-057 Syntax error at line 70 The script is shown below. Pls help as I am new to UNIX. # set -x # D I S K S P A C E . S H # #... (2 Replies)
Discussion started by: OMONI
2 Replies
Login or Register to Ask a Question