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
 

 

why I am getting only ascii characters in my output

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Oct 01, 2007 6:19 pm    Post subject:
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    Post subject: Reply to: why I am getting only ascii characters in my outpu
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

Site Director


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

PostPosted: Mon Oct 01, 2007 6:27 pm    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Oct 01, 2007 8:08 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Oct 01, 2007 9:23 pm    Post subject:
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    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 add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts JES2 doesn't honor the priority of th... Aron Lendvai JCL & VSAM 7 Thu Jun 29, 2017 1:41 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am


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