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

Change of format like sign using SORT


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

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Mon Dec 18, 2006 6:33 pm
Reply with quote

Hi ,

How to change the sign of value in a file.

Suppose file contains

Infile
AB-46.50
EF-00.06

I want output file as
AB+46.50
EF+00.06

Can any tell me sort card for this

Regards,
JR
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 Dec 18, 2006 7:09 pm
Reply with quote

Change the sign?
From "-" to "+" and form "+" to "-"?
Or just always to "+" no matter what?
You can use DFSORT's UFF format to get absolute values of signed numbers with decimal points.
Back to top
View user's profile Send private message
Asif Iqbal

New User


Joined: 17 May 2005
Posts: 27
Location: Pune, India.

PostPosted: Mon Dec 18, 2006 7:35 pm
Reply with quote

You may multiply the colmn by '-1' in outrec to get the output with inverse sign.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Dec 18, 2006 9:19 pm
Reply with quote

JR,

You can use this DFSORT job to reverse the sign.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
AB-46.50
EF-00.06
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(3:3,6,SFF,MUL,-1,EDIT=(STT.TT),SIGNS=(+,-))
/*


You can use this DFSORT job to set the sign to '+':

Code:

//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
AB-46.50
EF-00.06
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(3:C'+')
/*
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Tue Dec 19, 2006 9:42 am
Reply with quote

thanks a lot
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top