Joined: 23 Jan 2009 Posts: 32 Location: Tamil nadu
Hi Frank,
***************************** Top of Data ******************************
"AS",0,4,"BRITTANY COUNT",20030224,"AA","Y","L","G","V",000000,0,0.00,0.
"SE",0,5,"ROBERT LEE V",20030224,"AA","Y","L","G","V",000000,1,1
"BG",0,6,"SAM, L GEORGE",0,"**","Y","N","D","V",000000,5,3.00,0.000000,
"BT",0,7,"FRANK JEN",20030224,"AA","Y","N","D","V",000000,0,9
"VE",0,8,"MIOME BETH",20050905,"AA","Y","N","G","V",000000,41,-1771091
**************************** Bottom of Data ****************************
For the above input, I get the below one as the output..
0
1
000000
0
41
But the expected one is
0
1
5 -> instead of 5 , 000000 is picked here, as there is an extra comma in the third row SAM, L GEORGE
0
41
Is there a way in SORT to face such exceptions. The exception may occur in any filed other than the name field.
Also an additional requirement is to get the output sorted in ascending order with the count of no: of zero entries, no: of non-zero entries and total no: of records. For example the final output may look like
0
0
1
5
41
Zero entries: 2
Non-zero entries:3
Total records: 5 (Hope this will help for the total count..OUTFIL REMOVECC,NODETAIL,TRAILER1=(COUNT)
Joined: 23 Jan 2009 Posts: 32 Location: Tamil nadu
Got the result.. Thanks a lot
Also can you help me with the below,
An additional requirement is to get the output sorted in ascending order with the count of no: of zero entries, no: of non-zero entries and total no: of records. For example the final output may look like
0
0
1
5
41
No of zero entries: 2
No: of Non-zero entries:3
Total records: 5 (Hope this will help for the total count..OUTFIL REMOVECC,NODETAIL,TRAILER1=(COUNT)
Joined: 23 Jan 2009 Posts: 32 Location: Tamil nadu
Hi,
Great trick to use "PAIR=QUOTE" to squeeze out blanks between a PAIR.
And does it consider the text inbetween two apostrophes as a pair to squeeze with ?
It would be great if you could provide a small description on
=(%=(ENDBEFR=C','
what the % stands for ?
I tried to looking into User Guide for DFSORT but I am not able to figure it out. Pardon me if it is out there and I have missed it.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
Great trick to use "PAIR=QUOTE" to squeeze out blanks between a PAIR.
And does it consider the text inbetween two apostrophes as a pair to squeeze with ?
PAIR=QUOTE uses quote pairs. PAIR=APOST used apostrophe pairs.
Quote:
It would be great if you could provide a small description on
=(%=(ENDBEFR=C','
what the % stands for ?
I tried to looking into User Guide for DFSORT but I am not able to figure it out. Pardon me if it is out there and I have missed it.
DFSORT's PARSE function is fully documented in "z/OS DFSORT Application Programming Guide". Start here:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
An additional requirement is to get the output sorted in ascending order with the count of no: of zero entries, no: of non-zero entries and total no: of records.
Here's a DFSORT job that will do what you asked for:
Joined: 23 Jan 2009 Posts: 32 Location: Tamil nadu
I have got the output written into a FB file
Record format . . . : FB
Record length . . . : 40
Block size . . . . : 27960
But how to get the above counts "Zero entries, Non-zero entries and Total count" with the above suggested code. I tried modifying the character position by +4 and -4 (As the above code was written for VB file). But I get the error with the below code
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
It worked fine. Thanks a lot.
Quote:
I have got the output written into a FB file ...
Are we talking about a different situation now? What exactly is the new situation? Are you starting with a VB file as input and creating an FB file as output or what?
Quote:
But I get the error with the below code
What error? You aren't showing any error message. I'm not a mindreader.
Quote:
//OPTION COPY
...
Why do you have // in these control statements - JCL statements start with // - DFSORT control statements start with a blank.
Please start over and explain clearly exactly what you're trying to do in this new situation.
Joined: 23 Jan 2009 Posts: 32 Location: Tamil nadu
I am talking on the same situation. Sorry for not detailing the requirement. Let me brief it now.
I wanted the entire sort to be done on a FB file. So I wrote the initial VB file data into a FB file using
OPTION COPY
OUTFIL CONVERT,OUTREC=(5,200)
and then used the code given by Frank on March 15th. I slightly modified it as below with FIXLEN=10. The code works fine till sorting the data in ascending order.
But I am not able to get the correct output with the Trailer section of the code(given below). Because the positions change for a FB file.
Since I couldnt understand the significance of the code OVERLAY=(11:C'101')), , I am not able to modify it as per my requirement.