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

How to convert Edited characters to ZD


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

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Tue Mar 11, 2008 3:24 pm
Reply with quote

Hi All,

I have a requirement that I want to sum one filed of input file.
The field is declared as ZZ9.999.

Could you tell me how to sum this field.

Thanks in advance,
Lakshmi.G
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 Mar 11, 2008 8:52 pm
Reply with quote

You need to supply more details. Show an example of your input records (relevant fields only) and the expected output records. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input file.
Back to top
View user's profile Send private message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Tue Mar 11, 2008 11:08 pm
Reply with quote

Hi Frank,

The RECFM and LRECL of input file is FB 150 respectively.

The filed(73-79) is declared as ZZ9.999.

Suppose if my input file is having data like

1-5 73-79

54771 23.789
54774 123.657
54771 98.001

Then my output should be
54771 121.789
54774 123.657

Thanks,
Lakshmi
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: Wed Mar 12, 2008 12:41 am
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  SORT FIELDS=(1,5,CH,A)
  OUTFIL REMOVECC,NODETAIL,
    SECTIONS=(1,5,
     TRAILER3=(1,5,X,TOT=(73,7,UFF,EDIT=(IIIT.TTT))))
/*


For your example, SORTOUT will have:

Code:

54771  121.790     
54774  123.657     


I assume you want 121.790 (23.789+98.001) rather than 121.789.
Back to top
View user's profile Send private message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Wed Mar 12, 2008 9:47 pm
Reply with quote

Hi Frank,

It is working.

Thanks for your help.


Thanks,
Lakshmi
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 Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
Search our Forums:

Back to Top