|
View previous topic :: View next topic
|
| Author |
Message |
vinu78
Active User
Joined: 02 Oct 2008 Posts: 179 Location: India
|
|
|
|
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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| Have a look at INOUT in your SyncSORT (MFX) Manual. |
|
| Back to top |
|
 |
vinu78
Active User
Joined: 02 Oct 2008 Posts: 179 Location: India
|
|
|
|
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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| I thought that was what you wanted? What problem does it give you? |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
| 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 |
|
 |
boyti ko
New User

Joined: 03 Nov 2014 Posts: 78 Location: Malaysia
|
|
|
|
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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| Bill , He can also use ALTSEQ CODE right instead of two FINDREPs? |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
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 |
|
 |
boyti ko
New User

Joined: 03 Nov 2014 Posts: 78 Location: Malaysia
|
|
|
|
| nice! that ALTSEQ is new to me. thanks to both of you |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|