Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 743
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 Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us