View previous topic :: View next topic
|
Author |
Message |
kirankumarj
New User
Joined: 18 Dec 2007 Posts: 51 Location: delaware
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
kirankumarj
New User
Joined: 18 Dec 2007 Posts: 51 Location: delaware
|
|
|
|
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 |
|
|
kirankumarj
New User
Joined: 18 Dec 2007 Posts: 51 Location: delaware
|
|
|
|
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 |
|
|
kirankumarj
New User
Joined: 18 Dec 2007 Posts: 51 Location: delaware
|
|
|
|
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 |
|
|
|
|