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 

How to remove a Hex char from a variable length file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
pkarthik@email.com
Beginner


Joined: 29 Mar 2005
Posts: 34
Topics: 18
Location: Canada

PostPosted: Thu Oct 12, 2006 10:41 pm    Post subject: How to remove a Hex char from a variable length file Reply with quote

Hi, we have a requirement to remove a hexadecimal value which might appear at any position in a variable length record. sample given below.

Here is an extract :
Code:
 
:21S:ABCDE
:21R:HASASAS
:19A::OOJO//KOJ343480281,18
:16S:HASASAS
-}
{1:H01NJJHJG90YYYY0000000007}{2:O1234567890123JHJHIKJ20AXXX00000000010610110204N}{4:
:16R:OMJU
:28E:2/MORE


The issue is the '', hexadecimal value 0x03, which they claim is an invalid character. But this character may appear anywhere in the file in every record.

Can this be removed?
_________________
For any type of complex problems there will be multiple easiest solutions
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Oct 13, 2006 8:30 am    Post subject: Reply with quote

pkarthik@email.com,

Quote:

hexadecimal value 0x03, which they claim is an invalid character. But this character may appear anywhere in the file in every record.


0x is not a valid hex character. It is easy to replace the x'03' . You can use ALTSEQ to replace the hex 03 to spaces(x'40'). try this

Code:

//SYSIN     DD *                     
  SORT FIELDS=COPY                   
  OUTREC FIELDS=(01,04,   $rdw
                 05,lrecl,TRAN=ALTSEQ) 
  ALTSEQ CODE=(0340)                 
/*                   


lrecl = your vb input file lrecl

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Oct 13, 2006 10:43 am    Post subject: Reply with quote

Actually, for a VB file you shouldn't specify the LRECL in the OUTREC statement. You should use:

Code:

   OUTREC FIELDS=(1,4,5,TRAN=ALTSEQ)


5,TRAN=ALTSEQ operates on position 5 to the end of the VB record.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
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 -> Job Control Language(JCL) 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