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
 

 

Using DFSORT need to add column values

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Vikram mf

New User


Joined: 08 Aug 2014
Posts: 2
Location: INDIA

PostPosted: Fri Aug 08, 2014 11:02 pm    Post subject: Using DFSORT need to add column values
Reply with quote

Vikram321 wrote:
Hi All,
I've got a new requirement in a development process and I'm stuck with below.

I have a input PS file which contains some record like below

1st column: Main account
2nd: Collateral acct
3rd: CUSIP
4th : some amount against CUSIP

I NEED AN OUTPUT FILE WHICH WILL HAVE SUMMED UP VALUES OF "AMOUNT" AGAINST EACH "COLLATERAL" ACCOUNT. IN THE 2ND COLUMN WE CAN SEE THAT WE HAVE A "COLLATERAL" ACCOUNT 34567854 AND IT HAS 5 DIFFERENT "CUSIPS" TAGGED AGAINST IT IN THE 3RD COLUMN AND IT HAS 5 DIFFERENT "AMOUNT" VALUES IN THE 4TH COLUMN. MY REQUIREMENT IS TO GET THE SUMMED UP VALUES OF ALL CUSIP "AMOUNT" TAGGED AGAINST A "COLLATERAL" ACCOUNT.

FOR EXAMPLE: COLLATERAL 34567854 WILL HAVE A TOTAL OF 15000 WHEN WE ADD ALL THE CUSIP AMOUNT TAGGED AGAINST IT.

Input file looks below:
Code:

=COLS>   ----+----1----+----2----+----3----+----4--
******   ***************************** TOP OF DATA
000001    ACCOUNT COLATERAL CUSIP     AMOUNT       
000002    12345678 34567854 09876556A 1000.00     
000003                      89567456E 2000.00     
000004                      89567456R 3000.00     
000005                      89567456T 4000.00     
000006                      89567456Y 5000.00     
000007             89651235 89567455Q 7000.00     
000008                      89567455W 1000.00     
000009                      89567455E 2000.00     
000010                      89567455R 3000.00     
000011                      89567455T 1000.00     
000012                      89567455Y 2000.00     
000013    12389658 34512554 09878656A 1000.00     
000014                      89567866E 2000.00     
000015                      89586456R 3000.00     
000016             89698735 89741455Q 4000.00     
000017                      89698455W 5000.00     
000018                      89852455E 7000.00     


BUT I NEED THE FILE IN BELOW FORMAT

summed up values of all amount in a group wise at collateral acct level
like
Code:
12345678                   34567854       09876556A             15000.00
                           89651235       89567455Q             16000.00
12389658                   34512554       09878656A             60000.00
                           89698735       89741455Q             16000.00
 


Card that i huv used:

Code:

INREC OVERLAY=(30:30,7,SFF,TO=ZD,LENGTH=7)                     
SORT FIELDS=(11,8,CH,A)                                         
SUM FIELDS=(30,7,ZD)                                           
OUTREC OVERLAY=(30:30,7,ZD,EDIT=(STTTTTTTTTTTTT.TT),SIGNS=(+,-))


USING ABOVE CODE I GOT BELOW OUTPUT FILE :

Code:
               
=COLS>   ----+----1----+----2----+----3----+----4----+----5
******   ***************************** TOP OF DATA ********
000001                      89567456E +0000000040000.00   
000002    12389658 34512554 09878656A +0000000001000.00   
000003    12345678 34567854 09876556A +0000000001000.00   
000004             89651235 89567455Q +0000000007000.00   
000005             89698735 89741455Q +0000000004000.00   


SYSOUT DETAILS:
Code:

ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
ICE751I 0 C5-I12416 C6-K90026 C7-K94453 C8-K94453 E9-K60824 C9-BASE   E5-K80744
ICE143I 0 BLOCKSET     SORT  TECHNIQUE SELECTED                                 
ICE250I 0 VISIT HTTP://WWW.IBM.COM/STORAGE/DFSORT FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 06:44 ON THU AU
          *                                                                     
            INREC OVERLAY=(30:30,7,SFF,TO=ZD,LENGTH=7)                         
            SORT FIELDS=(11,8,CH,A)                                             
            SUM FIELDS=(30,7,ZD)                                               
            OUTREC OVERLAY=(30:30,7,ZD,EDIT=(STTTTTTTTTTTTT.TT),SIGNS=(+,-))   
ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICETD1 ENVIRONMENT SELECTED
ICE252I 1 PARMLIB OPTIONS WERE MERGED WITH INSTALLATION MODULE DEFAULTS         
ICE088I 1 RB681PCL.STEP06  .        , INPUT LRECL = 131, BLKSIZE = 27903, TYPE =
ICE093I 0 MAIN STORAGE = (MAX,16777216,16777216)                               
ICE156I 0 MAIN STORAGE ABOVE 16MB = (16732144,16719856)                         
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=16777216,MAXLIM=1048576,MINLIM=262144,EQUALS=N,LIST=Y,ER
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=SHORT,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=12288,RESINV=0,SVC=109 ,CHECK=N,WRKREL=N,OUTREL=N,CKPT
ICE131I 0 OPTIONS: TMAXLIM=16777216,ARESALL=12288,ARESINV=0,OVERRGN=65536,CINV=Y
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=Y,TEXIT=N,LISTX=N,EFS=NONE    ,EXITC
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMI
ICE235I 0 OPTIONS: NULLOUT=RC0                                                 
ICE236I 0 OPTIONS: DYNAPCT=100,MOWRK=Y                                         
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTOUT                                   
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTIN                                   
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTIN                                   
ICE750I 0 DC 27903 TC 0 CS DSVNN KSZ 8 VSZ 8                                   
ICE752I 0 FSZ=213 RC  IGN=0 E  AVG=132 0  WSP=37 C  DYN=0 0                   
ICE751I 1 DE-K83743 D5-K91600 D9-K61787 E8-I12416                             
ICE090I 0 OUTPUT LRECL = 80, BLKSIZE = 27920, TYPE = FB   (SDB)               
ICE171I 0 SORTOUT LRECL OF 80 IS DIFFERENT FROM SORTIN(NN) LRECL OF 131 - RC=0
ICE080I 0 IN MAIN STORAGE SORT                                                 
ICE055I 0 INSERT 0, DELETE 12                                                 
ICE054I 0 RECORDS - IN: 17, OUT: 5                                             
ICE134I 0 NUMBER OF BYTES SORTED: 2227                                         
ICE253I 0 RECORDS SORTED - PROCESSED: 17, EXPECTED: 213                       
ICE199I 0 MEMORY OBJECT USED AS MAIN STORAGE = 0M BYTES                       
ICE299I 0 MEMORY OBJECT USED AS WORK STORAGE = 0M BYTES                       
ICE180I 0 HIPERSPACE STORAGE USED = 0K BYTES                                   
ICE188I 0 DATA SPACE STORAGE USED = 0K BYTES                                   
ICE052I 0 END OF DFSORT                                                       


Note: Datas are not in sorted order which is ok.
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1696
Location: NY,USA

PostPosted: Fri Aug 08, 2014 11:54 pm    Post subject:
Reply with quote

That is correct as per the sort card. You need to add a logic which does the sum till next collateral account number found. Currently, it is just on a collateral account alone.

I would prefer to write a COBOL.
Back to top
View user's profile Send private message
Vikram mf

New User


Joined: 08 Aug 2014
Posts: 2
Location: INDIA

PostPosted: Sat Aug 09, 2014 12:18 am    Post subject: Using DFSORT need to add column values
Reply with quote

HI Rohit,

1st of all thanks for ur response but sorry to say that as we are tester we do actually file validation mainly JCL using Sort/Dfsort. Is it possible to write a jcl using sort card to meet our req.

It will gr8 if you or anyone provide a solution in JCL
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm


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