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

Syncsort a flat file based on a 15 byte account number


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
baljinders

New User


Joined: 21 Aug 2006
Posts: 72

PostPosted: Wed Jul 06, 2011 8:41 am
Reply with quote

Hi,

I am trying to sort a flat file based on a 15 byte account number. The problem is the below card is successfully eliminating account number fields which have either spaces or low values in them. But it is not eliminating a record which has both spaces and low values in it.


Sort card is ,

Code:

     SORT FIELDS=COPY               

          OMIT COND = (18,15,CH,EQ,C' ',OR, 18,15,CH,EQ,X'00')




Example,

account field which does not get eliminated. It has first 12 bytes as spaces and last three as low values.

Record field
-------


Code:
             ...



Hex representation of the above field.
-----


Code:
             ...

4444444444444000
0000000000000000



Does, anybody has any idea what is wrong here ?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Jul 06, 2011 9:08 am
Reply with quote

Hello,

Topic has been moved as it says Syncsort (not DFSORT).

Quote:
Does, anybody has any idea what is wrong here ?
If i understand, the code is simply wrong. . .

Look closely at the code you have used and consider if you had coded some programming language.

Quote:
But it is not eliminating a record which has both spaces and low values in it.
Nothing in the OMIT conditions tell the sort to do this. . .
Back to top
View user's profile Send private message
baljinders

New User


Joined: 21 Aug 2006
Posts: 72

PostPosted: Wed Jul 06, 2011 9:32 am
Reply with quote

Thanks Dick,

The file that i am trying to sort is the ouput of a cobol program. I'll look into the code tomorrow and try to figure out the problem and get back with the findings.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Jul 06, 2011 10:16 am
Reply with quote

Hello,

Good luck icon_smile.gif

Keep in mind the having the process run as you want is that there is a clear understanding of what should happen icon_wink.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Jul 06, 2011 11:03 am
Reply with quote

Quote:
I am trying to sort a flat file based on a 15 byte account number. The problem is the below card is successfully eliminating account number fields which have either spaces or low values in them
If you're trying to extract only character numeric values, you could try the NUM parameter as below.
Code:
 INCLUDE COND=(18,15,FS,EQ,NUM)
If the account number can have alphabets as well, then you might need to check for each position separately for a
space/low-value.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Jul 06, 2011 7:35 pm
Reply with quote

Hi Arun,

So far, i don't believe i understand just what should happens when this "works". . . icon_confused.gif

d
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Jul 11, 2011 1:49 pm
Reply with quote

Hi Dick,

The OP was trying to omit all accounts that were blanks or low-values or a combination of both. So I was suggesting an alternative if the account has only numeric data, include only those.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Mon Jul 11, 2011 7:37 pm
Reply with quote

Hi Arun,

Thanks for the clarification icon_smile.gif

As posted, the "requirement" was just clear as mud to me. . .

No real description, insufficient sample data, etc. I have no idea why some people believe showing one sample record for a process that needs to deal with multiple conditions will get them the help they want.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Jul 11, 2011 9:04 pm
Reply with quote

baljinders wrote:
The file that i am trying to sort is the ouput of a cobol program.

Obviously, the best thing to do would be to prevent the cobol program from writing erroneous data.
And if you can't solve the problem at the source you can try:
Code:
  OMIT COND=(18,15,SS,EQ,C' ',OR,18,15,SS,EQ,X'00') 
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Mon Jul 11, 2011 10:52 pm
Reply with quote

Hello,

To follow on with what Marso said (but more strongly):
It is nonsense to have "production" code that creates invalid data output. Rather than fiddling with fixing the output in another step, the problem code should be fixed.

Any proper review/promotion will not allow this to be placed into production.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Tue Jul 12, 2011 12:02 am
Reply with quote

Quote:
Rather than fiddling with fixing the output in another step, the problem code should be fixed.


unfortunately too many of the topics being discussed deal with poor coding and poor overall application architecture icon_oak.gif

why oh why so many counting and so many get rid of duplicates issues
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Tue Jul 12, 2011 12:20 am
Reply with quote

Quote:
unfortunately too many of the topics being discussed deal with poor coding and poor overall application architecture

why oh why so many counting and so many get rid of duplicates issues
Enrico, I think you answered your own question before you asked it! icon_smile.gif Our PC / server applications developers now think it is normal and usual to have to manually run processes that fail, even if they are production processes. They just don't seem to understand how to build a robust application architecture.
Back to top
View user's profile Send private message
baljinders

New User


Joined: 21 Aug 2006
Posts: 72

PostPosted: Thu Jul 14, 2011 7:21 am
Reply with quote

Sorry for the late reply....

The problem was fixed in the cobol code itself. Proper initialization did the trick.

Thanks everyone for your time and effort.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Thu Jul 14, 2011 9:37 am
Reply with quote

Good to hear it is working and that the better resoluton was used icon_smile.gif

Thanks for letting us know,

d
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 7
No new posts Syncsort help SYNCSORT 3
No new posts SYNCSORT-DB2 interface SYNCSORT 0
No new posts Sort based on the record type DFSORT/ICETOOL 1
No new posts how to eliminate null indicator value... DB2 7
Search our Forums:

Back to Top