IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Column names with sql out


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Jul 26, 2011 2:39 pm
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: 1020
Location: India

PostPosted: Tue Jul 26, 2011 2:54 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jul 26, 2011 2:58 pm
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: 765
Location: Whitby, ON, Canada

PostPosted: Tue Jul 26, 2011 7:13 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts first column truncated in search result IBM Tools 13
No new posts Capturing COBOL job and program names... All Other Mainframe Topics 2
Search our Forums:

Back to Top