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

How to Reverse the signature.?


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

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Tue Sep 01, 2009 12:51 pm
Reply with quote

Hi

I have a file of this format

File length is 80

+181818181.99ABCDDKJHDJHSDJASD
-481818181.99ABCDDKJHDJHSDJASD
-381818181.99 ABCDDKJHDJHSDJASD
+281818181.99ABCDDKJHDJHSDJASD

want o/p as (only the signs reversed in the first numeric amount field.)

-181818181.99ABCDDKJHDJHSDJASD
+481818181.99ABCDDKJHDJHSDJASD
+381818181.99 ABCDDKJHDJHSDJASD
-281818181.99ABCDDKJHDJHSDJASD

I do not have access to ICETOOL . How to implement this?

Thanks
Nirmal
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Sep 01, 2009 12:59 pm
Reply with quote

Multipy it by -1
Look for use of MUL in DFSORT
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Sep 01, 2009 2:27 pm
Reply with quote

Use below step to get desired output...
Code:

//S1    EXEC  PGM=SORT                                               
//SYSOUT    DD  SYSOUT=*                                             
//SORTMSG    DD  SYSOUT=*                                             
//SORTIN DD DSN=input dataset                                                         
//SORTOUT  DD DSN=output dataset
//SYSIN    DD *                                                       
  OPTION COPY                                                         
  INREC BUILD=(1,13,SFF,MUL,-1,EDIT=(STTTTTTTTT.TT),SIGNS=(+,-),14,57)
/*                                                                   


Nirmal wrote:
I do not have access to ICETOOL .

What do you mean by this? Can you clarify?
Back to top
View user's profile Send private message
nirmal.poikaikumaran

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Tue Sep 01, 2009 4:47 pm
Reply with quote

Good, thanks

But I faced an error. The value was repeated twice, one with old value & the other with new value.

-181818181.99+181818181.99 like this

How to eliminate the older value from the row?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Sep 01, 2009 5:20 pm
Reply with quote

Can you please show input data and sortcard you have used?
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: Tue Sep 01, 2009 10:43 pm
Reply with quote

Nirmal,

Assuming your numeric field is in positions 1-13 as shown in your example, you can use a DFSORT job like this to do what you asked for:

Code:

//S1    EXEC  PGM=SORT                                               
//SYSOUT    DD  SYSOUT=*                                             
//SORTIN DD *                                                         
+181818181.99ABCDDKJHDJHSDJASD                                       
-481818181.99ABCDDKJHDJHSDJASD                                       
-381818181.99 ABCDDKJHDJHSDJASD                                       
+281818181.99ABCDDKJHDJHSDJASD 
/*                                     
//SORTOUT DD SYSOUT=*                                                 
//SYSIN    DD    *                                                   
  OPTION COPY                                                         
  INREC OVERLAY=(1:1,13,SFF,MUL,-1,EDIT=(STTTTTTTTT.TT),SIGNS=(+,-))
/* 


SORTOUT would have:

Code:

-181818181.99ABCDDKJHDJHSDJASD
+481818181.99ABCDDKJHDJHSDJASD
+381818181.99 ABCDDKJHDJHSDJASD
-281818181.99ABCDDKJHDJHSDJASD
Back to top
View user's profile Send private message
nirmal.poikaikumaran

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Wed Sep 02, 2009 9:17 am
Reply with quote

Thanks to Frank & Sambhaji... it worked now
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
This topic is locked: you cannot edit posts or make replies. SUM FIELDS=NONE in reverse - Get dupl... DFSORT/ICETOOL 9
No new posts RFE: Additional compound operators fo... PL/I & Assembler 1
No new posts Can a compiled COBOL program be rever... COBOL Programming 2
No new posts Reverse string in DB2 SQL DB2 15
No new posts How to reverse a string using DFSORT? DFSORT/ICETOOL 4
Search our Forums:

Back to Top