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

unwanted characters in numeric fields


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
hallecodec

New User


Joined: 05 Sep 2006
Posts: 30
Location: Philippines

PostPosted: Mon Jul 23, 2007 5:56 pm
Reply with quote

hi guys,

i have this file, LRECL=46 and RECFM=FB. with fields:
> field1 PIC 9(4)
> field2 PIC X(15)
> filler PIC X(1)
> sum1 PIC 9(18)
> sum2 PIC 9(18)

this is my sample input file:

Code:

11401000000         000000000000001213000000000000001213
11401000002         000000000015804260000000000015804260
11401000003         000000001002833160000000001002811224
11401000010         000000000000000313000000000000000313
11401000013         000000000000589971000000000000589780
11401031001         000000000000000183000000000000000183
11401031002         000000000000000506000000000000000506


my requirement is using field1 and the first four characters of field2, i should execute a SUM FIELDS for sum1 and sum2.

this is the SORT step that i used:
Code:

//STEP002  EXEC PGM=SORT                               
//SORTIN   DD   DSN=SUM1,DISP=SHR               
//SORTOUT  DD   DSN=SUM2,DISP=(NEW,CATLG,DELETE),
//         AVGREC=K,SPACE=(56,(1,1),RLSE),             
//         RECFM=FB,LRECL=56                           
//SYSIN    DD   *                                       
  SORT FIELDS=(1,8,ZD,A)                               
  SUM FIELDS=(21,18,39,18),FORMAT=ZD                   
//SYSOUT   DD   SYSOUT=*
//                     


it ran successfully. however, the output looked like this:
Code:

11401000000     00000000101922891G00000000101920679{
11401031001     00000000000000068I00000000000000068I


there are characters in the 38th and 56th positions after i've sum them up.

what could be the reason for these unwanted characters? please help. thanks in advance.
Back to top
View user's profile Send private message
hallecodec

New User


Joined: 05 Sep 2006
Posts: 30
Location: Philippines

PostPosted: Mon Jul 23, 2007 6:05 pm
Reply with quote

sorry. the LRECL should be 56, not 46.
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 Jul 23, 2007 6:06 pm
Reply with quote

If by unwanted, you are referring to the G, I and {, those are the signs on the ZD numbers.
There are editing functions that will remove them back to unsigned ZD.
Back to top
View user's profile Send private message
hallecodec

New User


Joined: 05 Sep 2006
Posts: 30
Location: Philippines

PostPosted: Mon Jul 23, 2007 6:09 pm
Reply with quote

hi william,

so, you mean that it is only natural for those characters to appear?

how could i remove those?

thanks in advance.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Jul 23, 2007 6:15 pm
Reply with quote

hallecodec
Quote:
what could be the reason for these unwanted characters?

To avoid this u can use
Code:

  OPTION ZDPRINT
in SYSIN.

For details about ZDPRINT look at http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1ca20/3.17.1?ACTION=MATCHES&REQUEST=ZDPRINT&TYPE=FUZZY&SHELF=ICE1SH20.bks&DT=20060615185603&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT
Back to top
View user's profile Send private message
hallecodec

New User


Joined: 05 Sep 2006
Posts: 30
Location: Philippines

PostPosted: Mon Jul 23, 2007 6:25 pm
Reply with quote

hi krisprems and william,

thanks for the tip: OPTION ZDPRINT, this command was new to me. there are no more "unwanted characters" in my output.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts Convert HEX to Numeric DB2 3
No new posts Count the number of characters in a f... CA Products 1
Search our Forums:

Back to Top