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
 

 

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: 2422
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: 10211
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: 642
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 DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm


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