IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem SUM FIELDS with alphanumeric


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

New User


Joined: 03 Jul 2014
Posts: 28
Location: Italy

PostPosted: Mon Jul 07, 2014 7:02 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jul 07, 2014 7:59 pm
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: 28
Location: Italy

PostPosted: Mon Jul 07, 2014 8:13 pm
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Jul 07, 2014 8:15 pm
Reply with quote

the one who posted the snippet for the question You asked in the other forum
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: 28
Location: Italy

PostPosted: Mon Jul 07, 2014 8:27 pm
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: 28
Location: Italy

PostPosted: Tue Jul 08, 2014 3:03 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jul 08, 2014 3:22 pm
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. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
Search our Forums:

Back to Top