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
 

 

SORT CARD FOR SIGNED DECIMEL FIELDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
maki_psg

New User


Joined: 28 Jan 2010
Posts: 47
Location: India

PostPosted: Thu Sep 13, 2012 4:49 pm    Post subject: SORT CARD FOR SIGNED DECIMEL FIELDS
Reply with quote

Hi,

I have a sort card to sum up the decimal values as below. But this is working for only unsigned values. How to use the same thing for signed fields. ie, if the same suming up field is a signed one, this is not working. please help me.

Code:
//STEP1    EXEC PGM=SORT                                               
//SORTIN   DD DSN=USER.FILE1,DISP=SHR                                   
//SORTOUT  DD DSN=USER.FILE2,...                   
//SYSIN    DD *                                                         
    INREC FIELDS=(1,2484,2485,14,UFF,ZD,LENGTH=14,2499,1102)           
    SORT FIELDS=(2720,11,CH,A)                                         
    SUM FIELDS=(2485,14,ZD)                                             
    OUTREC FIELDS=(1,2484,2486,11,C'.',2497,2,2499,1102)               
/*                                                                     
//SYSOUT   DD SYSOUT=*
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Sep 13, 2012 4:56 pm    Post subject:
Reply with quote

UFF
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: Thu Sep 13, 2012 10:07 pm    Post subject:
Reply with quote

Hello,

Do you have this working now?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Sep 13, 2012 10:24 pm    Post subject: Reply to: SORT CARD FOR SIGNED DECIMEL FIELDS
Reply with quote

maki_psg,

It is not clear as to what you are trying to do. If you use UFF format to convert the data , it ignores the sign. If you have +100 and -100, they both will be converted to a positive value of 100.

You need to use SFF format (Signed Free format) which also takes the sign into consideration.

Use the following Control cards.

Code:

//SYSIN    DD *                                                     
  OPTION ZDPRINT                                                     
  INREC OVERLAY(2485:2485,14,SFF,ZD,LENGTH=14)                       
  SORT FIELDS=(2720,11,CH,A)                                         
  SUM FIELDS=(2485,14,ZD)                                           
  OUTREC OVERLAY=(2485:2485,14,ZD,EDIT=(STTTTTTTTTT.TT),SIGNS=(+,-))
//*
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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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