Page 2 of 4
Posted: Tue Jul 29, 2008 12:45 pm
by mystuff
when I do the list.. even the column names (not all) are split (comes half in one line half in other )
I have used GET.TERM.TYPE and saw that the width is changing from 80 to 132.
But the following are still occuring
a) HashFile1 : split of fields - fields coming in on more than one line
Code: Select all
Natural_Key Warehouse. date1..... date2.....
30110 DWH 2003-08-06 2003-10-10
15:53:20 00:00:00
b) HashFile2 : each field in different row
Code: Select all
Field1. -4927275313
Field2. Not Applicable
Field3. 2008-05-06 09:06:40
Field4. Test1
Field5. 0
Field1. -4829300379
Field2. Not Applicable
Field3. 2008-03-25 07:38:49
Field4. Test2
Field5. 0
Field1. -4813747248
Field2. Not Applicable
Field3. 2008-03-17 10:51:17
Field4. Test3
Field5. 0
Field1. -4702305701
Field2. Not Applicable
Field3. 2008-01-30 13:14:42
Field4. Test4
Field5. 0
Posted: Tue Jul 29, 2008 6:40 pm
by mystuff
Hi all,
Any ideas... I have been reading here and there, but no luck with it.
Thanks
Posted: Tue Jul 29, 2008 7:01 pm
by chulett
No, not really. Why not just do this in a Server job and be done with it?
Posted: Tue Jul 29, 2008 7:38 pm
by mystuff
Code: Select all
No, not really. Why not just do this in a Server job and be done with it?
I have to do this on unix. As its not limited to just one hashed file. It has to be generic script. Which will be called by passing arguments
Posted: Tue Jul 29, 2008 11:21 pm
by ray.wurlod
The "each field on different line", or "vertical format", happens automatically when there are two many fields to fit in the current device width (e.g. 80 or 132).
The "splitting onto multiple lines", or "wrap", occurs because the data are too wide for the field width defined in the file dictionary. Show us the file dictionary listing. Or perhaps because the data themselves contain line feeds or dynamic array delimiters.
Posted: Wed Jul 30, 2008 8:44 am
by mystuff
The data doesn't have new line characters. I have checked it.
Posted: Thu Jul 31, 2008 9:55 am
by mystuff
I made some study and found that we can change the width of all fields to a predetermined value by using
But even when I do that still the truncation/folding occurs [There is no other option allowed ie. to allow for continous display of the row]
Right now I see that the select query is able to display only 70 characters (approx). It doesn't matter increasing the width as it anyway gets folded due to the limit on the display.
Is there a way that I could set this width to maximum? or FORCE for no truncation/folding by any other means
I would be glad if someone could guide me on this. I have been battering here and there for long time
![Crying or Very sad :cry:](./images/smilies/icon_cry.gif)
Posted: Thu Jul 31, 2008 11:13 am
by ArndW
If you were to use a "LIST" instead of a "SELECT" the previous advice would have helped and you would get more assistance on any other errors. What does "LIST HashOther" or "LIST DICT HashOther" produce?
Posted: Thu Jul 31, 2008 12:08 pm
by mystuff
ArndW wrote:If you were to use a "LIST" instead of a "SELECT" the previous advice would have helped and you would get more assistance on any other errors. What does "LIST HashOther" or "LIST DICT HashOther" produce?
I had both LIST and SELECT above... I am repeating them again over here...
I did try to increase the width, but looks like issue is that the terminal is only able to display approx 75 characters.
Will
PTERM or
UVOUT help by any means. I am looking into it. But not sure if I could find any.
Posted: Thu Jul 31, 2008 10:06 pm
by mystuff
Any tips that I could hunt on?
Posted: Thu Jul 31, 2008 10:13 pm
by ray.wurlod
The total of field widths plus separator space must be less than your device width. Five at 40 equals 200, which is way too many, so you get vertical format. Try this:
Code: Select all
SELECT Field1 FMT '12R', Field2 FMT '15L', Field3 FMT '20R', Field4 FMT '10L', Field5 FMT '10R' FROM HashOther;
In this query the total of field widths is less than 80, so should come out in horizontal format, one record per line. Please post the result of this query.
Posted: Fri Aug 01, 2008 11:34 am
by mystuff
This is the output resulting from the sql query.
Code: Select all
Field1...... Field2......... Field3.............. Field4.... Field5....
-4927275313 Not Applicable 2008-05-06 09:06:40 Test1 0
-4829300379 Not Applicable 2008-03-25 07:38:49 Test2 0
-4813747248 Not Applicable 2008-03-17 10:51:17 Test3 0
-4702305701 Not Applicable 2008-01-30 13:14:42 Test4 0
-4697551951 Not Applicable 2008-01-28 11:59:47 Test5 0
-4672229048 Not Applicable 2008-01-16 06:56:35 Test6 0
-4662878666 Not Applicable 2008-01-11 08:34:17 Test7 0
-4662809597 Not Applicable 2008-01-11 08:07:52 Test8 - ab 0
cdefghijkl
mnopqrstuv
Thanks for the feedback. Over here as you see here is the 8th records gets split although in List Dict its defined as 40 chars(obviously).
As I want this to be generic and should support hashed files which could probably have any plenty of columns with different lengths (worst case scenario lengths replica of a table with largest number of columns/lengths)
For this I tried to
(it works for big numbers
![Smile :)](./images/smilies/icon_smile.gif)
as well, will look whats the maximum limit of it)
But the
PROBLEM again is that there are
too many spaces between each field
Code: Select all
>set.term.type width 1000
DEC vt100 terminal (vt100)
>select * from HashOther;
Field1.................................. Field2.................................. Field3.................................. Field4.................................. Field5..................................
-4927275313 Not Applicable 2008-05-06 09:06:40 Test1 0
-4829300379 Not Applicable 2008-03-25 07:38:49 Test2 0
-4813747248 Not Applicable 2008-03-17 10:51:17 Test3 0
-4702305701 Not Applicable 2008-01-30 13:14:42 Test4 0
-4697551951 Not Applicable 2008-01-28 11:59:47 Test5 0
-4672229048 Not Applicable 2008-01-16 06:56:35 Test6 0
-4662878666 Not Applicable 2008-01-11 08:34:17 Test7 0
-4662809597 Not Applicable 2008-01-11 08:07:52 Test8 - abcdefghijklmnopqrstuv 0
To eliminate the spaces, I thought, lets get column names from LIST.DICT, use them in sql query along with
TRIM function, but the
column names gets split (irrespective of how large the SET.TERM.TYPE WIDTH xxxx).
Posted: Fri Aug 01, 2008 4:21 pm
by ray.wurlod
Terminal type widths supported are only 80 and 132 (and, perhaps, 400). 1000 would be ignored and the previous setting used.
You probably need an approach that does not use "terminal" output but, instead, directs output to a file.
Code: Select all
SETPTR 4,1000,20000,0,0,3,BANNER MyOutput,BRIEF
SELECT * FROM HashOther LPTR 4;
This directs output from the query to "printer channel 4" which is configured by the earlier SETPTR command. The BANNER option names the output file, which is in the &HOLD& subdirectory in your project and can therefore be read with any utility/program that you wish.
Posted: Sat Aug 02, 2008 6:15 am
by ArndW
Add "COL.SPACES 1" to limit the spaces between columns to 1 instead of the default 3.
Posted: Mon Aug 04, 2008 4:36 pm
by mystuff
Hi,
Thanks for the response.
I executed similar statement
SETPTR 4,1000,20000,0,0,3,BANNER MyOutput,BRIEF
SELECT * FROM HashOther LPTR 4;
a) But I am not able to cd (change directory) to &HOLD& or read the
MyOutput file.
when I execute
I get the result
i.e. looks like the file is got created
which is in the &HOLD& subdirectory in your project and can therefore be read with any utility/program that you wish.
b) Will this be generated just as an ascii file?