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
 
How to Reverse the signature.?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to Reverse the signature.?
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    Post subject:
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    Post subject:
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    Post subject: Reply to: How to Reverse the signature.?
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    Post subject:
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 Moderator


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

PostPosted: Tue Sep 01, 2009 10:43 pm    Post subject:
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    Post subject:
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    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 RFE: Additional compound operators fo... prino PL/I & Assembler 1 Wed Jun 08, 2016 3:31 pm
No new posts Can a compiled COBOL program be rever... boyti ko COBOL Programming 2 Wed Dec 03, 2014 1:12 pm
No new posts Reverse string in DB2 SQL Rijit DB2 15 Tue Aug 26, 2014 3:30 pm
No new posts How to reverse a string using DFSORT? Megha Gupta DFSORT/ICETOOL 4 Wed Jan 22, 2014 6:07 pm
No new posts REGARDING FUNCTION REVERSE... ram_vizag COBOL Programming 6 Mon Sep 23, 2013 7:23 pm

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