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
 

 

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: 129
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: 7225

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: 129
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: 7225

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: 7905
Location: Bellevue, IA

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: 7225

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: 1609
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: 7225

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: 1609
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 How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am


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