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

Scanning a Packed decimal value


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cdaniel_el

New User


Joined: 12 Jun 2006
Posts: 9
Location: OH, USA

PostPosted: Tue Jun 13, 2006 12:32 am
Reply with quote

Hi
Is there any ways to scan a comp-3 variable in a grp of variable knowing its index and offset.
The main purpose is..for one of my friends program, he need got a SOC7 abend...since his input received packed decimal value among the numeric grp item.
Now he needs to drop the packed decimal values and need to process all the numeric data...is there any way to do it. pls let me know

Thx
Dan
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Jun 13, 2006 1:09 am
Reply with quote

Dan,

I'm a bit confused as to what you need to do.

Can you give an example of what you need? I'm sure it's doable.

Dave
Back to top
View user's profile Send private message
cdaniel_el

New User


Joined: 12 Jun 2006
Posts: 9
Location: OH, USA

PostPosted: Tue Jun 13, 2006 6:30 am
Reply with quote

Hi Dave,
Actually one of my friend had a problem, wherein his input file started receiving packed decimal instead of the regular numeric values. Actually he got this strange values from the upstream systems, which is beyond his control.

Now the challenge hear is he need to identify the variable as numeric or packed decimal. If its gonna to be a packed decimal he will drop off (using CONTINUE stt), if its going to be a numeric value then he needs to do the regular processing.

Can u pls throw in some light on how to scan the same.

Thx
Dan
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Tue Jun 13, 2006 8:50 am
Reply with quote

I am still not sure whats the problem here, but all I understand is we need shud not process some data when its PD , and process it when it is numeric ( ZD ).

I have got a question, Why do you need to 'drop' the variable when it is PD.You can declare a normal numeric variable (say 9(9)).and move the input variable in to this and use this variable hence forth.
Even if its an ZD or PD, it will take care.


ap_mainframes.
Back to top
View user's profile Send private message
cdaniel_el

New User


Joined: 12 Jun 2006
Posts: 9
Location: OH, USA

PostPosted: Tue Jun 13, 2006 8:53 am
Reply with quote

the project requirement forbids me to neglect the variables with PD. We need to process only the ZD values. Is there any ways to find out?
Back to top
View user's profile Send private message
sunnyk

New User


Joined: 20 Oct 2004
Posts: 59

PostPosted: Tue Jun 13, 2006 10:39 am
Reply with quote

Well it's a bit tough to decode this problem, but i feel that if by any chance you can check for the last character/position of the COMP-3 then you can make out whether it's PD or not. Like we 'll have D or F in the last position to indicate whether it's -Ve or +Ve which is not the case with normal numeric/numeric edited fields. So we 'll check for D or F or if there are more chars in PD to indicate +ve or -ve values in last nibble and proceed further.

I guess you can try exploring more on this and in timebeing i 'll try thinking on code for the same.

Regds
Sunny
Back to top
View user's profile Send private message
sunnyk

New User


Joined: 20 Oct 2004
Posts: 59

PostPosted: Tue Jun 13, 2006 11:00 am
Reply with quote

I forgot to mention C denotes +ve, D denotes -Ve and F denotes unsigned. I guess there are no more symbols denoting anything else in COMP-3.
So we 'll check for above three chars in last nibble of PD field which i think is a tough job(as we can't break byte into nibble in COBOL program) , but just give it a thought. There may be an easy solution for the above scenario.

But i fail to understand even if the values are coming as PD also, whats the problem in that??? Can you clarify.

Regds
Sunny
Back to top
View user's profile Send private message
sunnyk

New User


Joined: 20 Oct 2004
Posts: 59

PostPosted: Tue Jun 13, 2006 11:11 am
Reply with quote

Check if the following link is of any help to you:

www.simotime.com/cblbit01.htm

Regds
Sunny
Back to top
View user's profile Send private message
cdaniel_el

New User


Joined: 12 Jun 2006
Posts: 9
Location: OH, USA

PostPosted: Tue Jun 13, 2006 5:49 pm
Reply with quote

Hi Sunny
Again i am hunting around for a solution to find out the presence of PD, is there any ways to do it is my basic concern. Because thatz my requirement. This is purely driven on business.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 420
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Tue Jun 13, 2006 10:11 pm
Reply with quote

What's being dropped - the elementary field value, the group item, a record?

You can always loop thru an item checking each position for values x'F0' thru x'F9' and bypass processing if all values do not fall in that range (at least if no signing is involved).
Back to top
View user's profile Send private message
cdaniel_el

New User


Joined: 12 Jun 2006
Posts: 9
Location: OH, USA

PostPosted: Tue Jun 13, 2006 10:43 pm
Reply with quote

Hi Dave,

Again the main concern over here is that we are having 11 million records. It would pose a severe threat to the performance issues as we go abt finding this way about.. may be i am not too sure. My pbm over here is that the position of the PD is unsure it might sprout in any position within the range of variable's. I am looking for a way wherein i shouldnt tamper the performance. My main pbm over here is the upstream systems is from a different company and they wont abide by any norms or error's for that matter.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 420
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Tue Jun 13, 2006 11:28 pm
Reply with quote

Then it is only possible on your end to test for valid fields (isnumeric or whatever) on the known layout and type of the fields as you expect them to be. When a nonconforming field is found, you bypass that record or dump it to a 'suspense' file for future diagnostics/validation resolution.
Back to top
View user's profile Send private message
cdaniel_el

New User


Joined: 12 Jun 2006
Posts: 9
Location: OH, USA

PostPosted: Wed Jun 14, 2006 6:29 am
Reply with quote

Thx Dave,
But this again is leading to a performance issue. i am gonna try the other way round. Will drop the solution sooner....Thx everyone


Rgds
Dan
Back to top
View user's profile Send private message
venkatm99

New User


Joined: 01 Jun 2006
Posts: 23
Location: Sinagpore

PostPosted: Wed Jun 14, 2006 3:17 pm
Reply with quote

hi

move the comp3 field to alphanumeric feild .
replace all spaces with zeroes
move data in alpha numeric to numeric feild..do numeric validation

if not numeric..its a comp3

pl correct me if Iam wrong

cheers

venkat
Back to top
View user's profile Send private message
sunnyk

New User


Joined: 20 Oct 2004
Posts: 59

PostPosted: Wed Jun 14, 2006 3:31 pm
Reply with quote

How can you say if the data is not numeric it's COMP-3 as COMP-3 also passes the IS NUMERIC condition/test.

Regds
Sunny
Back to top
View user's profile Send private message
cdaniel_el

New User


Joined: 12 Jun 2006
Posts: 9
Location: OH, USA

PostPosted: Wed Jun 14, 2006 6:19 pm
Reply with quote

Precisely, COMP-3 also passes the numeric test. That shudnt be the way.


Rds
Dan
Back to top
View user's profile Send private message
venkatm99

New User


Joined: 01 Jun 2006
Posts: 23
Location: Sinagpore

PostPosted: Thu Jun 15, 2006 7:33 am
Reply with quote

hi

I think my assumption is wrong.

I thought when comp-3 feild moved to alpha numeric it will move some junk

Sorry friends

cheers

venkat
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Help required to reset decimal points... DFSORT/ICETOOL 10
No new posts Unable to interpret a hex value to De... COBOL Programming 7
No new posts small int to zoned decimal conversion DFSORT/ICETOOL 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
Search our Forums:

Back to Top