MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

I need another help to create sort, insted of COBOL pgm.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
ldushkin
Beginner


Joined: 05 Apr 2006
Posts: 56
Topics: 20

PostPosted: Sat Apr 29, 2006 6:41 am    Post subject: I need another help to create sort, insted of COBOL pgm. Reply with quote

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!
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sat Apr 29, 2006 9:29 am    Post subject: Reply with quote

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=(+,-)))
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ldushkin
Beginner


Joined: 05 Apr 2006
Posts: 56
Topics: 20

PostPosted: Sat Apr 29, 2006 9:51 am    Post subject: Reply with quote

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 ***************
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Sat Apr 29, 2006 11:24 am    Post subject: Reply with quote

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
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ldushkin
Beginner


Joined: 05 Apr 2006
Posts: 56
Topics: 20

PostPosted: Sat Apr 29, 2006 11:49 am    Post subject: Reply with quote

I understand, but I'm really busy today, we have production problems.
I apologize for any inconvenience
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Sat Apr 29, 2006 4:13 pm    Post subject: Reply with quote

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
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sun Apr 30, 2006 9:46 am    Post subject: Reply with quote

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.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ldushkin
Beginner


Joined: 05 Apr 2006
Posts: 56
Topics: 20

PostPosted: Wed May 03, 2006 9:36 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Wed May 03, 2006 9:52 am    Post subject: Reply with quote

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
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ldushkin
Beginner


Joined: 05 Apr 2006
Posts: 56
Topics: 20

PostPosted: Wed May 03, 2006 10:06 am    Post subject: Reply with quote

Thank you so much, you are genius.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group