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

Summing and overlay in one step


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

Active User


Joined: 11 Apr 2005
Posts: 106
Location: Cincinnati Ohio

PostPosted: Sat Dec 23, 2006 1:18 am
Reply with quote

Hi,

I have a requirement to sum two fields and check if the sum is equal to the third field. If it is equal I want to replace the third field with zeros.
I want to achieve this in one step. (using DFSORT or ICETOOL)

ex.
Input

Code:

Field1                 Field2                         Field3
45                       12                             57
43                       10                             53
42                       10                             50


Out put should look like

Code:

Field1                 Field2                         Field3
45                       12                             00
43                       10                             00
42                       10                             50


Position of fields : Field1 1-10 Field2 11-20 Field3 21-30
RECFM =FB, LRECL=80 (for both Input and Output)
Please let me know if any more details from my side is required.

David P.
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: Sat Dec 23, 2006 1:46 am
Reply with quote

You didn't indicate the format of the numeric values (ZD, PD, ...). The way you show them they seem to be 2 digits left-aligned in a 10-byte field. Assuming that's the way they really look, you can use a DFSORT job like this to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
45        12        57
43        10        53
42        10        50
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFOUTLEN=80,
    IFTHEN=(WHEN=INIT,
     OVERLAY=(81:1,10,UFF,ADD,11,10,UFF,TO=FS,LENGTH=10)),
    IFTHEN=(WHEN=(21,10,UFF,EQ,81,10,UFF),
     OVERLAY=(21:C'00',8X))
/*


If the numeric values are actually in some other format, you can change the job appropriately. Or tell me what format they are, and what the values really look like for input and output, and I'll show you how to change the job.
Back to top
View user's profile Send private message
David P

Active User


Joined: 11 Apr 2005
Posts: 106
Location: Cincinnati Ohio

PostPosted: Sat Dec 23, 2006 2:20 am
Reply with quote

Thanks Frank..

It worked the way I wanted. Thanks again for the quick response.

-David P.
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 Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
No new posts Forcing a step to run (even if abended) JCL & VSAM 8
No new posts step by step trace 4 ISPF dialog call... TSO/ISPF 17
Search our Forums:

Back to Top