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 

How to Add Editing Character Fields in a Flat file.

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


Joined: 11 Dec 2006
Posts: 6
Topics: 2

PostPosted: Fri Jun 29, 2007 3:48 pm    Post subject: How to Add Editing Character Fields in a Flat file. Reply with quote

All,

How to add editing filed column by using sum fields=none forumula.

Eg:
Code:

Policyno.     Date     Amt-1     Amt-2      Amt-3.
B3218655810 200603 000465.96 000391.52 0000044.80
B3218655810 200602 000465.96 000391.52 0000044.80
B3218655810 200601 000465.96 000391.52 0000044.80
E1128350610 200602 000182.25 000175.96 0000100.36
E1128350610 200601 000182.25 000175.96 0000100.36
E1128350610 200603 000182.25 000175.96 0000100.36
B1112282217 200603 000427.14 000409.19 0000383.89
B1112282217 200602 000427.14 000409.19 0000383.89
B1112282217 200601 000427.14 000409.19 0000383.89
B6544536917 200603 000250.02 000236.82 0000144.32

Here Amt-1 & Amt-2 are PIC -9999999.99
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: Fri Jun 29, 2007 4:21 pm    Post subject: Reply with quote

You can't sum the values using PD format since they aren't PD values.

You can use the technique discussed in the "Sum a number with a decimal point" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
_________________
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
savi.sabari
Beginner


Joined: 11 Dec 2006
Posts: 6
Topics: 2

PostPosted: Sat Jun 30, 2007 8:50 am    Post subject: Reply with quote

Thanks Frank, In my shop we are using SYNCSORT, the same logic will apply for SYNCSORT. Any Example or earlier posted would be greatly appriciated.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Sun Jul 01, 2007 7:08 pm    Post subject: Reply with quote

savi.sabari,

Please SEARCH before posting. Check this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=1374&highlight=decimal

Hope this helps...

Cheers

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


Joined: 11 Dec 2006
Posts: 6
Topics: 2

PostPosted: Mon Jul 02, 2007 3:31 pm    Post subject: Reply with quote

My updated requirement is need to sum of the individual columns. Since the Amt-1 , Amt-2 and Amt-3 are in editing characters and each numeric field prefix with Sign.

For eg:
Code:

Policyno.    Date      Amt-1     Amt-2      Amt-3.
B3218655810 200603 000465.96 000391.52 0000044.80
B3218655810 200602 000465.96 000391.52 0000044.80
B3218655810 200601 000465.96 000391.52 0000044.80
E1128350610 200602 000182.25 000175.96 0000100.36
E1128350610 200601 000182.25 000175.96 0000100.36
E1128350610 200603 000182.25 000175.96 0000100.36
B1112282217 200603 000427.14 000409.19 0000383.89
B1112282217 200602 000427.14 000409.19 0000383.89
B1112282217 200601 000427.14 000409.19 0000383.89
B6544536917 200603 000250.02 000236.82 0000144.32
-----------------------------------------------------------------
Sum of  each item  XXXXXX.XX  XXXXX.XX  XXXXXX.XX
-----------------------------------------------------------------

The sum of the individual columns should be placed in the triler record.
Kolusu i tried in the earlier posted, but couldnt find it. Please give me the link if you already gave solution for similar kind of example.

Thanks in advance.
Savitha.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Jul 02, 2007 5:14 pm    Post subject: Reply with quote

savi.sabari,

You haven't provided us with complete details. What is the recfm and LRECL of the dataset and what is the file layout? from the little information you gave and based upon my assumption here is a job which will give you the desired results
Code:
//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD *
----+----1----+----2----+----3----+----4----+----5-
B3218655810 200603 000465.96 000391.52 0000044.80   
B3218655810 200602 000465.96 000391.52 0000044.80   
B3218655810 200601 000465.96 000391.52 0000044.80   
E1128350610 200602 000182.25 000175.96 0000100.36   
E1128350610 200601 000182.25 000175.96 0000100.36   
E1128350610 200603 000182.25 000175.96 0000100.36   
B1112282217 200603 000427.14 000409.19 0000383.89   
B1112282217 200602 000427.14 000409.19 0000383.89   
B1112282217 200601 000427.14 000409.19 0000383.89   
B6544536917 200603 000250.02 000236.82 0000144.32   
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *                                     
  SORT FIELDS=COPY                               
  OUTREC FIELDS=(01,80,                           
                 20,06,  $ AMT1 BEFORE DECIMAL   
                 27,02,  $ AMT1 AFTER DECIMAL     
                 30,06,  $ AMT2 BEFORE DECIMAL   
                 37,02,  $ AMT2 AFTER DECIMAL     
                 40,07,  $ AMT3 BEFORE DECIMAL   
                 48,02)  $ AMT3 AFTER DECIMAL     
                                                 
  OUTFIL REMOVECC,                               
  OUTREC=(01,80),                                 
  TRAILER1=(50C'-',/,                             
           'SUM  OF EACH ITEM: ',                 
            TOT=(81,08,ZD,EDIT=(IIIIIT.TT)),X,   
            TOT=(89,08,ZD,EDIT=(IIIIIT.TT)),X,   
            TOT=(97,09,ZD,EDIT=(IIIIIIT.TT)),/,   
            50C'-')                               
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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