View previous topic :: View next topic
|
Author |
Message |
rajesh_manas
New User
Joined: 30 Mar 2006 Posts: 11
|
|
|
|
Dear All,
The query is as below,
SELECT CUSTOMER_NR,
(0),
NAME
From CUST table;
I want to write the above query result to a following structure
DCL 1 CUST,
5 Customer_nr char(10),
5 Reserve1 Dec fixed(9,0), (Always it should be filled with zero)
5 Name Char(25);
I need alwasy Zero in the place of Reserve1 out of query.
Please let me know how we can Hard code value '0' in the query.
Regards,
Rajesh |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Rajesh,
What you have is 99% correct. Just remove the ?(?,?)?
SELECT
CUSTOMER_NR,
0,
NAME
From CUST table |
|
Back to top |
|
|
rajesh_manas
New User
Joined: 30 Mar 2006 Posts: 11
|
|
|
|
But the problem is this zero value has to be stored in Decimal(9,0),
I mean it has to be stored in 5 Bytes variable while moving the data from file to program Interal structure....
Please let me know , How to hard code zero value which has to take 5 bytes.
Regards,
rajesh |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Don't you select into host variables? That would be where you set the size.... |
|
Back to top |
|
|
rajesh_manas
New User
Joined: 30 Mar 2006 Posts: 11
|
|
|
|
Sorry, I dont have an idea on declaring the Host variables in the select query.....Can you please let me know the syntax.
Regards,
Rajesh |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
What is this?
Quote: |
DCL 1 CUST,
5 Customer_nr char(10), |
|
|
Back to top |
|
|
rajesh_manas
New User
Joined: 30 Mar 2006 Posts: 11
|
|
|
|
That is the internal structure in my program, Where the Query output file will be moved. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Those are your host variables....Don't you "select column-name into data-name"? |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi !
DCL ... are you programming in PL/I ???
Regards, UmeySan |
|
Back to top |
|
|
|