Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem SUM FIELDS with alphanumeric

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
danylele74

New User


Joined: 03 Jul 2014
Posts: 27
Location: Italy

PostPosted: Mon Jul 07, 2014 7:02 pm    Post subject: Problem SUM FIELDS with alphanumeric
Reply with quote

Hello, i must to sum an alphabetic fiels.

The lenght of the input file is 10000. Same for the putput file.
The fields is at position 3674 (alphanumeric)
The key is at position 13,9.


Input file:

Code:


FROM 1 to 22                       FROM 3674 to 3693

----+----1----+----2--           -+----8----+----9---
30/06/2014; 000002288;           +000000000097298,28;
30/06/2014; 000002288;           +000000000097298,28;
30/06/2014; 000002288;           +000000000006517,63;




Here my jcl.


Code:

//STEP060  EXEC PGM=SORT,REGION=0M,COND=(0,NE)                         
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DISP=SHR,DSN=XSE005.IMP000.IM1IM71.DATAPLUS.SORT3         
//SORTOUT  DD DISP=OLD,DSN=XSE005.IMP000.IM1IM71.DATAPLUS.SORT4         
//SYSIN    DD *                                                         
    SORT FIELDS=(13,9,CH,A),FORMAT=BI                                   
    OUTFIL REMOVECC,NODETAIL,                                           
    SECTIONS=(13,9,                                                     
    TRAILER3=(1,3673,X,                                                 
             TOT=(3674,19,SFF,EDIT=(STTTTTTTTTTTTTTT.TT),SIGNS=(+,-))))


I need the rest of the file starting at position 3693 to 10000.

Can you help me?
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Jul 07, 2014 7:59 pm    Post subject: Reply to: Problem SUM FIELDS with alphanumeric
Reply with quote

Did you even thank Magesh23586 for the code?

So, now make lots more TOTs. Either rexx, SORT or the ISPF editor, or whatever your are comfortable with. You may run out of control cards, but you'll only know that if/when it happens.
Back to top
View user's profile Send private message
danylele74

New User


Joined: 03 Jul 2014
Posts: 27
Location: Italy

PostPosted: Mon Jul 07, 2014 8:13 pm    Post subject: Reply to: Problem SUM FIELDS with alphanumeric
Reply with quote

I don't know who is Magesh23586.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Mon Jul 07, 2014 8:15 pm    Post subject: Reply to: Problem SUM FIELDS with alphanumeric
Reply with quote

the one who posted the snippet for the question You asked in the other forum
http://ibmmainframeforum.com/viewtopic.php?f=28&t=10051
Back to top
View user's profile Send private message
danylele74

New User


Joined: 03 Jul 2014
Posts: 27
Location: Italy

PostPosted: Mon Jul 07, 2014 8:27 pm    Post subject: Reply to: Problem SUM FIELDS with alphanumeric
Reply with quote

this is my jcl (modified):

Code:

//STEP060  EXEC PGM=SORT,REGION=0M,COND=(0,NE)                         
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DISP=SHR,DSN=XSE005.IMP000.IM1IM71.DATAPLUS.SORT3         
//SORTOUT  DD DISP=OLD,DSN=XSE005.IMP000.IM1IM71.DATAPLUS.SORT4         
//SYSIN    DD *                                                         
    SORT FIELDS=(13,9,CH,A),FORMAT=BI                                   
    OUTFIL REMOVECC,NODETAIL,                                           
    SECTIONS=(13,9,SKIP=P,                                             
    TRAILER3=(1:13,9,X,                                                 
             TOT=(3674,19,SFF,EDIT=(STTTTTTTTTTTTTTT.TT),SIGNS=(+,-))))





but the output file is wrong. It is not what i need:

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7
000002288 +000000000201114.19                                         



all the rest of the data is lost.
Back to top
View user's profile Send private message
danylele74

New User


Joined: 03 Jul 2014
Posts: 27
Location: Italy

PostPosted: Tue Jul 08, 2014 3:03 pm    Post subject: Reply to: Problem SUM FIELDS with alphanumeric
Reply with quote

Hello, I think I found the solution.
Unfortunately in the output file (at the bottom right of the record) I find the range containing the calculated sum.

Is it possible to remove it without losing the data contained in the input file ?

This is my JCL

Code:

//STEP060  EXEC PGM=SORT,REGION=0M,COND=(0,NE)                     
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD DISP=SHR,DSN=FILE.INPUT   
//SORTOUT  DD DISP=OLD,DSN=FILE.OUTPUT
//SYSIN    DD *                                                   
    SORT FIELDS=(13,9,CH,A),FORMAT=BI                             
    OUTFIL REMOVECC,NODETAIL,                                     
    SECTIONS=(13,9,                                               
    TRAILER3=(1:1,9980,X,                                         
         TOT=(3674,19,SFF,EDIT=(STTTTTTTTTTTTTTT.TT),SIGNS=(+,-))))



Thank you

p.s.
Input and output files have lenght 10000.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Jul 08, 2014 3:22 pm    Post subject: Reply to: Problem SUM FIELDS with alphanumeric
Reply with quote

If you found that yourself, I'm sure you can fix your problem, as you understand what you are saying.

If you can't fix your problem, please continue the topic in the forum you started it in. This has been locked.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    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 Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us