Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to insert Dec fixed(9,0) value in the select query.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
rajesh_manas

New User


Joined: 30 Mar 2006
Posts: 11

PostPosted: Thu Jan 18, 2007 7:29 pm    Post subject: How to insert Dec fixed(9,0) value in the select query.
Reply with quote

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
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Jan 18, 2007 7:48 pm    Post subject: Re: How to insert Dec fixed(9,0) value in the select query.
Reply with quote

Rajesh,

What you have is 99% correct. Just remove the ?(?,?)?

SELECT
CUSTOMER_NR,
0,
NAME
From CUST table
Back to top
View user's profile Send private message
rajesh_manas

New User


Joined: 30 Mar 2006
Posts: 11

PostPosted: Thu Jan 18, 2007 8:21 pm    Post subject: Re: How to insert Dec fixed(9,0) value in the select query.
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Jan 18, 2007 8:31 pm    Post subject:
Reply with quote

Don't you select into host variables? That would be where you set the size....
Back to top
View user's profile Send private message
rajesh_manas

New User


Joined: 30 Mar 2006
Posts: 11

PostPosted: Thu Jan 18, 2007 8:34 pm    Post subject: Re: How to insert Dec fixed(9,0) value in the select query.
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Jan 18, 2007 8:40 pm    Post subject:
Reply with quote

What is this?
Quote:
DCL 1 CUST,
5 Customer_nr char(10),
Back to top
View user's profile Send private message
rajesh_manas

New User


Joined: 30 Mar 2006
Posts: 11

PostPosted: Thu Jan 18, 2007 8:44 pm    Post subject:
Reply with quote

That is the internal structure in my program, Where the Query output file will be moved.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Jan 18, 2007 8:51 pm    Post subject:
Reply with quote

Those are your host variables....Don't you "select column-name into data-name"?
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Thu Jan 18, 2007 9:53 pm    Post subject:
Reply with quote

Hi !

DCL ... are you programming in PL/I ???

Regards, UmeySan
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts How to query MAXGENS of an existing P... Chuchulo Hatyzak JCL & VSAM 4 Wed Nov 22, 2017 10:23 pm
No new posts Native SQL Query kishpra DB2 1 Wed Nov 22, 2017 8:38 pm
No new posts Query on IEFBR14 with GDG Ashishpanpaliya JCL & VSAM 4 Tue Nov 07, 2017 8:34 pm
No new posts Query on XMITIP abdulrafi All Other Mainframe Topics 1 Wed Oct 25, 2017 6:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us