MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Omitting records with null value in field

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
newcobol
Beginner


Joined: 20 Apr 2006
Posts: 88
Topics: 22

PostPosted: Mon Nov 04, 2013 3:33 pm    Post subject: Omitting records with null value in field Reply with quote

i need to omit records with null value in a field. currently the only syntax in sort is sort=copy.
the file is ftp's up to the mainframe, the only description i have of the file is in the step after the sort that loads it to the table. this is the load card:
Code:

LOAD,DATA LOG NO INDDN SYSREC00 REPLACE
   COPYDDN(IMAGESET)
   STATISTICS TABLE(ALL) INDEX(ALL)
   SORTKEYS
INTO TABLE  CACRADB.TDUNS_CSAD_SHORT
 (
 CSAD_LOC_NO                            POSITION(       1         )
 INTEGER EXTERNAL(9)           ,
 CSAD_CRED_SCR_PCTL                     POSITION(       10        )
 INTEGER EXTERNAL(3) NULLIF(10:10)=' ',
 CSAD_TOT_SUITS                         POSITION(      13         )
 INTEGER EXTERNAL(5)  NULLIF (13:13)= ' ',
 CSAD_TOT_JUDGMNTS                      POSITION(      18         )
 INTEGER EXTERNAL(5)  NULLIF (18:18)= ' ',
 CSAD_PAYEXP_NUMBER                     POSITION(      23         )
 INTEGER EXTERNAL(5)  NULLIF (23:23)= ' ',
 CSAD_PAYEXP_SLOW                       POSITION(      28         )
 INTEGER EXTERNAL(5)  NULLIF (28:28)= ' ',
 CSAD_PAYEXP_NEGATV                     POSITION(      33         )
 INTEGER EXTERNAL(5)  NULLIF (33:33)= ' ',
 CSAD_PAYEXP_SATISF                     POSITION(      38         )
 INTEGER EXTERNAL(5)  NULLIF (38:38)= ' ',
 CSAD_PAYEXP_PAST90                     POSITION(      43         )
 INTEGER EXTERNAL(5)  NULLIF (43:43)= ' ',
 CSAD_RESIDENCE_OPR                     POSITION(      48         )
 CHAR(                      1)
 )


does anyone know the syntax for the first omit condition for the field starting in column 10? if i get one i should be able to do 'ands' modify the syntax for the next ones.
thanks
Back to top
View user's profile Send private message
newcobol
Beginner


Joined: 20 Apr 2006
Posts: 88
Topics: 22

PostPosted: Mon Nov 04, 2013 3:35 pm    Post subject: Reply with quote

i tried this so far but not working yet:
Code:

SORT FIELDS=COPY
OMIT COND=((10,1,ZD,EQ,X'00'))
                                        *
END
Back to top
View user's profile Send private message
newcobol
Beginner


Joined: 20 Apr 2006
Posts: 88
Topics: 22

PostPosted: Mon Nov 04, 2013 3:36 pm    Post subject: Reply with quote

it did not paste correctly. the asterisk marking the error should but under the X
Back to top
View user's profile Send private message
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Mon Nov 04, 2013 4:34 pm    Post subject: Reply with quote

1) why have you defined the field as ZD?
2) is the value that you are testing for really binary zero, or is it space? Don't be confused by NULL (which has no value) and binary zero, which outside of the mainframe in data is often referred to as null (like a null-terminated field).
Back to top
View user's profile Send private message
newcobol
Beginner


Joined: 20 Apr 2006
Posts: 88
Topics: 22

PostPosted: Mon Nov 04, 2013 4:37 pm    Post subject: Reply with quote

i was told to define it that way. no one here is sure how to do this in the shop. the value im testing for is a null. after this sort, they dont want rows being loaded if there are null values. so this sort should not copy them all, it should omit the nulls. i am googling all over and reading manual, but not finding the syntax i need. what should it be defined as?
Back to top
View user's profile Send private message
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Mon Nov 04, 2013 6:41 pm    Post subject: Reply with quote

If the correct value for indicating NULL is your case is binary zero, then use CH,EQ,X'00'.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Mon Nov 04, 2013 10:27 pm    Post subject: Reply with quote

Your load card shows that the NULL value is a Space so you should be checking for a space instead of binary zeroes. Use the following

Code:

 OMIT COND=(10,1,CH,EQ,C' ',OR,
            13,1,CH,EQ,C' ',OR,
            18,1,CH,EQ,C' ',OR,
            23,1,CH,EQ,C' ',OR,
            28,1,CH,EQ,C' ',OR,
            33,1,CH,EQ,C' ',OR,
            38,1,CH,EQ,C' ',OR,
            43,1,CH,EQ,C' ')

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
newcobol
Beginner


Joined: 20 Apr 2006
Posts: 88
Topics: 22

PostPosted: Tue Nov 05, 2013 10:58 am    Post subject: Reply with quote

you are right Kolusu, i got there last night with some trial and error. I was trying to understand the 'integer external' code in the load card and tried it this way and it worked. I am not sure i thoroughly understand what that load is doing
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Tue Nov 05, 2013 11:57 am    Post subject: Reply with quote

Suggest you study & understand why/how your code is working (and come back here and ask if there are doubts).

It is most important to understand what is running on our systems . . . Cool
_________________
All the best,

di
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group