View previous topic :: View next topic
|
Author |
Message |
tomehta
New User
Joined: 18 Aug 2008 Posts: 98 Location: India
|
|
|
|
Hi
I have query issue as below,
From the sysibm.syscolumns table, I want to find the starting position for each column in DCLGEN. I will illustrate the problem as below.
Seq no Length
1 5
2 3
3 7
4 8
i want to get the position using the following logic
seq no Length Position
1 5 1
2 3 Length of Seq no 1 + 1
3 7 Length of Seq no 1 + Length of Seq no 2 + 1
4 8 Length of Seq no 1 + Length of Seq no 2 + Length of Seq no 3 + 1
I want to do this thru the query, can some one guideme how this can be achieved.
Regards |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
I would suggest that it is a useless effort
even if the DCLgen process builds a record like layout,
DB2 has no concepto of record, just of atomic fields COLUMNS
so it might be a concern the lenght of each column/field,
but the offset/position does not really make sense
as I said from a DB2 perspective |
|
Back to top |
|
|
tomehta
New User
Joined: 18 Aug 2008 Posts: 98 Location: India
|
|
|
|
thanks for the quick response,
i want to use the length and position to move the values in the dclgen. Bit cryptic, but this is how the things are at this shop. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Quote: |
Bit cryptic, but this is how the things are at this shop. |
simply stupid
but since that is how they di things they should already have devised a standard approch for the issue |
|
Back to top |
|
|
tomehta
New User
Joined: 18 Aug 2008 Posts: 98 Location: India
|
|
|
|
but lets the i have the req for a any other table, and i want to keep adding the column lenght for all the previous values, how thru join or nested query i can achieve it |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
use the same approach used for the already existing tables,
since the practice is established there should be no need to ask a forum
just follow the standards of Your organization
if You do not know.... ask Your peers, they should
it' s unreasonable to ask people outside Your organization to help implement a silly solution |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Once again, i'm late to the party. . . .
How are these lengths/displacements used? Will this be used perhaps to create Easytrieve layouts?
Suggest that if you are determined to automate this (rather than do it manually as it probably is now), you would be ahead to write a bit of code rather than try to write a single query or some convoluted join.
If you are going to use the values to create Easytrieve layouts, there is a feature that will convert a cobol layout to Easytrieve. If you have Easytrieve you could use the convert to generate the info you want even if it was not for use with Easytrieve. . . |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Quote: |
Once again, i'm late to the party. . . . |
Go back home and get your party hat on... Oh, never mind, I see you already have it on. |
|
Back to top |
|
|
|