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
 

 

Accessing first bit of PD value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 193
Location: india

PostPosted: Wed May 03, 2017 6:03 am    Post subject: Accessing first bit of PD value
Reply with quote

Hello,

I am trying to figure out a way to access the first number for the PD value but without converting the data into ZD format.

For eg.

Code:
321
00C


I just want to use include condition on the first number i.e. 3 without converting the PD value to ZD. Any suggestions, please.

Regards,
Rajat
Back to top
View user's profile Send private message

rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 193
Location: india

PostPosted: Wed May 03, 2017 6:27 am    Post subject: Re: Accessing first bit of PD value
Reply with quote

rajatbagga wrote:
Hello,

I am trying to figure out a way to access the first number for the PD value but without converting the data into ZD format.

For eg.

Code:
321
00C


I just want to use include condition on the first number i.e. 3 without converting the PD value to ZD. Any suggestions, please.

Regards,
Rajat


Hello,

In addition to the earlier requirement, I also want to figure out a way to access the last 2 numbers of the PD value. 01 in this case without converting the data into ZD.

Regards,
Rajat
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed May 03, 2017 7:37 am    Post subject:
Reply with quote

For your first condition, can't you check for
Code:
1,3,PD,GE,30000,AND,1,3,PD,LE,39999
OR
Code:
1,1,CH,GE,X'30',AND,1,1,CH,LE,X'39'
assuming data starts at position-1?

It is not so clear what you want to do with the last digit here. If you could show some sample input records and what you expect out of it, it might help.
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 193
Location: india

PostPosted: Wed May 03, 2017 8:30 am    Post subject:
Reply with quote

Thanks Arun,

Yes, I did the same what you suggested. Thanks for that.

Coming on the second aspect

Input

Code:
321
00C
320
00C

I want to only include the data with the last 2 digits of the number equal to 00 to satisfy the condition without converting the data into ZD.

output

Code:
320
00C


Regards, Rajat
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed May 03, 2017 9:23 am    Post subject:
Reply with quote

Apply similar check here
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 193
Location: india

PostPosted: Wed May 03, 2017 1:13 pm    Post subject:
Reply with quote

Arun Raj wrote:
Apply similar check here


I can certainly have the GE 3000 LT 4000 condition with the first requirement. But how do I apply the similar logic as I cannot address to the last two digits in one go.

You mean to say check for '0C' for the last digit and then X'10' X'20' X'30' ...X'90' for second last digit?

Regards,
Rajat
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10292
Location: italy

PostPosted: Wed May 03, 2017 1:58 pm    Post subject: Reply to: Accessing first bit of PD value
Reply with quote

why waste time on a complex solution when converting to ZD into a temporary field would be so much simpler ?
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 193
Location: india

PostPosted: Wed May 03, 2017 2:14 pm    Post subject: Re: Reply to: Accessing first bit of PD value
Reply with quote

enrico-sorichetti wrote:
why waste time on a complex solution when converting to ZD into a temporary field would be so much simpler ?

I thought maybe there is a simpler way to directly address the digits in the PD value .. But after exploring the options I agree with you.. better approach would be to convert the data into ZD in INREC and latter covert it back to PD.

Thanks for the suggestions

Regards
Rajat
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10292
Location: italy

PostPosted: Wed May 03, 2017 3:20 pm    Post subject: Reply to: Accessing first bit of PD value
Reply with quote

Quote:
convert data into ZD in INREC and latter covert it back to PD.


why the double jump, extend the input record with thr PD converted to ZD and after that just drop the useless bytes
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed May 03, 2017 5:42 pm    Post subject:
Reply with quote

Quote:
I cannot address to the last two digits in one go
I think I did n't pay attention you mentioned - 2 digits. Enrico has already given a clear hint on what you need to do. Read on the 'OVERLAY' parameter if you are not familiar with that. Good luck.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1031
Location: Oostende, Belgium

PostPosted: Wed May 03, 2017 9:49 pm    Post subject:
Reply with quote

Use "BI" and bit positions!!!
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 128
Location: Maryland

PostPosted: Thu May 04, 2017 12:22 am    Post subject:
Reply with quote

rajatbagga wrote:
Coming on the second aspect

Input
Code:
321
00C
320
00C

I want to only include the data with the last 2 digits of the number equal to 00 to satisfy the condition without converting the data into ZD.

output
Code:
320
00C

Code:
 INCLUDE COND=(2,2,CH,BZ,B'0000111111110000') 'BZ' = "bits are zeroes"

or
Code:
 INCLUDE COND=(2,2,BI,BZ,X'0FF0') 'BZ' = "bits are zeroes"
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Access SQLCA fields inside a stored p... gangapd DB2 6 Thu Oct 27, 2016 10:20 am
No new posts Cobol DB2 package accessing differen... Mainak_Dalal DB2 1 Tue Jan 26, 2016 12:57 am
No new posts Accessing Last Record of set seahawk789 JCL & VSAM 6 Sun Aug 09, 2015 4:19 am
No new posts Stored Procedure accessing VSAM yogesh suryawanshi DB2 9 Wed Mar 18, 2015 6:14 pm
No new posts Reg Accessing IMS DB Using ODBC Drivers satish.ms10 IMS DB/DC 6 Wed Nov 26, 2014 6:59 pm


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