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
 

 

S0C7 when converting to Zoned Decimal in DFSORT

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

New User


Joined: 26 Feb 2007
Posts: 30
Location: chicago

PostPosted: Thu Jun 03, 2010 8:29 pm    Post subject: S0C7 when converting to Zoned Decimal in DFSORT
Reply with quote

I'm trying to convert some old data for a client to comma delimited files. I've used DFSORT to do this many times, but I'm not understanding the results I'm getting with this file. The fields are defined as
PIC 9(8) COMP.
PIC 9(8) COMP.
PIC 9(4) COMP.

although to be honest this client has poor documentation and no version control so there is no guarantee that the copybooks I find really match the data.

In the first record, for instance, the data looks like this:
X'0021998E'
X'005E064E'
X'03BC'

If I code:

330:296,4,PD,TO=ZD,LENGTH=8, or 330:296,4,PD,TO=ZD,LENGTH=7,
and then 330:296,4,PD,TO=ZD,LENGTH=4, or 3 for the 3rd field I get
this output:

,0002199Y,0005Ú06U,003ô

I tried 330:296,4,BI,TO=ZD,LENGTH=8 and got 0220199H,0616199H,003ô ( didn't expect that to work)

I tried 330:296,4,PD,EDIT=(TTTTTTTT), and got a S0C7

Any thoughts?


thanks
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Jun 03, 2010 8:47 pm    Post subject: Re: CONVERTING TO ZD WITH DFSORT, DON'T UNDERSTAND RESULTS
Reply with quote

steves wrote:
In the first record, for instance, the data looks like this:
X'0021998E'
X'005E064E'
X'03BC'

If I code:

330:296,4,PD,TO=ZD,LENGTH=8, or 330:296,4,PD,TO=ZD,LENGTH=7,
and then 330:296,4,PD,TO=ZD,LENGTH=4, or 3 for the 3rd field I get
this output:

,0002199Y,0005Ú06U,003ô
Your input is binary not packed decimal.
Quote:
I tried 330:296,4,BI,TO=ZD,LENGTH=8 and got 0220199H,0616199H,003ô ( didn't expect that to work)
Why not?
Quote:
I tried 330:296,4,PD,EDIT=(TTTTTTTT), and got a S0C7
Because your input is binary not packed decimal.
Back to top
View user's profile Send private message
steves

New User


Joined: 26 Feb 2007
Posts: 30
Location: chicago

PostPosted: Thu Jun 03, 2010 8:50 pm    Post subject:
Reply with quote

so how do I convert it? I tried BI,TO=ZD, that didn't work
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Jun 03, 2010 9:03 pm    Post subject:
Reply with quote

steves wrote:
so how do I convert it? I tried BI,TO=ZD, that didn't work
Wouldn't "330:296,4,BI,EDIT=(TTTTTTTT), " work?
Back to top
View user's profile Send private message
steves

New User


Joined: 26 Feb 2007
Posts: 30
Location: chicago

PostPosted: Thu Jun 03, 2010 9:08 pm    Post subject:
Reply with quote

Ah HA!, it does, thank you.
Final question, I've never seen data defined as just 'COMP', usually its something COMP-3. Does COMP mean binary?
thanks
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Jun 03, 2010 9:10 pm    Post subject:
Reply with quote

steves wrote:
Ah HA!, it does, thank you.
Final question, I've never seen data defined as just 'COMP', usually its something COMP-3. Does COMP mean binary?
thanks
Very good, and yes.
Double check the difference between BI and FI........
Back to top
View user's profile Send private message
steves

New User


Joined: 26 Feb 2007
Posts: 30
Location: chicago

PostPosted: Thu Jun 03, 2010 9:11 pm    Post subject:
Reply with quote

thanks
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Jun 03, 2010 10:17 pm    Post subject:
Reply with quote

steves,

TO=ZD,LENGTH=8 would work correctly with DFSORT.

For example, if we have X'0021998E' in positions 1-4, and we use:

Code:

 INREC BUILD=(1,4,BI,TO=ZD,LENGTH=8)


it would give the output as:

02201998

I'm not sure what you did to get the value you say you got, but you did something incorrectly.

For more information on DFSORT formats vs COBOL formats, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA40/C.3?DT=20090527161936
Back to top
View user's profile Send private message
Alexis Sebastian

New User


Joined: 04 Mar 2010
Posts: 38
Location: DC

PostPosted: Fri Jun 04, 2010 10:24 am    Post subject:
Reply with quote

Frank,

You are absolutely correct.
But Steve used PD for COMP variables. Since the PD,TO=ZD is an UNPacK which does not produce a data exception (S0C7) it did not fail then.
It should be BI. Thats the problem.
It was only in the EDit attempt (PD,EDIT=) that the S0C7 occured since ED will produce a data execption.
Back to top
View user's profile Send private message
Vishwamurthy

New User


Joined: 11 Mar 2008
Posts: 57
Location: India

PostPosted: Thu Mar 31, 2011 5:44 pm    Post subject: Reply to: CONVERTING TO ZD WITH DFSORT, DON'T UNDERSTAND RES
Reply with quote

Guys,
I've used this: 330:296,4,BI,EDIT=(TTTTTTTT), to convert Binary to ZD
This works when the value is positive. But when it is negative, it generates a complement.
Like 1 displays as 1 and 3 displays as 3 whereas -1 displays as 945***98 and -3 as 945***96.

Could someone educate me if there's a way to tackle this? The above works great with PD
If I could first convert BI to PD and then to ZD and be able to display the sign in the same OUTREC for that field, it should be great. Any other ideas welcome

There's like 2M+ records which need to be corrected..

Thanks in advance,
Vish
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Mar 31, 2011 5:58 pm    Post subject:
Reply with quote

Search for SFF in this Forum.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Mar 31, 2011 11:23 pm    Post subject:
Reply with quote

Vish,

BI is unsigned binary (e.g. X'FFFFFFFF' = 4294967295). FI is signed binary (e.g. X'FFFFFFFF' = -1). If you are dealing with signed binary, use FI, not BI.

If you are dealing with some other type of value like -3, you need to explain more clearly what type of values you are dealing with and include an example of the input and expected output.
Back to top
View user's profile Send private message
Vishwamurthy

New User


Joined: 11 Mar 2008
Posts: 57
Location: India

PostPosted: Fri Apr 01, 2011 4:58 pm    Post subject:
Reply with quote

Frank Yaeger wrote:
Vish,

BI is unsigned binary (e.g. X'FFFFFFFF' = 4294967295). FI is signed binary (e.g. X'FFFFFFFF' = -1). If you are dealing with signed binary, use FI, not BI.

If you are dealing with some other type of value like -3, you need to explain more clearly what type of values you are dealing with and include an example of the input and expected output.

It does work wonders. Thanks Frank icon_smile.gif

U guys r awesome lot..
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 How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm


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