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
 

 

Syncsort a flat file based on a 15 byte account number

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort a flat file based on a 15 byte account number
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

Site Director


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

PostPosted: Wed Jul 06, 2011 9:08 am    Post subject:
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    Post subject: Reply to: syncsort problem
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

Site Director


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

PostPosted: Wed Jul 06, 2011 10:16 am    Post subject:
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: 2165
Location: @my desk

PostPosted: Wed Jul 06, 2011 11:03 am    Post subject:
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

Site Director


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

PostPosted: Wed Jul 06, 2011 7:35 pm    Post subject: Reply to: syncsort problem
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: 2165
Location: @my desk

PostPosted: Mon Jul 11, 2011 1:49 pm    Post subject:
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

Site Director


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

PostPosted: Mon Jul 11, 2011 7:37 pm    Post subject:
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: 1219
Location: Israel

PostPosted: Mon Jul 11, 2011 9:04 pm    Post subject: Re: Reply to: syncsort problem
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

Site Director


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

PostPosted: Mon Jul 11, 2011 10:52 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue Jul 12, 2011 12:02 am    Post subject: Reply to: Syncsort a flat file based on a 15 byte account nu
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: 7913
Location: Bellevue, IA

PostPosted: Tue Jul 12, 2011 12:20 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Jul 14, 2011 9:37 am    Post subject: Reply to: Syncsort a flat file based on a 15 byte account nu
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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