Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 6970
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 SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us