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
 
Change of format like sign using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Change of format like sign using SORT
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: 3158
Location: Tucson AZ

PostPosted: Mon Dec 18, 2006 7:09 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Mon Dec 18, 2006 9:19 pm    Post subject:
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    Post subject: Re: Change of format like sign using SORT
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    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 numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Repeat Sequence Number Until change i... rahulabvp DFSORT/ICETOOL 6 Thu Mar 29, 2018 12:51 pm
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am
No new posts How to Generate JCL using Sort naveen katkuri DFSORT/ICETOOL 7 Tue Mar 13, 2018 3:50 pm

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