MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Getting columnn name by using DSNTIAUL PARM(SQL)

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
sam01
Beginner


Joined: 03 Jan 2019
Posts: 9
Topics: 4

PostPosted: Fri Jan 18, 2019 11:04 am    Post subject: Getting columnn name by using DSNTIAUL PARM(SQL) Reply with quote

Hello, i would like to get the columns nalme with this :

Code:


SELECT STRIP(CHAINE)!!';'!!STRIP(DATEXE)!!';'   
!!STRIP(HEUREXE)!!';'!!STRIP(DATESAV)!!';'     
!!STRIP(HEURSAV)!!';'!!STRIP(CODRET)           
FROM XDATE.REAL WHERE CHAINE LIKE 'XFDESQL%'   
AND DATEXE BETWEEN '2018-01-01' AND '2018-12-31'
ORDER BY DATEXE ASC;                           



By using in my job :
Code:

//SYSTSIN  DD *                                 
           DSN SYSTEM(DB2R)                     
           RUN  PROGRAM(DSNTIAUL) PARMS('SQL') 

Is it possible ?

Thank's for your help.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Jan 18, 2019 11:37 am    Post subject: Reply with quote

sam01,

If you just need the column Name why are you selecting the data from the table? The DB2 catalog table sysibm.syscolumns will have the table information with the columns

something simple like this

Code:

SELECT CHAR(STRIP(NAME))         
  FROM SYSIBM.SYSCOLUMNS         
 WHERE TBNAME = 'XDATE.REAL'       
;


If you need the column definition also then you can take a look at this topic

https://www.mvsforums.com/helpboards/viewtopic.php?t=11443&highlight=column
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sam01
Beginner


Joined: 03 Jan 2019
Posts: 9
Topics: 4

PostPosted: Sat Jan 19, 2019 11:09 am    Post subject: Reply with quote

Hello,

i need both of them.
The data and the column name. Is there an option with header or something like that to get the data and the column name with using ORDER BY ?

Thnak's for your help
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Sat Jan 19, 2019 11:38 am    Post subject: Reply with quote

sam01 wrote:
Hello,

i need both of them.
The data and the column name. Is there an option with header or something like that to get the data and the column name with using ORDER BY ?

Thnak's for your help


Nope. DSNTIAUL unloads the raw data from the table in its original format.

If you want headers then you need to use DSNTEP2 which is a report format unload.

Check this link which explains in detail about DSNTEP2

http://www.mvsforums.com/helpboards/viewtopic.php?t=2418
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sam01
Beginner


Joined: 03 Jan 2019
Posts: 9
Topics: 4

PostPosted: Mon Jan 21, 2019 2:39 am    Post subject: Reply with quote

Ok, i anderstood it's not possible. With DSNTEP2, the result is into the SYSPRINT and limited to 133 bytes records....

Thank's.
Back to top
View user's profile Send private message
promask
Beginner


Joined: 19 Feb 2019
Posts: 1
Topics: 0

PostPosted: Thu Feb 28, 2019 4:04 am    Post subject: Reply with quote

he he)))
Back to top
View user's profile Send private message Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Feb 28, 2019 10:38 am    Post subject: Reply with quote

promask wrote:
he he)))


Promask,

Unless you have anything substantial to add to the topic, I suggest that you keep the giggles to your self. Consider this as a first warning. Keep this charade up , you will end up losing privileges to post on this board.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group