Sponsored Content
Full Discussion: processing db2 output
Top Forums Shell Programming and Scripting processing db2 output Post 302412369 by valero on Monday 12th of April 2010 10:37:21 PM
Old 04-12-2010
thanks!

Thanks a lot durden_tyler!! I don't have a clue how your command works, I should pick up a Perl basics book then Smilie

---------- Post updated at 09:37 PM ---------- Previous update was at 09:35 AM ----------

I would like to re-organize the above db2 output to columns-values format:
Code:
Database alias,Database name,Local database directory,Node name,Database release level,Comment,Directory entry type,Authentication,Catalog database partition number,Alternate server hostname,Alternate server port number
DB1,DB1,,ND1,a.00,,Remote,,-1,,,
DB2,DB2,,ND2,a.00,,Remote,SERVER,-1,,,
DB3,DB3,,ND3,a.00,,Remote,,-1,,,
DB4,DB4,/home/db4,,a.00,,Indirect,,0,,,
DB5,DB5,/home/db5,,a.00,,Indirect,,0,,,

again, I am using "cut-paste-grep-temp files" to get the desired structure...how to do this re-organize in perl...Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

flags to suppress column output, # of rows selected in db2 sql in UNIX

Hello, I am new to db2 SQL in unix so bear with me while I try to explain the situation. I have a text file that has the contents of the where condition that I am using for a db2 SQL in UNIX ksh. Here is the snippet. if ; then echo "Begin processing VALUEs" ... (1 Reply)
Discussion started by: jerardfjay
1 Replies

2. Shell Programming and Scripting

Run SQL queries in DB2 and output to file

Hi, I new to Unix and scripting. Following is my requirement. Can someone tell me whether its possible or not. Also please let me know how to proceed further if this is possible. List of queries are stored in a file. For example, I have to run a query like this: Select * from &XYZ where... (0 Replies)
Discussion started by: simhasuri
0 Replies

3. Shell Programming and Scripting

running db2 sql and exporting output from ksh scipt

Hi there, I am trying to write a shell script as root on AIX 5.3 where I change user to db2inst1, connect to our db2 database, run a sql select query and export the result of the query to a file. The code I have so far is as follows:- #!/usr/bin/ksh su - db2inst1 -c "db2 connect to... (0 Replies)
Discussion started by: candlino
0 Replies

4. UNIX for Dummies Questions & Answers

Exception while loading DB2 driver Class.forName("com.ibm.db2.jcc.DB2Driver")

Hi... I m working on UNIX z/OS. Actually i have to pass the parameters from the JCL to java-db2 program thru PARM. I am able to pass the arguments but the problem occured is, it is throwing an exception while loading the db2 driver as 'Javaclassnotfound:com.ibm.db2.jcc.DB2Driver'... (0 Replies)
Discussion started by: Sujatha Gowda
0 Replies

5. IP Networking

processing tcpflow output

I'm using tcpflow to analyze traffic traces. When I launch tcpflow with -r option it creates some files, one for each flow. The problem is that some of these files are not readable. I tryed to process them with awk, but also using it i cannot visualize them correctly. Can anyone suggest me a... (5 Replies)
Discussion started by: littleboyblu
5 Replies

6. Shell Programming and Scripting

Need Fix in Exporting a db2 query output

When I use export for sql query in a Script : Select '1',ModHist',count(*) from cc.mdhist; it was exporting the record to a file as: "1" "ModHist" 778201 Here 1 & ModHist are coming in Doublequotes. If I run the above query directly in Unix prompt it was displaying the output as... (1 Reply)
Discussion started by: karumudi7
1 Replies

7. Shell Programming and Scripting

processing the output of AWK

Hi my input file is <so > < Time > <Pid> <some ro><Job Name> 111004 04554447 26817 JOB03275 MBPDVLOI 111004 04554473 26817 JOB03275 MBPDVLOI 111004 04554778 26807 JOB03276 MBPDVAWD 111004 04554779 26807 JOB03276 MBPDVAWD 111004 04554780 26817 ... (4 Replies)
Discussion started by: rakeshkumar
4 Replies

8. Shell Programming and Scripting

Printing the output of a db2 query on to an unix file

I want to print the output of a db2 query, on to an unix file in a manner that the columns are separated by 'commas'. Please help me out..thanx in advance (1 Reply)
Discussion started by: prasan_ven
1 Replies

9. UNIX for Dummies Questions & Answers

Take output of processing in text file

Hi ALL, I am presently using perl script mukesh.pl I just want to catch its output into another text file . So I am using > File.txt . I am getting output but i want the whole processing of the script into that file please let me know . Thanks in advance Cheers Mukesh (1 Reply)
Discussion started by: mumakhij
1 Replies

10. Shell Programming and Scripting

Processing diff output

How to get diff to not print the chevrons and the dashes? In this case the differences are all single line differences. Also the first few lines don't matter. How to get the output to always exclude the first few lines? Thanks! (1 Reply)
Discussion started by: stevensw
1 Replies
FS_LISTCELLS(1) 					       AFS Command Reference						   FS_LISTCELLS(1)

NAME
fs_listcells - Displays the database server machines known to the Cache Manager SYNOPSIS
fs listcells [-numeric] [-help] fs listc [-n] [-h] DESCRIPTION
The fs listcells command formats and displays the list of the database server machines that the Cache Manager stores in kernel memory for its home cell and foreign cells. At each reboot of the client machine, the Cache Manager copies the contents of /etc/openafs/CellServDB into kernel memory. To modify the list between reboots, use the fs newcell command. OPTIONS
-numeric Displays each database server machine's IP address rather than hostname. -help Prints the online help for this command. All other valid options are ignored. OUTPUT
The output includes a line for each cell included in the Cache Manager's kernel memory list, in the following format: Cell <cell> on hosts <database server machines> The Cache Manager stores IP addresses, but by default has them translated to hostnames before reporting them, by passing them to the cell's name service (such as the Domain Name Service or a local host table). The name service sometimes returns hostnames in uppercase letters, or an IP address if it cannot resolve a name. Using the -numeric flag bypasses the translation to hostnames, which can result in significantly faster production of output. The output includes IP addresses only. EXAMPLES
The following example shows output for several cells as illustrations of the different formats for machine names: % fs listcells Cell abc.com on hosts fs1.abc.com fs2.abc.com fs3.abc.com Cell stateu.edu on hosts DB1.FS.STATEU.EDU DB2.FS.STATEU.EDU DB3.FS.STATEU.EDU Cell def.gov on hosts 138.255.0.2 sv3.def.gov PRIVILEGE REQUIRED
None SEE ALSO
CellServDB(5), fs_newcell(1) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 FS_LISTCELLS(1)
All times are GMT -4. The time now is 01:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy