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

How to Retrieve values from VB file


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

New User


Joined: 26 Aug 2008
Posts: 52
Location: inida

PostPosted: Wed Dec 17, 2008 11:04 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Dec 17, 2008 11:13 am
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Dec 17, 2008 11:28 am
Reply with quote

Suneel,

Also should the records be selected if '11' is in a fixed positiion or in any position in the record?
Back to top
View user's profile Send private message
suneelv

New User


Joined: 26 Aug 2008
Posts: 52
Location: inida

PostPosted: Wed Dec 17, 2008 11:30 am
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Dec 17, 2008 11:33 am
Reply with quote

Suneel,

Quote:
In that file there is one Binary field which contains '11' ,


Field positions have to be told icon_sad.gif . Please post all the details when you first post a question. It would save all our time.
Back to top
View user's profile Send private message
suneelv

New User


Joined: 26 Aug 2008
Posts: 52
Location: inida

PostPosted: Wed Dec 17, 2008 11:36 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Dec 17, 2008 11:53 am
Reply with quote

suneelv,

You might try this SyncSort job. Goodluck icon_smile.gif
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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Dec 17, 2008 12:10 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Dec 17, 2008 12:25 pm
Reply with quote

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. icon_evil.gif It should have been
Code:
//SYSIN    DD *             
  OPTION COPY               
  INCLUDE COND=(7,2,BI,EQ,11)

Thanks for pointing out. icon_smile.gif
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Dec 17, 2008 12:28 pm
Reply with quote

Arun,

Quote:
Thanks for pointing out.


No probs Dude.
Back to top
View user's profile Send private message
suneelv

New User


Joined: 26 Aug 2008
Posts: 52
Location: inida

PostPosted: Wed Dec 17, 2008 12:33 pm
Reply with quote

Hi All,

Its working fine.thanks a lot for your help.

Regards
Suneel
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Wed Dec 17, 2008 12:33 pm
Reply with quote

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
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Wed Dec 17, 2008 12:36 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Dec 17, 2008 1:29 pm
Reply with quote

Suneel,

Quote:
Its working fine.thanks a lot for your help.


Glad to know that its working fine.
Back to top
View user's profile Send private message
suneelv

New User


Joined: 26 Aug 2008
Posts: 52
Location: inida

PostPosted: Wed Dec 17, 2008 4:51 pm
Reply with quote

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
View user's profile Send private message
Shriram Jogdand

New User


Joined: 14 Oct 2008
Posts: 65
Location: Pune

PostPosted: Wed Dec 17, 2008 5:02 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Dec 17, 2008 9:41 pm
Reply with quote

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
View user's profile Send private message
suneelv

New User


Joined: 26 Aug 2008
Posts: 52
Location: inida

PostPosted: Thu Dec 18, 2008 9:55 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Dec 18, 2008 10:02 am
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

d
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1205
Location: Dublin, Ireland

PostPosted: Thu Dec 18, 2008 2:35 pm
Reply with quote

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
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 how to eliminate null indicator value... DB2 7
No new posts Format Binary file to EBCDIC JCL & VSAM 4
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
Search our Forums:

Back to Top