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

Adding only corresponding records


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Wed May 14, 2008 2:35 am
Reply with quote

Hi, I have a fixed file of 255 bytes. The output file from the program is :

Code:
***************************** Top of Data ******************************
00001HEADER 200805130000060000642650634620000000000000000000           
0001 0000000000000000000042770 0090406 20080513  000004730453742200 DEBI
0002 0000000000000000000042770 0054790 20080513  000001164752053400 DEBI
0004 0000000000000000000042770 0556001 20080513  000000118494947600 DEBI
0040 0000000000000000000042770 0556004 20080513  000000113755900200 DEBI
0040 0000000000000000000042770 0     0 20080513  000000003348410800 DEBI
0002 0000000000000000000042770 0     0 20080513  000000295701292000 DEBI
00001TRAILER200805130000060000642650634620000000000000000000           
**************************** Bottom of Data ****************************



Now,I need to change the output based on the first 4 bytes (leaving header and trailer as is) .

The output should contain only record for each of '0001','0002','0004' and '0040'. There is a amount field in position 50 for length of 18.

So,based on the code on first 4 bytes,I need to add the corresponding value in pos 51 for 18 and print only one record.

Please advise if I need to clarify on any part. Thanks.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed May 14, 2008 3:32 am
Reply with quote

The following DFSORT JCl will give you desired results

Code:

//STEP0100 EXEC PGM=ICEMAN                                   
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD DSN=your input file,
//            DISP=SHR
//SORTOUT  DD DSN=your output file,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
/*
//SYSIN    DD *                                                 
  OPTION EQUALS                                                 
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(256:C'1')),                 
        IFTHEN=(WHEN=(6,6,CH,EQ,C'HEADER'),OVERLAY=(256:C'0')),
        IFTHEN=(WHEN=(6,7,CH,EQ,C'TRAILER'),OVERLAY=(256:C'9'))
                                                               
  SORT FIELDS=(256,01,CH,A,01,04,CH,A)                         
  SUM FIELDS=(50,18,ZD)                                         
  OUTREC BUILD=(01,255)                                         
/*


Hope this helps...

Cheers
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Wed May 14, 2008 4:59 pm
Reply with quote

Thank you.

I will give it a try and let you know the results.

Will it give me one record for each 0001 ,0002 and 0040 ...?
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Wed May 14, 2008 7:02 pm
Reply with quote

Not getting what is expected. Please let me explain better..!!
For this file :
Code:
***************************** Top of Data ******************************
00001HEADER 200805090000030000000000000000000000000000000000           
0001 0000000000000000000042770 0009330 20080509  000000000000010000 DEBI
0001 0000000000000000000042770 0009330 20080509  000000000000020000 DEBI
0002 0000000000000000000042770 0009330 20080509  000000000000003000 DEBI
0001 0000000000000000000042770 0009330 20080509  000000000000030000 DEBI
0040 0000000000000000000042770 0009330 20080509  000000000000000010 DEBI
00001TRAILER200805090000030000000000000000000000000000000000           
         
**************************** Bottom of Data ****************************



the output should be :


Code:
***************************** TOP OF DATA ******************************
00001HEADER 200805090000030000000000000000000000000000000000           
0001 0000000000000000000042770 0009330 20080509  000000000000060000 DEBI
0002 0000000000000000000042770 0009330 20080509  000000000000003000 DEBI
0040 0000000000000000000042770 0009330 20080509  000000000000000010 DEBI
00001TRAILER200805090000030000000000000000000000000000000000           
**************************** BOTTOM OF DATA ****************************
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Wed May 14, 2008 7:29 pm
Reply with quote

Sorry.. I am not sure why..but it works now !!

I might have some errors while coding i guess.. on resubmission it works perfect.. Thanks a lot !!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Adding first / last acct numerber to ... DFSORT/ICETOOL 7
Search our Forums:

Back to Top