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 

include value in different offset

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


Joined: 09 Dec 2004
Posts: 147
Topics: 19

PostPosted: Fri Apr 04, 2008 4:51 pm    Post subject: include value in different offset Reply with quote

requirement:
in certain byte, contain the offset, check the value in the offset, if it contain the value, copy to output

e.g.:
5th byte is the offset, the record will be included if the value in the offset is x'0F'
Is it possible in DFSORT?

input
Code:

----+----+----+----+----+----+----+----+
0000200000000000000000000000000000000000
0100000000000000000F00000000000000000000

0000100000000000000000000000000000000000
020000000E000000000000000000000000000000

0000100000000000000000000000000000000000
03005000000000F0000000000000000000000000

0000300000000000000000000000000000000000
04000000000000000000000000000E0000000000

...

the output will be
Code:

0000200000000000000000000000000000000000
0100000000000000000F00000000000000000000

0000100000000000000000000000000000000000
03005000000000F0000000000000000000000000
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Apr 04, 2008 5:05 pm    Post subject: Reply with quote

videlord,

Do you array of offsets you need to check or is it a fixed position? From your sample data it looks like it is an array

so try this

Code:

//SYSIN    DD *                       
  SORT FIELDS=COPY                   
  INCLUDE COND=(15,1,CH,EQ,X'0F',OR, 
                20,1,CH,EQ,X'0F',OR, 
                25,1,CH,EQ,X'0F')

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


Joined: 09 Dec 2004
Posts: 147
Topics: 19

PostPosted: Fri Apr 04, 2008 5:16 pm    Post subject: Reply with quote

thanks, kolusu.

The offsets are not fixed positions.
the record is VB format, record lenght can be more than 30k.
And in the sample input, all other bytes are ingored (simply code x'00'), they can be anything in real data, the "OR" doesn't work.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Apr 04, 2008 5:33 pm    Post subject: Reply with quote

videlord wrote:
thanks, kolusu.

The offsets are not fixed positions.
the record is VB format, record lenght can be more than 30k.
And in the sample input, all other bytes are ingored (simply code x'00'), they can be anything in real data, the "OR" doesn't work.


Since it is a VB file you need to add 4 bytes for the RDW. Another Alternative is to use Substring format on the entire length of x'05'. So if x'05' found any where in the record it wud be included.

Can you post the cobol layout of the file?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CraigG
Intermediate


Joined: 02 May 2007
Posts: 202
Topics: 0
Location: Viginia, USA

PostPosted: Fri Apr 04, 2008 10:41 pm    Post subject: Reply with quote

What format is the offset is a 1 byte binary or what?
Back to top
View user's profile Send private message
videlord
Beginner


Joined: 09 Dec 2004
Posts: 147
Topics: 19

PostPosted: Mon Apr 07, 2008 8:46 am    Post subject: Reply with quote

SMF data is one of the example.
The offset can be n bytes binary, it doen't matter how many bytes. (usually it's 2 bytes)
Back to top
View user's profile Send private message
CraigG
Intermediate


Joined: 02 May 2007
Posts: 202
Topics: 0
Location: Viginia, USA

PostPosted: Mon Apr 07, 2008 9:10 am    Post subject: Reply with quote

Quote:
What format is the offset is it 1 byte binary or what?


In the examples you show the offset as being x'20' and x'15' but the 'oF' is in positions 20 and 15. x'20' = 64 decimal and x'15' = 21 decimal.
Back to top
View user's profile Send private message
videlord
Beginner


Joined: 09 Dec 2004
Posts: 147
Topics: 19

PostPosted: Mon Apr 07, 2008 10:16 am    Post subject: Reply with quote

CraigG wrote:

In the examples you show the offset as being x'20' and x'15' but the 'oF' is in positions 20 and 15. x'20' = 64 decimal and x'15' = 21 decimal.


the sample is not good, i should change it to binary format.
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