View previous topic :: View next topic
|
Author |
Message |
Rohan Petare
New User
Joined: 01 Aug 2022 Posts: 5 Location: India
|
|
|
|
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 |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
JCL and VSAM can't do that. Also please consider using the code tag button when posting code or data. |
|
Back to top |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 420 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
Show us jcl and sort statements. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2135 Location: USA
|
|
|
|
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 |
|
|
Rohan Petare
New User
Joined: 01 Aug 2022 Posts: 5 Location: India
|
|
|
|
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 |
|
|
Rohan Petare
New User
Joined: 01 Aug 2022 Posts: 5 Location: India
|
|
|
|
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 |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
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 |
|
|
Rohan Petare
New User
Joined: 01 Aug 2022 Posts: 5 Location: India
|
|
|
|
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 |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
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 |
|
|
Rohan Petare
New User
Joined: 01 Aug 2022 Posts: 5 Location: India
|
|
|
|
Perfect ! Thanks Joerg , I am getting the expected results. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Remember to use the right offsets. For FINDREP parm STARTPOS=5 will do. For SQZ, as written before. |
|
Back to top |
|
|
|