View previous topic :: View next topic
|
Author |
Message |
suneelv
New User
Joined: 26 Aug 2008 Posts: 52 Location: inida
|
|
|
|
Hi,
I have a VB file with lenght of 4004. I want to retrieve one field which conains '11' length of 2 and it is defined as Binary.
how to retreive the binary field in the file.
Regards
Suneel |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
suneelv,
Do you need to copy the entire record into output if it has the value '11'? Is the Output LRECL the same as that of input - 4004? |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Suneel,
Also should the records be selected if '11' is in a fixed positiion or in any position in the record? |
|
Back to top |
|
|
suneelv
New User
Joined: 26 Aug 2008 Posts: 52 Location: inida
|
|
|
|
Hi,
In that file there is one Binary field which contains '11' , i want to retrieve the records which contains '11'.
Regards
Suneel |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Suneel,
Quote: |
In that file there is one Binary field which contains '11' , |
Field positions have to be told . Please post all the details when you first post a question. It would save all our time. |
|
Back to top |
|
|
suneelv
New User
Joined: 26 Aug 2008 Posts: 52 Location: inida
|
|
|
|
Hi,
The fields position start from 3 and length of 2. In that position it contains '11' ,i want whole records which contains '11' and the output file also be in VB format.
Regards
Suneel |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
suneelv,
You might try this SyncSort job. Goodluck
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN= Input file
//SORTOUT DD DSN= Output file
//SYSIN DD *
OPTION COPY
INCLUDE COND=(7,2,CH,EQ,C'11') |
|
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Arun,
From OP
Quote: |
length of 2 and it is defined as Binary.
|
So will the same SORT card work when the field is defined as Binary? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Aaru wrote: |
So will the same SORT card work when the field is defined as Binary? |
No. it will not work. I missed the binary part. It should have been
Code: |
//SYSIN DD *
OPTION COPY
INCLUDE COND=(7,2,BI,EQ,11)
|
Thanks for pointing out. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Arun,
Quote: |
Thanks for pointing out. |
No probs Dude. |
|
Back to top |
|
|
suneelv
New User
Joined: 26 Aug 2008 Posts: 52 Location: inida
|
|
|
|
Hi All,
Its working fine.thanks a lot for your help.
Regards
Suneel |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi,
For Binary field, the following may help you.
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN= Input file
//SORTOUT DD DSN= Output file
//SYSIN DD *
OPTION COPY
INCLUDE COND=(7,2,BI,ALL,X'F1F1')
/*
|
Here F1 is hexadecimal value of 1.
Regards
R KARTHIK |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
HI,
Dont consider the above one. Try the below
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN= Input file
//SORTOUT DD DSN= Output file
//SYSIN DD *
OPTION COPY
INCLUDE COND=(7,2,BI,EQ,X'F1F1')
/*
|
|
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Suneel,
Quote: |
Its working fine.thanks a lot for your help. |
Glad to know that its working fine. |
|
Back to top |
|
|
suneelv
New User
Joined: 26 Aug 2008 Posts: 52 Location: inida
|
|
|
|
Hi,
In this one only i want to check for '1' value alos where it present in position 5 and length of 2.
i have used
OPTION COPY
INCLUDE COND=((7,2,BI,EQ,11,OR,1)
i got the syntax error. please help me to retrieve 11 and 1 in starting position 3 and length of 2.
regards
suneel |
|
Back to top |
|
|
Shriram Jogdand
New User
Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
The Syntax should be
OPTION COPY
INCLUDE COND=(7,2,BI,EQ,11,OR,
6,1,BI,EQ,1)
Here I mentioned 6 instead of 5 because binary field is right justified. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
i want to check for '1' value alos where it present in position 5 and length of 2. |
Quote: |
please help me to retrieve 11 and 1 in starting position 3 and length of 2. |
Suneel,
Which one is correct? |
|
Back to top |
|
|
suneelv
New User
Joined: 26 Aug 2008 Posts: 52 Location: inida
|
|
|
|
Hi
The below one is working
OPTION COPY
INCLUDE COND=(7,2,BI,EQ,11,OR,
7,2,BI,EQ,1)
.
The value 1 also starting from position 3 and length of 2.
Thanks for all your help.
Regards
Suneel |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thank you for letting us know
d |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
Quote: |
OPTION COPY
INCLUDE COND=((7,2,BI,EQ,11,OR,1)
|
try
Code: |
OPTION COPY
INCLUDE COND=(7,2,BI,EQ,11,OR,7,2,BI,EQ,1)
|
Garry |
|
Back to top |
|
|
|