I need another help to create sort, insted of COBOL pgm.
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Utilities

#1: I need another help to create sort, insted of COBOL pgm. Author: ldushkin PostPosted: Sat Apr 29, 2006 6:41 am
    —
The input file has 2 fields witch I need to SUM. Those fields can be SIGNS=(+,-,,) and can be more
than a 1,000,000.00. FieldA position from 01-10 , fieldB from 25-35.

I know you have example in your topic, but I'm so sorry, I do not have some time to search.

I appreciate all your help

Code:

INPUT:
FieldA                   fieldB
----+----1----+----2----+----3----+-
********************************* To
 163184639   1S5660025     -307.32
 163184639   1S5660025       31.28
-881127782   1S5660025     -114.24
-881127782   1S5660025      -39.32
-881127782   1S5660025       89.22


expect Output

Code:

FieldA : -2,317,014,068   FieldB : -340.38

As always, Thanks!

#2:  Author: Frank YaegerLocation: San Jose PostPosted: Sat Apr 29, 2006 9:29 am
    —
I'm not sure from your description exactly what you want the edited fields to look like, but this DFSORT job should give you the idea. Adjust the edit fields as needed.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    TRAILER1=('FieldA : ',
          TOT=(1,10,SFF,EDIT=(SI,III,III,IIT),SIGNS=(+,-)),
      27:'FieldB : ',
          TOT=(25,11,SFF,EDIT=(SI,III,IIT.TT),SIGNS=(+,-)))
/*

#3:  Author: ldushkin PostPosted: Sat Apr 29, 2006 9:51 am
    —
Thank you Frank!!!!!!!!!!!!!!!!!!!!!!!!!!!

I got error
Code:

SYSIN :                                                       
  OPTION COPY                                                 
  OUTFIL REMOVECC,NODETAIL,                                   
    TRAILER1=('FIELDA : ',                                   
          TOT=(1,10,SFF,EDIT=(SI,III,III,IIT),SIGNS=(+,-)),   
                    *                                         
      27:'FIELDB : ',                                         
          TOT=(25,11,SFF,EDIT=(SI,III,IIT.TT),SIGNS=(+,-)))   
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR                     
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                 
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                 
******************************* Bottom of Data ***************

#4:  Author: kolusuLocation: San Jose PostPosted: Sat Apr 29, 2006 11:24 am
    —
Quote:

I know you have example in your topic, but I'm so sorry, I do not have some time to search.

ldushkin,

You don't have time to search this board for 5 mins but you can wait for 4 hours for the solution. Good going.

With statements like the above you are not going to win many friends on this board.

Kolusu

#5:  Author: ldushkin PostPosted: Sat Apr 29, 2006 11:49 am
    —
I understand, but I'm really busy today, we have production problems.
I apologize for any inconvenience

#6:  Author: kolusuLocation: San Jose PostPosted: Sat Apr 29, 2006 4:13 pm
    —
ldushkin,

I am feeling generous today so here is the solution. However I haven't tested it.

Code:

//STEP0100 EXEC  PGM=SORT               
//SYSOUT   DD SYSOUT=*                 
//SORTIN   DD *                         
 163184639 1S5660025        -307.32     
 163184639 1S5660025          31.28     
-881127782 1S5660025        -114.24     
-881127782 1S5660025         -39.32     
-881127782 1S5660025          89.22     
//SORTOUT  DD SYSOUT=*                 
//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                                 
  INREC FIELDS=(01,10,     $ FIELD-A                               
                25,08,     $ FIELD-B INT                           
                34,02)     $ FIELD-B DECIMAL                       
                                                                   
  OUTREC FIELDS=(01,10,FS,PD,LENGTH=8,  $ CONV FLDA 8 BYTE PACKED 
                 11,10,FS,PD,LENGTH=8,  $ CONV FLDB 8 BYTE PACKED 
                 80:X)                  $ PAD SPACES TO 80 BYTES   
                                                                   
  OUTFIL REMOVECC,NODETAIL,                                       
  TRAILER1=('FIELDA : ',                                           
            TOT=(1,8,PD,EDIT=(SI,III,III,IIT),SIGNS=(+,-)),       
            2X,                                                   
            'FIELDB : ',                                           
            TOT=(9,8,PD,EDIT=(SI,III,IIT.TT),SIGNS=(+,-)))         
/*                                     



Hope this helps...

Cheers

Kolusu

#7:  Author: Frank YaegerLocation: San Jose PostPosted: Sun Apr 30, 2006 9:46 am
    —
Quote:
Thank you Frank!!!!!!!!!!!!!!!!!!!!!!!!!!!

I got error


The job I gave you works fine with DFSORT. The WER messages indicate you're using Syncsort, not DFSORT. DFSORT supports the SFF format. Syncsort doesn't.

#8:  Author: ldushkin PostPosted: Wed May 03, 2006 9:36 am
    —
Kolusu, Thank you very much for your help.

I ran JCL, it works perfect, thanks again. Do me one more favor.

Can we copy input file to output and and the end do sum

ex:

163184639 1S5660025 -307.32
163184639 1S5660025 31.28
-881127782 1S5660025 -114.24
-881127782 1S5660025 -39.32
-881127782 1S5660025 89.22

FIELDA : -2,317,014,068 FIELDB : -340.38

I appreciate all your help

#9:  Author: kolusuLocation: San Jose PostPosted: Wed May 03, 2006 9:52 am
    —
ldushkin,

ldushkin,

Why can't you just post all your requirements once? run the job with the following control cards.

Code:

//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                               
  INREC FIELDS=(01,35,     $ FIRST 35 BYTES                       
                25,08,     $ FIELD-B INT                         
                34,02)     $ FIELD-B DECIMAL                     
                                                                 
  OUTREC FIELDS=(01,35,                 $ FIRST 35 BYTES         
                 01,10,FS,PD,LENGTH=8,  $ CONV FLDA 8 BYTE PACKED
                 36,10,FS,PD,LENGTH=8,  $ CONV FLDB 8 BYTE PACKED
                 80:X)                  $ PAD SPACES TO 80 BYTES 
                                                                 
  OUTFIL REMOVECC,                                               
  OUTREC=(1,35,80:X),                                             
  TRAILER1=('FIELDA : ',                                         
            TOT=(36,8,PD,EDIT=(SI,III,III,IIT),SIGNS=(+,-)),     
            2X,                                                   
            'FIELDB : ',                                         
            TOT=(44,8,PD,EDIT=(SI,III,IIT.TT),SIGNS=(+,-)))       
/*                                                               


Hope this helps...

Cheers

Kolusu

#10:  Author: ldushkin PostPosted: Wed May 03, 2006 10:06 am
    —
Thank you so much, you are genius.



MVSFORUMS.com -> Utilities


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group