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
 

 

Varchar problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Mon Mar 13, 2006 8:03 pm    Post subject: Varchar problem
Reply with quote

Hi,

I am trying to unload one table using DSNTIAUL utility in Jcl which (Table) has varchar field.

While browsing the unloaded file, varchar field has been populated with hex value inspite of spaces. Even i declared my cobol copybook as

03 varchar
49 varchar-len s9(4) comp
49 varchar-text x(80)

For length it is showing properly. But varchar-text is not coming properly. means if varchar-text is 'hallo' only hallo is coming properly the remaining 75 bites is coming hex value.

Can any one of you tell me should i need to incorporate any Keyword for Varchar field to select it?

Thanks in advance

Noor.
Back to top
View user's profile Send private message

martin9

Active User


Joined: 01 Mar 2006
Posts: 288
Location: Basel, Switzerland

PostPosted: Tue Mar 14, 2006 3:00 pm    Post subject:
Reply with quote

hy noor,

if you define the length as 80,
then the following characters will be space,
if you put spaces into the text field.
means: in a varchar you define exactly the
needed length for a field.
in your case: 'hallo' is five bytes,
therefore it makes sense to give a length of 5.
if you read this field now, you will only get
the length in a proper way, the rest of the field,
(not stored in db), will be set to hex'00'.

note: you should always determine the length field first,
because, if you have length = zero, the field is empty,
and empty means really empty, all is hex'00'.

all clear, just ask more...

martin9
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 Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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