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
 

 

How to convert Edited characters to ZD

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to convert Edited characters to ZD
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 Moderator


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

PostPosted: Tue Mar 11, 2008 8:52 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Wed Mar 12, 2008 12:41 am    Post subject:
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    Post subject:
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    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 Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


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