ramesh_ibm
New User
Joined: 17 Nov 2007 Posts: 16 Location: banglore
|
|
|
|
Hi All,
My input file has values like as follows
GROSS
21.2
122.2
121.2 ... and so on..I just want to calculate the sum of the column
and generate a report
When I use
FILE INP (10 ,1000)
INP-GRS 1 3 N 1 ..I am getting SOC7 abend..
Please help me how to declare such masked input |
|
technut
New User
Joined: 27 Dec 2007 Posts: 73 Location: India
|
|
|
|
The option I thought of, is to convert the file into Numeric using ICEMAN and then printing the sum through an eztrieve.
Code below,
Code: |
//STEP01 EXEC PGM=ICEMAN
//SORTIN DD DSN=A024277.TEST.FILE,
// DISP=SHR
//SORTOUT DD DSN=A024277.FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(800,200),RLSE),
// DCB=(*.SORTIN)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC BUILD=(1,10,UFF,TO=ZD,LENGTH=10)
OUTREC FIELDS=(1:1,10,ZD)
/*
//*********************************************************************
//STEP02 EXEC EZTVCG
//*********************************************************************
//EZTV.SYSPRINT DD SYSOUT=*
//RCPT DD DSN=USERID.FILE,
// DISP=SHR
//RPTFILE DD DSN=USERID.TEST.OP,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(800,200),RLSE),
// DCB=(RECFM=FB,LRECL=20,BLKSIZE=0)
//SYSIN DD *
*
FILE RCPT
WS-FIELD 1 10 N 1
FILE RPTFILE PRINTER FB (20 0)
JOB INPUT (RCPT)
PRINT CKIN
REPORT CKIN PRINTER RPTFILE NOADJUST LINESIZE 19
CONTROL FINAL
SUM WS-FIELD
TITLE 1 'SUM REPORT '
LINE 01 WS-FIELD
/*
|
If you dont want to use an Eztrieve, we could just sort-sum using SUM FIELDS in the First STEP itself.
May be, there are alternatives to do this inside easytrieve itself. Probably experts can shed light on better options, if any. |
|