Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
To convert Non readable values to spaces and ? to Zero

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
vinu78

Active User


Joined: 02 Oct 2008
Posts: 151
Location: India

PostPosted: Fri Oct 02, 2015 10:13 pm    Post subject: To convert Non readable values to spaces and ? to Zero
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Oct 02, 2015 10:34 pm    Post subject: Reply to: To convert Non readable values to spaces and ? to Zero
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: 151
Location: India

PostPosted: Fri Oct 02, 2015 10:53 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Sat Oct 03, 2015 1:40 am    Post subject: Reply to: To convert Non readable values to spaces and ? to Zero
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: 8187
Location: East Dubuque, Illinois, USA

PostPosted: Sat Oct 03, 2015 3:40 am    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Oct 29, 2015 12:43 pm    Post subject: Reply to: To convert Non readable values to spaces and ? to Zero
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

Senior Member


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

PostPosted: Thu Oct 29, 2015 9:15 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Oct 29, 2015 11:11 pm    Post subject: Reply to: To convert Non readable values to spaces and ? to Zero
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

Senior Member


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

PostPosted: Thu Oct 29, 2015 11:19 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Can EDCICONV convert EBCDIC to ASCII... natt.sut IBM Tools 3 Fri Nov 17, 2017 8:46 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us