Read a input file and insert it to UDB sequentially


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Read a input file and insert it to UDB sequentially
# 1  
Old 01-26-2011
Data Read a input file and insert it to UDB sequentially

Guys,

I'm very new to Unix script. I need to add some logics into the existing script.

Read a record
1) if it's a header record then verify the file sequence no aginst the file sequence no in UDB control table.
2) if Step 1 is ok then CONNECT UDB otherwise stop or abend.
3) if it's a detail record then insert it into UDB.
4) if it's trailer record then verify the total record (include header and trailer record ) = the count of trailer record otherwise stop or abend
End read

Increase 1 to sequence no in UDB control table.
Disconnect UDB..

I used to code it in SAS or cobol in one hour. Your input is much appreciated..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script does not read input file

Hi everyone, I have problems with this script. This script should check for a folder for each server in the list of the list.txt file. The script only checks the first host, and then exits, why? #!/bin/bash file='/etc/list.txt' while read line; do echo $line if ssh root@$line "stat /var >... (2 Replies)
Discussion started by: nashrik
2 Replies

2. Shell Programming and Scripting

Use while loop to read file and use ${file} for both filename input into awk and as string to print

I have files named with different prefixes. From each I want to extract the first line containing a specific string, and then print that line along with the prefix. I've tried to do this with a while loop, but instead of printing the prefix I print the first line of the file twice. Files:... (3 Replies)
Discussion started by: pathunkathunk
3 Replies

3. Shell Programming and Scripting

Read input files and merge them in given order and write them to input one param or one file

Dear Friends, I am looking for a shell script to merge input files into one file .. here is my idea: 1st paramter would be outfile file (all input files content) read all input files and merge them to input param 1 ex: if I pass 6 file names to the script then 1st file name as output file... (4 Replies)
Discussion started by: hyd1234
4 Replies

4. Shell Programming and Scripting

[Solved] awk command to read sequentially from a file until last record

Hello, I have a file that looks like this: Generated geometry (...some special descriptor) 1 0.56784 1.45783 -0.87965 8 1.29873 -0.8767 1.098789 ... ... ... ... Generated geometry (....come special descriptor) ... .... ... ... ... ... ... ... and... (4 Replies)
Discussion started by: jaldo0805
4 Replies

5. Shell Programming and Scripting

Read text file and use it as input

I need to take a text file that holds a bunch of data and run each the stuff in it as an input for the program. the file would hold stuff like this: thing1.awesomesite.com 80 123.456 thing2.awesomesite.com 80 789.098 thing3.awesomesite.com 80 765.432 ... Now I already know the... (1 Reply)
Discussion started by: shade917
1 Replies

6. Shell Programming and Scripting

Need a script that will read from 2 input file

Hi Everyone. I am new in this scripting world. I need to know about script that I can use on linux/sun operating systems. I have 2 input file. File 1: Its has an header information and then data in 2 different columns. File 2 : It has data in 9 different columns/ I need an script that... (3 Replies)
Discussion started by: syahmed
3 Replies

7. Shell Programming and Scripting

To Read a File and Insert a part of the lines into the database

Hi Guys I need to have a shell script which reads a log file and insert a part of each line into the database. Some sample lines in the file are as below. 20091112091359 MED_RQACK : user_data=60173054304,100232120,20091112091359,;ask_status=0;ask_reason=OK;msg_id=20091112091319... (5 Replies)
Discussion started by: Somanadh
5 Replies

8. Shell Programming and Scripting

hw to insert array values sequentially in a file

Hi All :), I am very new to unix. I am requiring ur help in developing shell script for below problem. I have to replace the second field of file with values of array sequentially where first field is ValidateKeepVar <File> UT-ExtractField 1 | &LogEntry &Keep(DatatoValidate)... (3 Replies)
Discussion started by: rohiiit.sharma
3 Replies

9. UNIX for Dummies Questions & Answers

read input file

echo "enter employee #:/c" read employee grep -w $employee /tmp/file.txt when it asked me employee #, i typed employee, worked fine. when it asked me employee #, i type ENTER, it just sit there. if someone type in NULL or ENTER key, i want to exit out. (2 Replies)
Discussion started by: tjmannonline
2 Replies

10. Shell Programming and Scripting

How to insert a string at the end of a file read

Hi, This thread is an extension of the post I posted in another folder for Unix Dummies. I am actually trying to read all the files in a folder, let say folder A. There are alot of .txt files in this folder where I have sed them and translate to numeric elements. For example:- I have... (5 Replies)
Discussion started by: ahjiefreak
5 Replies
Login or Register to Ask a Question
vboxtcl(5)						    Linux System Administration 						vboxtcl(5)

NAME
vboxtcl - tcl commands for vboxgetty CONTENT
With vbox version 2.0, tcl can be used as a script language to act on incoming calls. Incoming calls are still taken by vboxgetty, but further actions are made by the tcl script. VARIABLES
These are additional variables supplied by vboxgetty. vbox_var_bindir directory with vbox commands. vbox_var_savename name for this message to save. The name is constructed from time and process id. It's a good idea to use this name, but you can also use a different name. vbox_var_rectime maximum seconds to record. vbox_var_spooldir path of the users spool directory (/var/spool/vbox/<user>). vbox_var_checknew path for new files (/var/spool/vbox/<user>/incoming). vbox_msg_standard filename with full path of the message to play as the standard message (/var/spool/vbox/<user>/messages/standard.msg). vbox_msg_beep filename with full path of the message to play as beep (/var/spool/vbox/<user>/messages/beep.msg). vbox_msg_timeout filename with full path of the message to play after a timeout (/var/spool/vbox/<user>/messages/timeout.msg). vbox_caller_id CALLERID of current caller. If unknown, this is "0". vbox_caller_phone full phone number of current caller. If unknown, this is "*** Unknown ***". vbox_caller_name name of current caller. If unknown, this is "*** Unknown ***". vbox_user_name name of the user that runs this vboxgetty. vbox_user_home home directory of the user that runs this vboxgetty. vbox_flag_standard this is TRUE if the script should play the standard message, and FALSE if the script should not. vbox_flag_beep this is TRUE if the script should play the beep message, and FALSE if the script should not. vbox_flag_timeout this is TRUE if the script should play the timeout message, and FALSE if the script should not. vbox_flag_record this is TRUE if the script should record a message, and FALSE if the script should not. FUNCTIONS
vboxgetty also provides some additional functions to the user. Return Codes Most functions will use these return codes: ERROR An error occurred. HANGUP The connection was ended. Script should end now. OK The whole message was played, nothing occurred. Any other error code is a touchtone sequence, that was detected during playing the message. vbox_breaklist <add|rem> <sequence> [...] With this command you can control which touchtone sequences vboxgetty will recognize. Touchtone sequences have the format *NUMBER#, where NUMBER is a sequence of the characters 0-9 and A-D. Even single numbers must be given in the format *NUMBER#. Vboxgetty detects if the caller gives a number as a single digit or as a part of a sequence. add <sequence> [...] Add a touchtone sequence to breaklist. You can add up to 8 sequences at one time. rem <sequence> [...] Remove a touchtone sequence from breaklist. You can remove up to 8 sequences at one time. You can use all to remove all sequences. vbox_put_message <message> Play a message and returns an error code depending on the reason to stop playing. Default return codes. message full name of the message file (with path). vbox_get_message <savename> <timelimit> Records a message. Default return codes. Options are: savename full name of the file for saving the message. timelimit maximum time to record the message. vbox_wait <seconds> Waits for several seconds for an input from caller. Default return codes. Options are: seconds time to wait. vbox_init_touchtones Clears vboxgetty touchtone sequence. Normal way is to append all new touchtones to the sequence, the sequence is only cleared when a "*" touchtone is received. vbox_pause <ms> waits a specific number of milliseconds. ms number of milliseconds to wait. vbox_get_nr_new_messages <messagebox> Return the number of new messages in the directory. messagebox the directory to scan vbox_get_nr_all_messages <messagebox> Return the number of messages in the directory. messagebox the directory to scan SEE ALSO
Look at the tcl documentation for any tcl specific questions. For vbox : vboxgetty(8), vboxgetty.conf(5), vbox.conf(5) AUTHOR
This manual page was written by Andreas Jellinghaus <aj@dungeon.inka.de>, for Debian GNU/Linux and isdn4linux. ISDN 4 Linux 3.25 2000/09/15 vboxtcl(5)