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
 
Column names with sql out

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

New User


Joined: 22 Feb 2008
Posts: 70
Location: Turkey

PostPosted: Tue Jul 26, 2011 2:31 pm    Post subject: Column names with sql out
Reply with quote

Hi,
I want to run SQL in JCL and I want to Include column names in output file. Using SYSIBM.SYSCOLUMNS is a solution for that issue.
But my sql like that;
select Names, SUM(counters) as Totals
from TABLE1;

desired output;
Names Totals
John 12
Michael 24
Ozgur 30
....

Is it possible?
Back to top
View user's profile Send private message

PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2442
Location: Netherlands, Amstelveen

PostPosted: Tue Jul 26, 2011 2:39 pm    Post subject:
Reply with quote

Whydont you try it?
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Tue Jul 26, 2011 2:54 pm    Post subject:
Reply with quote

ozgurseyrek,

That is possible.

You can use DSNTEP4/DSNTEP2.

But, it wont be exactly like your desired output, it have table lines/borders and stuff like that.

Thanks,
Sushanth
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Tue Jul 26, 2011 2:58 pm    Post subject: Reply to: Column names with sql out
Reply with quote

DSNTEPx sources are available in DSN___.SDSNSAMP
and can be modified according to the organization needs ( btdtgtts icon_biggrin.gif )
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 658
Location: Whitby, ON, Canada

PostPosted: Tue Jul 26, 2011 7:13 pm    Post subject: Re: Reply to: Column names with sql out
Reply with quote

enrico-sorichetti wrote:
DSNTEPx sources are available in DSN___.SDSNSAMP
and can be modified according to the organization needs ( btdtgtts icon_biggrin.gif )
If your shop has a PL/I compiler. My attempt to modify DSNTEPx came to a screeching halt when I discovered that they'd dropped the PL/I compiler to save money. "No one was using it" icon_evil.gif
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 column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts RFE: DB2 support for mixed case names. Pedro DB2 0 Tue Jul 04, 2017 1:32 am

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