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

Only text from varchar


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Seppe

New User


Joined: 01 Apr 2009
Posts: 33
Location: Rome - Italy

PostPosted: Thu Apr 21, 2016 10:42 pm
Reply with quote

Hi,
i need to unload a table using select into jcl.
What is the instruction to select only the text part from a varchar column?
I want only the text in my ouput file....

Thanks!
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Apr 21, 2016 11:40 pm
Reply with quote

There is no such instruction; you will have to do it programmatically.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2589
Location: NYC,USA

PostPosted: Sat Apr 23, 2016 8:33 am
Reply with quote

Hint- look for LOCATE and SUBSTR and combine them .
Back to top
View user's profile Send private message
Seppe

New User


Joined: 01 Apr 2009
Posts: 33
Location: Rome - Italy

PostPosted: Thu May 26, 2016 2:20 pm
Reply with quote

I explain...

Select MIO_CAMPO
from MIA_TAB ;

MIO_CAMPO is long 1000 char;

In fileoutput i have:
2 byte with lenght and after MIO_CAMPO.

I want only the value of MIO_CAMPO...

It is possible only with query or i have to take other jcl steps?
Back to top
View user's profile Send private message
Seppe

New User


Joined: 01 Apr 2009
Posts: 33
Location: Rome - Italy

PostPosted: Thu May 26, 2016 2:37 pm
Reply with quote

icon_lol.gif

i solved it icon_lol.gif icon_lol.gif

CHAR(MIO_CAMPO)

very trivial solution...
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri May 27, 2016 2:25 am
Reply with quote

Quote:
other jcl steps?


What do you mean by this? What has JCL got to do with it? JCL only tells the operating system which program(s) you want run and the resources required by the program(s).
Back to top
View user's profile Send private message
Seppe

New User


Joined: 01 Apr 2009
Posts: 33
Location: Rome - Italy

PostPosted: Fri May 27, 2016 3:05 pm
Reply with quote

icon_biggrin.gif
nothing...

I have a SELECT in a job and i do outrec sort...

with "char" outerec is not necessary any more.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2589
Location: NYC,USA

PostPosted: Fri May 27, 2016 4:37 pm
Reply with quote

first learn to use code tags and second you don't tell the requirements properly or you ain't clear yourself, you are now talking in bits and bytes than simplying your needs.glad whatever you did works for you.
Back to top
View user's profile Send private message
Seppe

New User


Joined: 01 Apr 2009
Posts: 33
Location: Rome - Italy

PostPosted: Fri May 27, 2016 4:48 pm
Reply with quote

Sure. Thank's
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 How to convert RESP code 12 to text? CICS 9
No new posts Send text at cursor position on an IS... CLIST & REXX 10
No new posts FTP ASCII-Text to Mainframe - REG All Other Mainframe Topics 4
No new posts Rexx command to open an another text ... PC Guides & IT News 7
No new posts Sorting on text - but in non-alphabet... SYNCSORT 5
Search our Forums:

Back to Top