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
 

 

Adding only corresponding records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Adding only corresponding records
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    Post subject: Reply to: Adding only corresponding records
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    Post subject: Thank you.
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    Post subject: Not getting what is expected. Please let me explain better
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    Post subject: Sorry.. I am not sure why..but it works now !!
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    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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


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