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

why I am getting only ascii characters in my output


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

New User


Joined: 11 Jun 2007
Posts: 12
Location: TVM

PostPosted: Mon Oct 01, 2007 5:57 pm
Reply with quote

Hi,
I am getting a warning code of 4 and I find this message in the spool.

INPUT STATEMENT WAS NOT A FULL SELECT ON A SINGLE TABLE. LOAD STATEMENT WILL NEED MODIFICATION.
UNLOAD DATA SET SYSREC00 RECORD LENGTH SET TO 6

I get only ASCII characters in my output file.

My code is as follows.

//***************************************************************
//* DATABASE OUTPUT FILE
//***************************************************************
//STEP010 EXEC PGM=IKJEFT1A,DYNAMNBR=20
//STEPLIB DD DISP=SHR,DSN=SYS4.DB2.P2D2.SDSNEXIT
// DD DISP=SHR,DSN=SYS4.DB2.P2D2.SDSNLOAD
//*
//SYSREC00 DD DSN=AXXXXX.DEL010.OUTDD2,
//*SYSREC00 DD DSN=*.DEL010.OUTDD1,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(150,75),RLSE),
// UNIT=SYSDA
//*
//SYSPUNCH DD DUMMY
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
. DSN SYSTEM(P2D2)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARM('SQL') -
LIB('SYS4.DB2.P2D2.RUNLIB.LOAD')
END
//*
//SYSIN DD *

SET CURRENT DEGREE = 'ANY';

SELECT A.AXX_ID_CHXXX
FROM D2XX.AXX_CHAIN_EOM_SHR A
,D2XXA.AXX_CHANL_REL B
WHERE A.AXX_ID_CXXX = B.AXX_ID_CXXX
FETCH FIRST 120 ROWS ONLY
;
// . . . . . . . . . . . . . . . . . . . . .

Can someone help me and tell me why I am getting only ascii characters in my output file?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Oct 01, 2007 6:19 pm
Reply with quote

Because the input is ASCII?
Back to top
View user's profile Send private message
xylene567
Warnings : 1

New User


Joined: 11 Jun 2007
Posts: 12
Location: TVM

PostPosted: Mon Oct 01, 2007 6:26 pm
Reply with quote

Nope I checked the tables using DB2 Tools. The data can be viewed with no probs there
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: Mon Oct 01, 2007 6:27 pm
Reply with quote

Hello,

What do you mean when you say
Quote:
I am getting only ascii characters in my output file
How did you verify your result returned only ascii values?

If you ran this on the mainframe, if is unlikely that the output was created with ascii.

Please open your output file in browse using HEX ON, and post a bit of the first few output records here.
Back to top
View user's profile Send private message
xylene567
Warnings : 1

New User


Joined: 11 Jun 2007
Posts: 12
Location: TVM

PostPosted: Mon Oct 01, 2007 6:35 pm
Reply with quote

I got the output as
&<CCS
ë<CCS
Î CCS
the actual output has to be


504.
534.
760.
which are decimal numbers (11,0)
Is it the problem with some conversions? I am not sure if the output that I got is ASCII characters but then it doesnt look good ! icon_sad.gif
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Oct 01, 2007 7:12 pm
Reply with quote

It could be packed decimal but without seeing the hex display it is hard to tell.
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: Mon Oct 01, 2007 8:08 pm
Reply with quote

Hello,

The unload used the attributes of the database fields. In your unloaded file, you have packed-decimal (comp-3) values that are perfectly valid.

You have not posted the data in hex. If you do, it will make more sense.

For example, the ampersand "&" is a hex 50. The "<" is hex 4C. There is your 504 in packed decimal (x'504C').
Back to top
View user's profile Send private message
xylene567
Warnings : 1

New User


Joined: 11 Jun 2007
Posts: 12
Location: TVM

PostPosted: Mon Oct 01, 2007 8:42 pm
Reply with quote

The output file in hex format !

Code:
 000001     &<                                                               
        000054                                                               
        00000C                                                               
 -----------------------------------------------------------------------------
 000002     ë<                                                               
        000054                                                               
        00003C                                                               
 -----------------------------------------------------------------------------
 000003     Î                                                                 
        000070                                                               
        00006C
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: Mon Oct 01, 2007 9:23 pm
Reply with quote

Hello,

When you post jcl, code, or data, it is a good ides to use the "Code" tab near the top of the reply panel. It preserves alignment and makes the info much more readable. Please note how your data looks now (i added the code tab).

What you have is valid packed-decimal (comp-3) output and that can be used directly in the process that will read the unloaded data (as long as the reading is done on the mainframe).

If this data is to be downloaded to some win-based or unix process, the packed-decimal data will not work.
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top