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
 

 

Only text from varchar

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Only text from varchar
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: 1738
Location: Bloomington, IL

PostPosted: Thu Apr 21, 2016 11:40 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Sat Apr 23, 2016 8:33 am    Post subject:
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    Post subject: Reply to: Only text from varchar
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    Post subject:
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: 1715
Location: UK

PostPosted: Fri May 27, 2016 2:25 am    Post subject:
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    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Fri May 27, 2016 4:37 pm    Post subject:
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    Post subject:
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    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 How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
This topic is locked: you cannot edit posts or make replies. Sort card to replace text using cross... Susanta SYNCSORT 32 Tue Sep 13, 2016 4:17 pm
No new posts How to send email with Rich Text usin... santhosh5983 JCL & VSAM 4 Fri Apr 08, 2016 2:30 am
This topic is locked: you cannot edit posts or make replies. Need a JCL for FTP the text file to D... Hareesh Verma JCL & VSAM 7 Fri Mar 25, 2016 12:11 pm


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