MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unpacked data - Replace special characters with zeroes

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Thu Feb 23, 2023 6:31 am    Post subject: Unpacked data - Replace special characters with zeroes Reply with quote

Hi,

I have unpacked around 98 COMP-3 fields into a dataset and finding below given special characters in the unpacked data (output LRECL=900).

Code:
Ā   ā   Ă   ă   Ą   ą   Ć   ć   Ĉ   ĉ   Ċ   ċ   Č   č   Ď   ď   Đ   đ   Ē   ē   Ĕ   ĕ   Ė   ė   Ę   ę   Ě   ě   Ĝ   ĝ   Ğ   ğ   Ġ   ġ   Ģ   ģ   Ĥ   ĥ   Ħ   ħ   Ĩ   ĩ   Ī   ī   Ĭ   ĭ   Į   į   İ   ı   IJ   ij   Ĵ   ĵ   Ķ   ķ   ĸ   Ĺ   ĺ   Ļ   ļ   Ľ   ľ   Ŀ   ŀ   Ł   ł   Ń   ń   Ņ   ņ   Ň   ň   Ŋ   ŋ   Ō   ō   Ŏ   ŏ   Ő   ő   Œ   œ   Ŕ   ŕ   Ŗ   ŗ   Ř   ř   Ś   ś   Ŝ   ŝ   Ş   ş   Š   š   Ţ   ţ   Ť   ť   Ŧ   ŧ   Ũ   ũ   Ū   ū   Ŭ   ŭ   Ů   ů   Ű   ű   Ų   ų   Ŵ   ŵ   Ŷ   ŷ   Ÿ   Ź   ź   Ż   ż   Ž   ž   ſ


I am tasked to replace such special characters with zeroes. I read about FINDREP but not sure how to replace these many characters in the output file. We use Syncsort.

Please help.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Thu Feb 23, 2023 4:05 pm    Post subject: Re: Unpacked data - Replace special characters with zeroes Reply with quote

mf_user wrote:
Hi,
I have unpacked around 98 COMP-3 fields into a dataset and finding below given special characters in the unpacked data (output LRECL=900).


mf_user,

How did you unpack them? Looking from the data you posted, it still looks like packed data.

mf_user wrote:

I am tasked to replace such special characters with zeroes. I read about FINDREP but not sure how to replace these many characters in the output file. We use Syncsort.

Please help.



Why do you think they are special characters? Packed decimal data cannot be seen in display mode. If you want to see the data have the HEX ON and see the data.


What is your actual goal? Replacing the data does NOT make any sense.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Sat Feb 25, 2023 2:13 am    Post subject: Reply with quote

Hi Kolusu,

I have unpacked them using TO=ZD,LENGTH=n.
the downstream system wants the junk to be replaced with zeroes.

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Sat Feb 25, 2023 10:07 am    Post subject: Reply with quote

mf_user wrote:
Hi Kolusu,
I have unpacked them using TO=ZD,LENGTH=n.

Thanks.


mf_user,

I highly doubt it. If you did it, it would have shown displayable numbers and the sign overpunched on to the last digit. But I still see the packed decimal values.

Show us the complete control cards. You said "unpacked around 98 COMP-3", so did you have 98 TO=ZD statements? Did you use BUILD or OVERLAY ?
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Sun Feb 26, 2023 1:01 am    Post subject: unpack comp-3 Reply with quote

Hi Kolusu,

After further analysis, and due to frequent S0C7 abend on certain fields (invalid input data from input file), we had to go for program approach. Declared an input filed of X(105) with all these characters and an output filed with 105 zeroes and used INSPECT to replace all such characters with zeroes.

since they asked us to ignore sign field, we did not consider it at all. Initial approach was SORT where I used OUTREC BUILD and tried TO=ZD, TO=ZDF, TO=ZDC and EDIT=() options.

However, I saw a post (either by you or Frank) few days ago in some forum or in google, where you provided a FINDREP solution (a bit lengthy though) and wanted to tell the possibility to client because its a onetime ask. I am not able to find that link /not able to recall where exactly I saw it. I will search for it again. Embarassed

Unfortunately, I can't copy, paste the code as I could not copy it from RDP.

Please advise.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Sun Feb 26, 2023 10:20 am    Post subject: Reply with quote

mf_user,

I guess you are stuck on special characters and looking for the solution in that direction. Unfortunately nothing makes sense. Lets do something simple. lets just unpack 1 field.
Assuming 1 packed decimal filed starts at 10 for a length of 4 bytes. what is the output of this?

Code:

   OPTION COPY
   OUTREC BUILD=(10,04,PD,TO=ZD,LENGTH=8)

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Mon Feb 27, 2023 6:37 am    Post subject: Reply with quote

Hi Kolusu,

Example with HEXON:
i/p:
Code:

----1----2
.*.@
0537
1CFC


o/p:
Code:

----1----2
015Ü3.


So, as said, expectation is replace "Ü" with 0 and "." with 0.

o/p:
Code:

015030


Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Mon Feb 27, 2023 6:42 am    Post subject: Reply with quote

sorry, I hit enter too soon... bonk

sort card:
Code:

1,4,PD,TO=ZD,LENGTH=7


o/p:
Code:

----1----2
015Ü3.G0


Expected o/p:
Code:

----1----2
01503000

_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Mon Feb 27, 2023 5:40 pm    Post subject: Reply with quote

mf_user,

X'015C3F7C' is not a valid packed decimal number. Did you receive this file from an ASCII(windows/linux/mac) source? When converting ASCII code to EBCDIC code, all ASCII code not having an EBCDIC equivalent is converted to X'3F'.

That explains as to why you are getting X'3F' in the middle.

As I said you need to fix the data rather than trying to change the value.

I believe that changing it X'3F' to X'00' will make the values incorrect. Find out what the right value is supposed to be.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Tue Feb 28, 2023 2:21 am    Post subject: Reply with quote

Kolusu,

Thanks for the suggestion.
We had that discussion and the expectation is to replace it with zeroes.
so, how do I replace bulk of it with FINDREP, please let me know.

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Tue Feb 28, 2023 8:15 am    Post subject: Reply with quote

mf_user,

You did NOT answer my question about the source of the data. If your intention is to replace the values , list all the invalid values as IN list and have X'00' as OUT List. So what is the problem. Look up the syntax of FINDREP in Syncsort manuals
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group