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
INVOKE-RC.D(8)                                                   Debian GNU/Linux                                                   INVOKE-RC.D(8)

NAME
invoke-rc.d - install and remove System-V style init script links SYNOPSIS
update-rc.d [-f] name remove update-rc.d name defaults update-rc.d name defaults-disabled update-rc.d name disable|enable [ S|2|3|4|5 ] DESCRIPTION
update-rc.d updates the System V style init script links /etc/rcrunlevel.d/NNname whose target is the script /etc/init.d/name. These links are run by init when it changes runlevels; they are generally used to start and stop system services such as daemons. runlevel is one of the runlevels supported by init, namely, 0123456789S, and NN is the two-digit sequence number that determines where in the sequence init will run the scripts. This manpage documents only the usage and behaviour of update-rc.d. For a discussion of the System V style init script arrangements please see init(8) and the Debian Policy Manual. INSTALLING INIT SCRIPT LINKS
update-rc.d requires dependency and runlevel information to be provided in the init.d script LSB comment header of all init.d scripts. See the insserv(8) manual page for details about the LSB header format. When run with the defaults option, update-rc.d makes links named /etc/rcrunlevel.d/[SK]NNname that point to the script /etc/init.d/name, using runlevel and dependency information from the init.d script LSB comment header. When run with the defaults-disabled option, update-rc.d makes links named /etc/rcrunlevel.d/KNNname that point to the script /etc/init.d/name, using dependency information from the init.d script LSB comment header. This means that the init.d script will be dis- abled (see below). If any files named /etc/rcrunlevel.d/[SK]??name already exist then update-rc.d does nothing. The program was written this way so that it will never change an existing configuration, which may have been customized by the system administrator. The program will only install links if none are present, i.e., if it appears that the service has never been installed before. Older versions of update-rc.d also supported start and stop options. These options are no longer supported, and are now equivalent to the defaults option. A common system administration error is to delete the links with the thought that this will "disable" the service, i.e., that this will prevent the service from being started. However, if all links have been deleted then the next time the package is upgraded, the package's postinst script will run update-rc.d again and this will reinstall links at their factory default locations. The correct way to disable services is to configure the service as stopped in all runlevels in which it is started by default. In the System V init system this means renaming the service's symbolic links from S to K. The script /etc/init.d/name must exist before update-rc.d is run to create the links. REMOVING SCRIPTS
When invoked with the remove option, update-rc.d removes any links in the /etc/rcrunlevel.d directories to the script /etc/init.d/name. The script must have been deleted already. If the script is still present then update-rc.d aborts with an error message. update-rc.d is usually called from a package's post-removal script when that script is given the purge argument. Any files in the /etc/rcrunlevel.d directories that are not symbolic links to the script /etc/init.d/name will be left untouched. DISABLING INIT SCRIPT START LINKS
When run with the disable [ S|2|3|4|5 ] options, update-rc.d modifies existing runlevel links for the script /etc/init.d/name by renaming start links to stop links with a sequence number equal to the difference of 100 minus the original sequence number. When run with the enable [ S|2|3|4|5 ] options, update-rc.d modifies existing runlevel links for the script /etc/init.d/name by renaming stop links to start links with a sequence number equal to the positive difference of current sequence number minus 100, thus returning to the original sequence number that the script had been installed with before disabling it. Both of these options only operate on start runlevel links of S, 2, 3, 4 or 5. If no start runlevel is specified after the disable or enable keywords, the script will attempt to modify links in all start runlevels. OPTIONS
-f Force removal of symlinks even if /etc/init.d/name still exists. EXAMPLES
Insert links using the defaults: update-rc.d foobar defaults The equivalent dependency header would have start and stop dependencies on $remote_fs and $syslog, and start in runlevels 2-5 and stop in runlevels 0, 1 and 6. Remove all links for a script (assuming foobar has been deleted already): update-rc.d foobar remove Example of disabling a service: update-rc.d foobar disable Example of a command for installing a system initialization-and-shutdown script: update-rc.d foobar defaults Example of a command for disabling a system initialization-and-shutdown script: update-rc.d foobar disable BUGS
See http://bugs.debian.org/sysv-rc. FILES
/etc/init.d/ The directory containing the actual init scripts. /etc/rc?.d/ The directories containing the links used by init and managed by update-rc.d . /etc/init.d/skeleton Model for use by writers of init.d scripts. SEE ALSO
Debian Policy Manual, /etc/init.d/skeleton, insserv(8), sysv-rc-conf(8), bum(8), init(8) AUTHOR
Ian Jackson, Miquel van Smoorenburg Licence: GNU Public Licence v2 or Later (GPLv2+) COPYRIGHT
2001 Hernique Holschuh 14 November 2005 INVOKE-RC.D(8)