IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

To convert Non readable values to spaces and ? to Zero


 
IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: :: View next topic  
Author Message
vinu78

Active User


Joined: 02 Oct 2008
Posts: 179
Location: India

PostPosted: Fri Oct 02, 2015 10:13 pm
Reply with quote

Hi All,

My Reqt is to convert all the Non readable values coming in flat file to SPACES and also to convert '?' to ZEROES.

I had the following SYNCSORT syntax

Code:
SORT FIELDS=COPY
INREC FINDREP=(IN=(X'00',X'01',X'02',X'03',X'04',X'05',
                   X'06',X'07',X'08',X'09',X'10',X'11',X'3F',
                   X'12',X'13',X'14',X'15'),OUT=X'40')


I would like to convert '?' (hexa value as X'6F') to Zero (hexa value X'F0') as well.
I was not able to append this functionaility to the above mentioned syntax.
Was getting syntax error when I tried the below mentioned way

Code:
SORT FIELDS=COPY
INREC FINDREP=(IN=(X'00',X'01',X'02',X'03',X'04',X'05',
                   X'06',X'07',X'08',X'09',X'10',X'11',X'3F',
                   X'12',X'13',X'14',X'15'),OUT=X'40'),
                   (IN=(X'6F'),OUT=X'F0')


Can you please help.

Thanks
Vinu
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

PostPosted: Fri Oct 02, 2015 10:34 pm
Reply with quote

Have a look at INOUT in your SyncSORT (MFX) Manual.
Back to top
View user's profile Send private message
vinu78

Active User


Joined: 02 Oct 2008
Posts: 179
Location: India

PostPosted: Fri Oct 02, 2015 10:53 pm
Reply with quote

Thanks Bill for the suggestion.
If I am using INOUT, will I end up having 17 entries to be converted to SPACES and one last entry to convert ? to Zeroes

INREC FINDREP=(INOUT=(X'00',X'40',
X'01',X'40',
X'02',X'40',
X'03',X'40',
X'04',X'40',
....
X'15',X'40',
X'6F',X'F0'))

Or am I getting it wrong.

Thanks
Vinu
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

PostPosted: Sat Oct 03, 2015 1:40 am
Reply with quote

I thought that was what you wanted? What problem does it give you?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8566
Location: Dubuque, Iowa, USA

PostPosted: Sat Oct 03, 2015 3:40 am
Reply with quote

Quote:
My Reqt is to convert all the Non readable values coming in flat file to SPACES and also to convert '?' to ZEROES.
Mainframes use EBCDIC, and EBCDIC has 256 characters in the collating sequence. A large number of them are not human-readable but are valid characters. Your post only mentions the first 16 of the characters that are not human-readable. What about the rest of them?
Back to top
View user's profile Send private message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Thu Oct 29, 2015 11:59 am
Reply with quote

just put it in outrec?

Code:
  SORT FIELDS=COPY                                             
  INREC FINDREP=(IN=(X'00',X'01',X'02',X'03',X'04',X'05',     
                     X'06',X'07',X'08',X'09',X'10',X'11',X'3F',
                     X'12',X'13',X'14',X'15'),OUT=X'40')       
  OUTREC FINDREP=(IN=(X'6F'),OUT=X'F0')                       
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

PostPosted: Thu Oct 29, 2015 12:43 pm
Reply with quote

If you were desperate to have two FINDREPs instead of one, that would be one solution. As would using two IFTHEN=(WHEN=INIT with FINDREPs be.

Having two FINDREPs means (in this case) looking at each byte of the record twice, whereas with one FINDREP even if there are multiple test values, you only look at (loop up) each byte once.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2503
Location: NY,USA

PostPosted: Thu Oct 29, 2015 9:15 pm
Reply with quote

Bill , He can also use ALTSEQ CODE right instead of two FINDREPs?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

PostPosted: Thu Oct 29, 2015 11:11 pm
Reply with quote

Yes. Any one-byte FINDREP can be achieved with ALTSEQ, as long as a field can be defined to do the ALTSEQ on. To be clearer, if you wanted the variable-length part of a record, you'd need FINDREP.

I've only recently noticed the ALTSEQ being used in place of FINDREP, and given the person seen using it, I think it is probably worthwhile.

I'm still confused as to what problem vinu78 was having and suspect the ALTSEQ will also be too much typing.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2503
Location: NY,USA

PostPosted: Thu Oct 29, 2015 11:19 pm
Reply with quote

Thanks Bill and also with INREC WHEN=INIT he can still use FINDREP twice instead of another OUTREC (Just to answer his original quesion).
I guess, vinu78 wants us to test everything instead of he try something by himself after all the hints.
Back to top
View user's profile Send private message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Fri Oct 30, 2015 7:25 am
Reply with quote

nice! that ALTSEQ is new to me. thanks to both of you
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> SYNCSORT
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts COnvert a column with mix of hex ,cha... DB2 5
No new posts Map a data element to SPACES if it is 0 COBOL Programming 2
No new posts To convert numeric to Packed Decimal DFSORT/ICETOOL 9
No new posts a copybook getting improper values in... COBOL Programming 7
No new posts how to convert Hex String t char hex PL/I & Assembler 6

Back to Top