IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To Remove spaces (which is in hex form) from VB file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rohan Petare

New User


Joined: 01 Aug 2022
Posts: 5
Location: India

PostPosted: Tue Aug 02, 2022 1:01 am
Reply with quote

Hello,
I have a VB dataset from which I need to remove additional spaces which are present in form of hex value (40) using JCL. i have tried SQZ left shift function of sort utility but seems like that doesn't work with hex values.
Can some one suggest a way. Thank you !
Below example is just for understanding purpose
Present condition :
°= ¶© ™¢
_^°=. ¶| ¢ £
Expected condition :
°=¶©™¢
_^°=.¶|¢£
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1306
Location: Bamberg, Germany

PostPosted: Tue Aug 02, 2022 1:15 am
Reply with quote

JCL and VSAM can't do that. Also please consider using the code tag button when posting code or data.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 420
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Tue Aug 02, 2022 1:16 am
Reply with quote

Show us jcl and sort statements.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2119
Location: USA

PostPosted: Tue Aug 02, 2022 3:56 am
Reply with quote

dneufarth wrote:
Show us jcl and sort statements.

JCL has nothing to do with this issue.
At least no more than “Show us your national passport”

SQZ parameter of SORT utility should do this job (if only it is used properly).

If you need any help, you MUST present your used code her (using the Code button), but not only inform us, that “you tried to use some code”
Back to top
View user's profile Send private message
Rohan Petare

New User


Joined: 01 Aug 2022
Posts: 5
Location: India

PostPosted: Tue Aug 02, 2022 10:24 am
Reply with quote

Hi,

OPTION COPY
INREC BUILD=(1,30004,SQZ=(SHIFT=LEFT))


This above sort i have used for VB file of LRECL 30004 having hex values.
But it did not removed spaces in those records. Please suggest if any additions are required for this.

Input data -

.{0. ÙË.;
.{ 0.Ù Ë.;
. {0.ÙË .;

Thank you !
Back to top
View user's profile Send private message
Rohan Petare

New User


Joined: 01 Aug 2022
Posts: 5
Location: India

PostPosted: Tue Aug 02, 2022 11:58 am
Reply with quote

Also continuing to my previous comment, I have tried the below sort as well to replace the blanks and other hexa values. But this does not REMOVE the blanks.
Can you please suggest what needs be there in the OUT part in order to remove that values in the below IN part. Thank you!

Code:

  OPTION COPY                                             
   INREC IFTHEN=(WHEN=INIT,FINDREP=(IN=X'40',OUT=X'20')), 
         IFTHEN=(WHEN=INIT,FINDREP=(IN=X'41',OUT=X'20'))   
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1306
Location: Bamberg, Germany

PostPosted: Tue Aug 02, 2022 12:12 pm
Reply with quote

As you are having a V(B) dataset, your data starts at position 5 (after the RDW). Please adjust the offsets for SQZ accordingly.
No real need for a FINDREP here.
Back to top
View user's profile Send private message
Rohan Petare

New User


Joined: 01 Aug 2022
Posts: 5
Location: India

PostPosted: Tue Aug 02, 2022 12:53 pm
Reply with quote

Thank you Joerg for the reply. This approach would work for X'40' .
I was going for FINDREP , so that any unwanted values along with spaces if i can remove, that will be great.
Unwanted hex values are below -
X'40'
X'41'
X'0D'
Is there a way i can just remove the above values from my record. Thank you !
Below is the data , here hex value 41 seems to be blanks that needs to be removed.

Code:

.{0. ÙË.:NEW:.{0. ÙË.;
0CF04F717DCE70CF04F7354
300B1D35A556A300B1D3FE0
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1306
Location: Bamberg, Germany

PostPosted: Tue Aug 02, 2022 1:12 pm
Reply with quote

Code:
OPTION COPY                               
INREC IFTHEN=(WHEN=INIT,                   
  FINDREP=(IN=(X'40',X'41',X'0D'),OUT=C''))
END

would also work:
Code:
SQZ=(SHIFT=LEFT,PREBLANK=X'40410D')
Back to top
View user's profile Send private message
Rohan Petare

New User


Joined: 01 Aug 2022
Posts: 5
Location: India

PostPosted: Tue Aug 02, 2022 5:04 pm
Reply with quote

Perfect ! Thanks Joerg , I am getting the expected results. icon_smile.gif
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1306
Location: Bamberg, Germany

PostPosted: Wed Aug 03, 2022 12:36 am
Reply with quote

Remember to use the right offsets. For FINDREP parm STARTPOS=5 will do. For SQZ, as written before.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts how to complete the end of a record w... DFSORT/ICETOOL 2
No new posts BPXBATCH SFTP to remote path having s... All Other Mainframe Topics 6
No new posts how to eliminate null indicator value... DB2 7
No new posts Format Binary file to EBCDIC JCL & VSAM 4
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
Search our Forums:

Back to Top