If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Using DSNTIAUL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-06-07, 00:04
pavan1811 pavan1811 is offline
Registered User
 
Join Date: Nov 2007
Posts: 1
Using DSNTIAUL

I am trying to run a query thru JCL using the DSNTIAUL option in jcl.
My query is running fine except that a char 'ę' is getting appended in the begining . Please let me know how can I eliminate this .

My query looks like this :
Select 'PAVAN'||empn0||'|'||deptno||'|'
from emp,dept
where emp_status='ACTIVE'

the o/p is as follows :

ęPAVAN1234|SALES|

How do I eliminate 'ę' from my o/p?

The JCL I am using is

//STEP10 EXEC PGM=IKJEFT01,
// DYNAMNBR=20,
// COND=(0,NE)
//*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DSN)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARMS('SQL')
/* END OF INPUT
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//*
//SYSREC00 DD DSN=pavan.DUMP.Output,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(200,50),RLSE),
// DCB=(RECFM=FB,LRECL=400,BLKSIZE=0)
//SYSPUNCH DD DUMMY
//*
//SYSIN DD *
above query
/*

Thanks in advance!!
Pavan.
Reply With Quote
  #2 (permalink)  
Old 11-06-07, 02:06
umayer umayer is offline
Registered User
 
Join Date: Dec 2005
Posts: 273
your SELECT results in a column of type VARCHAR. That means, a two-byte length indicator preceeds your result.

Try this:

Select CAST( 'PAVAN'||empn0||'|'||deptno||'|' AS CHAR(xxx) )
from emp,dept
where emp_status='ACTIVE'

where xxx is the length of your result.

by the way:
you use an inner join, but there is no join criteria in your where-clause.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On