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

Executing DB2 queries using SYNCSORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
raam_kumar

New User


Joined: 25 Apr 2007
Posts: 44
Location: chennai, India

PostPosted: Thu May 10, 2007 1:51 pm
Reply with quote

Hi
I tried executing DB2 queries using SYNCSORT. while retrieving the amount fields there is a problem. here are the details

Record Description:

COLUMN START END DB2
NAME POSITION POSITION DATA TYPE
-------------------- -------- -------- --------------------
AMOUNT 58 64 DECIMAL(13,2)

The query is executing properly. but in output files at these positions (only for which data type is decimal) i am getting junk values instead of original amount values

Sample output (for the above mentioned positions)

" ?? "
" ??- "

Is it possible to print the amount in readable format?Could any one help me regarding this?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu May 10, 2007 9:15 pm
Reply with quote

Hello,

Your process asked for packed-decimal data and what was produced is packed-decimal data. If it is gong into another mainframe process, the packed-decimal data should work as-is. If you look at your output in hex, you will be able to see the values.

If you post your jcl and control statements, we can offer recommendations regarding converting the output to zoned decimal or some other format..
Back to top
View user's profile Send private message
raam_kumar

New User


Joined: 25 Apr 2007
Posts: 44
Location: chennai, India

PostPosted: Fri May 11, 2007 9:57 am
Reply with quote

Hi

Here is the jcl which i have used

Code:

//SORTSQL  EXEC PGM=SYNCSORT,PARM='DB2=DSN'                 
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,20)                     
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,20)                     
//SORTDBIN DD DIPS=SHR,DSN=<query dsn name>                                             
//SORTIN   DD DUMMY                                         
//SORTOUT  DD DSN=<output dataset name>,                       
//         DISP=(,CATLG,DELETE),                     
//         LRECL=80,RECFM=FB,BLKSIZE=0,           
//         SPACE=(CYL,(500,50),RLSE),MGMTCLAS=WORKM     
//SYSOUT   DD SYSOUT=*                                     
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                           
/*                                                         


Query statement:

Code:

SELECT A.<FIELD1>, A.<FIELD2>, B.<FIELD3>, B.<FIELD4>, 
B.<FIELD5>, C.<FIELD6>, C.<FIELD7>, C.<FIELD8>,         
C.<FIELD9>,A.<FIELD10>,A.<FIELD11>,D.<FIELD12>         
FROM <TABLE1> A,                                       
<TABLE2> B,                                             
<TABLE3> C,                                             
<TABLE5> D                                             
WHERE B.<FIELD3> = C.<FIELD3> AND                       
B.<FIELD4> IN ('C','1') AND                             
B.<FIELD5> IN ('O','B','D','D','P') AND                 
A.<FIELD2> = B.<FIELD2> AND                             
A.<FIELD11> IN ('A','L') AND                           
A.<FIELD13> = '0012345' AND                             
A.<FIELD14> = B.<FIELD14> AND                           
B.<FIELD14> = C.<FIELD14> AND                           
C.<FIELD15> = D.<FIELD15> AND                           
C.<FIELD14> = 'CP' ORDER BY A.<FIELD1>                 
WITH UR;
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 11, 2007 7:02 pm
Reply with quote

Hello,

Please post a few of the input records, the output records for those input records and the sysout info from the sort process.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts executing XCTL command in COBOL witho... CICS 10
No new posts Receiving RC 5 when executing REXX pr... CLIST & REXX 3
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts Issues with executing a REXX MACRO th... TSO/ISPF 4
Search our Forums:

Back to Top