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
 

 

unwanted characters in numeric fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: unwanted characters in numeric fields
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    Post subject: Re: unwanted characters in numeric fields
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: 3158
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 6:06 pm    Post subject:
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    Post subject: Re: unwanted characters in numeric fields
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    Post subject:
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    Post subject: Re: unwanted characters in numeric fields
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am


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