Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Tue Apr 04, 2006 10:59 am Post subject:
vkphani,
It is very easy. Add a seqnum at the end of every record using OUTREC FIELDS and now check for all spaces in the first 500 bytes only seqnum 1 using OMIT on OUTFIL and while writing out chop off the seqnum that you added.
I am trying to delete a blank record from the input file and writing to the output file after deleting. The blank record can present at any position, not necessarily the first record.My original code looks like below:
This modified code works if and only of the first line is blank. If I want to check in the entire file what to do? LRECL of both the files is 500 and format is FB.
This will delete all of the blank records anywhere in the file. _________________ 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
Thanks a lot for the help Yaeger.
But I donot know why this SYSIN card is not working.
The data in the input file is as below:
Code:
000165 APTL 096 07162004 3612345 Mary Smith
000166 APMI 096 03232006 3876838 Mary Smith
000167 APCA 096 03232006 3876836 Mary Smith
000168 APGD 096 03232006 3873908 Mary Smith
000169
The data in the output file is coming as below:
Code:
000001
000002 APBH 096 05012006
000003 APCA 096 03232006 3876836 Mary Smith
000004 APCA 096 04292006 3887901 PHILIP BESHOFF
000005 APCA 096 04282006 3889190 MICHAEL SIMKO
000006 APCA 096 04282006 3889221 TAYLER CARANO
The blank record is present in the last line in the input file. This blank record is coming at the first line in the output file. It is not getting deleted. Please help me with this.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Thu May 04, 2006 12:52 pm Post subject:
Quote:
The blank record is present in the last line in the input file. This blank record is coming at the first line in the output file. It is not getting deleted. Please help me with this.
Are you sure that the last record is all spaces ? Do a hex on post the contents of just the last record.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu May 04, 2006 1:07 pm Post subject:
Well, since the "blank line" is sorted to the top, it obviously has a blank in position 1 (blank = X'40' sorts before 'A' = X'C1'), but that's all we know from the information you posted. As Kolusu says, you need to display the line in hex to see if it is really all blanks = X'40's. You can use this DFSORT job to display the lines that start with a blank in position 1 in hex:
Then you can look at the //SYSOUT output to see if those lines are all blanks = X'40's. _________________ 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
Last edited by Frank Yaeger on Thu May 04, 2006 2:41 pm; edited 1 time in total
I got the RC=16 after submitting the code given by you.
Code:
SYSIN :
INCLUDE COND=(1,1,CH,EQ,X'40')
OUTREC FIELDS=(1,150,HEX)
WER164B 1,028K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 1,004K BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER267A SORT STATEMENT : STATEMENT NOT FOUND
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Thu May 04, 2006 2:10 pm Post subject:
vkphani,
Quote:
WER267A SORT STATEMENT : STATEMENT NOT FOUND
That should give you a clue .You are missing SORT FIELDS=COPY.
Your orginal requirement was to skip the record if all the 500 bytes are spaces. Now it is different. Do you need to skip records if x'40' or x'3f' is found anywhere in the record?
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu May 04, 2006 2:39 pm Post subject:
Kolusu,
Don't you love it. _________________ 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
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