View previous topic :: View next topic
|
Author |
Message |
varalakshmi.G
New User
Joined: 04 Jun 2007 Posts: 55 Location: Hyderabad
|
|
|
|
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 |
|
|
varalakshmi.G
New User
Joined: 04 Jun 2007 Posts: 55 Location: Hyderabad
|
|
|
|
Sorry,By mistake I have posted it in COBOL instead of JCL. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi,
varalakshmi.G wrote: |
Sorry,By mistake I have posted it in COBOL instead of JCL. |
Moved..
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
balajiofcrrcoe
New User
Joined: 07 Jul 2005 Posts: 41 Location: chennai
|
|
Back to top |
|
|
varalakshmi.G
New User
Joined: 04 Jun 2007 Posts: 55 Location: Hyderabad
|
|
|
|
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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
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 |
|
|
varalakshmi.G
New User
Joined: 04 Jun 2007 Posts: 55 Location: Hyderabad
|
|
|
|
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 |
|
|
varalakshmi.G
New User
Joined: 04 Jun 2007 Posts: 55 Location: Hyderabad
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
varalakshmi.G
New User
Joined: 04 Jun 2007 Posts: 55 Location: Hyderabad
|
|
|
|
My expected output is
Code: |
54771X1200.98199.982
54772Y0456.45209.091
|
Please advice.
Thanks. |
|
Back to top |
|
|
varalakshmi.G
New User
Joined: 04 Jun 2007 Posts: 55 Location: Hyderabad
|
|
|
|
Hi,
Could you please help me in this.
Thanks. |
|
Back to top |
|
|
|