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 sum 9(5).99 and write it to a file like 9(5).99

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Fri Mar 06, 2009 4:15 pm    Post subject: How to sum 9(5).99 and write it to a file like 9(5).99
Reply with quote

Hi,

I have a requirement like:

I have 1 field as 9(5).99 and I want to sum this filed and write this to a file as 9(5).99 means I want '.' also in my output file.

For example:

00123.45
12345.67

means my output file should be 12469.12.

I want this to be done by JCL if it is possible.

I have writtedn the code as

SUM FIELDS=(12,6,ZD)

but getting SOC7 error.

Please advice.

Thank you,

Regards
Lakshmi
Back to top
View user's profile Send private message

varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Fri Mar 06, 2009 4:16 pm    Post subject:
Reply with quote

Sorry,By mistake I have posted it in COBOL instead of JCL.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Mar 06, 2009 4:36 pm    Post subject:
Reply with quote

Hi,
varalakshmi.G wrote:
Sorry,By mistake I have posted it in COBOL instead of JCL.
Moved.. icon_smile.gif

At what position in file your data comes? I mean can you show some "actual" records in way as shown below:
Code:
=COLS> ----+----1----+-
****** ****************
000001 00123.45       
000002 12345.67       
****** ****************
and please post complete diagnostic information from the SYSOUT of failed job.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Fri Mar 06, 2009 5:23 pm    Post subject:
Reply with quote

Quote:
I want this to be done by JCL if it is possible
Yes it is possible.

The input data you showed is NOT in ZD format. You can use the SFF/UFF format in SyncSort/DFSORT to achieve this. Post the requested details.
Back to top
View user's profile Send private message
balajiofcrrcoe

New User


Joined: 07 Jul 2005
Posts: 41
Location: chennai

PostPosted: Fri Mar 06, 2009 5:32 pm    Post subject:
Reply with quote

I think the below post helps ur requirement

http://www.ibmmainframes.com/about25352.html
Back to top
View user's profile Send private message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Fri Mar 06, 2009 7:41 pm    Post subject:
Reply with quote

Hi,

My file layout is


Code:
***************************** Top
012547771XY200.02300.03400.0410.01
012547772XY200.02300.03400.0420.02
012547772XY200.02300.03400.0430.03


Field starts at 12th position.

I want my output as


Code:
012547771XY200.02300.03400.0410.01
012547772XY400.04600.06800.0850.05


Means if first 11 bytes are same then it should add the remaining fields and write only 1 reocrd.I gave the sort card as below


Code:
//SYSIN DD *                                     
 SORT FIELDS=(1,9,CH,A,10,2,CH,A)                 
 SUM FIELDS=(12,6,ZD,18,6,ZD,24,6,ZD,30,5,ZD)     
/*                                               

SYSOUT has



Code:
 SYNCSORT FOR Z/OS  1.3.0.0R    U.S. PATENTS: 4210961, 5117495   (C) 2007 SYNCSO
                                     A M O C O    C O R P O R A T I O N   z/OS 
 SYNCSORT LICENSED FOR CPU SERIAL NUMBER 5CEB0, MODEL 2096                 LICEN
 SYSIN :                                                                       
  SORT FIELDS=(1,9,CH,A,10,2,CH,A)                                             
  SUM FIELDS=(12,6,ZD,18,6,ZD,24,6,ZD,30,5,ZD)                                 
JOB SUMRFID          STEP SORT            TIME 042401   DATE 09065    ID = 255 
                                                                               
  PSW AT ENTRY TO SNAP    078D1000  80008E66  ILC  02  INTC  0033               
                                                                               
 ASCB: 00F95680                                                                 



Please suggest.

Thanks in advance.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Mar 06, 2009 7:55 pm    Post subject:
Reply with quote

varalakshmi.G wrote:
I gave the sort card as below
Code:
//SYSIN DD *                                     
 SORT FIELDS=(1,9,CH,A,10,2,CH,A)                 
 SUM FIELDS=(12,6,ZD,18,6,ZD,24,6,ZD,30,5,ZD)     
/*                                               
Have you even bothered to look at the manual and see what the SFF/UFF format can do?
Have you even bothered to look at the the link provided?
Back to top
View user's profile Send private message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Fri Mar 06, 2009 7:58 pm    Post subject:
Reply with quote

I checked that and I am trying that.But one member asked for these details.That is the reason I have given these details.
If it works,I will post the message also.
Thank you.
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 10, 2009 4:40 pm    Post subject:
Reply with quote

Hi,

I gave the SORT card as in the link given by Balaji and it worked.

But I have one doubt.Is it possible to extract the count also.

Means

My input is:

Code:
54771X300.03200.02
54771X200.04333.03
54772Y456.45209.09
Then my output should be

Code:
54771X500.07533.052
54772Y456.45209.091

Here 19th position denotes count.

Please advice.
Thanks
Lakshmi

Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Wed Mar 11, 2009 1:03 am    Post subject:
Reply with quote

What should be your expected output if the input is something like this?
Code:
54771X999.99999.99
54771X200.99999.99
54772Y456.45209.09
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 11, 2009 1:38 pm    Post subject:
Reply with quote

My expected output is
Code:
54771X1200.98199.982
54772Y0456.45209.091

Please advice.

Thanks.
Back to top
View user's profile Send private message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Thu Mar 12, 2009 9:04 pm    Post subject:
Reply with quote

Hi,

Could you please help me in this.

Thanks.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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