Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Summing and overlay in one step

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Summing and overlay in one step
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 Moderator


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

PostPosted: Sat Dec 23, 2006 1:46 am    Post subject:
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    Post subject: Re: Summing and overlay in one step
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    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 Summing on Mixed Case Literals Roy Ware SYNCSORT 3 Tue Jan 03, 2017 10:18 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm
No new posts Consolidating and summing file contents Kevin Lindsley SYNCSORT 14 Thu Jun 09, 2016 5:24 am
No new posts Single step utility for compare and u... ramprakashn JCL & VSAM 5 Fri Apr 29, 2016 3:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us