View previous topic :: View next topic
|
Author |
Message |
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
Hello.
I am trying to convert ASCII to EBCDIC usiong following syntax:
OUTREC FIELDS=(1,nn,TRAN=ATOE)
But after conversion the o/p file is paddeed with '@' in place of space.
Input
Code: |
ä?>ÈÁ>È.è`øÁ..Ñ_/ÅÁ.¦øÅ. |
Output
Code: |
Content-Type: image/jpg.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
Could you please suggest a best way to remove the padding'@' and keep it as space as it is.
Thank you. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please post a bit of the problem data in Hex.
It looks like you may already have ebcdic data . . . |
|
Back to top |
|
|
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
Please find the screenshot below in Hex
Input:
Code: |
ä?>ÈÁ>È.è`øÁ..Ñ_/ÅÁ.¦øÅ.
466766725776326666626760444444444444444444444444444444444444
3FE45E4D4905A09D175FA07A000000000000000000000000000000000000 |
Output:
Code: |
Content-Type: image/jpg.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
C99A89A6EA9874898886998277777777777777777777777777777777777
365355303875A09417511775CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
|
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
The "at" sign is X'40' ASCII and X'7C' in EBCDIC; the translation is working properly. Change the X'40' bytes in the input to X'20' (ASCII spaces, which will translate into EBCDIC spaces). |
|
Back to top |
|
|
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
Akatsukami wrote: |
The "at" sign is X'40' ASCII and X'7C' in EBCDIC; the translation is working properly. Change the X'40' bytes in the input to X'20' (ASCII spaces, which will translate into EBCDIC spaces). |
That worked. Thank you |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You received a "mixed-bag" . . .
Suggest you work with whoever provided the data and have them use ascii spaces instead of the x'40's when creating the data.
Unless this was a one-time shot - then it won't matter |
|
Back to top |
|
|
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
dick scherrer wrote: |
Hello,
You received a "mixed-bag" . . .
Suggest you work with whoever provided the data and have them use ascii spaces instead of the x'40's when creating the data.
Unless this was a one-time shot - then it won't matter |
Thank you This would be a one time requirement and I was advised not to change anything in the input file.
The initial requirement was to do all three steps in one sort:
1. Convert VB to FB
2. TRAN=ATOE
3. Now that we have '@' in o/p, we need to change it back to space. Please note here that we first copied the VB to FB as a result space came in the file. But in the VB file there is no space after the data which means it looks like below:
Code: |
--------------------------------------------------
ä?>ÈÁ>È.èÊ/>ËÃÁÊ.á>Ä?ÀÑ>Å..Â/ËÁ...
4667667257667667246666666326676330
3FE45E4D421E3652D5E3F49E7A0213564A |
The following sytax
Code: |
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT1,VTOF,
INREC FINDREP=(INOUT=(X'40',X'20')) --> Now we dont have space after the data so I thing this wont be used
OUTREC=(1:5,100,TRAN=ATOE) |
Can it be done in one Sort step ? |
|
Back to top |
|
|
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
Niki wrote: |
dick scherrer wrote: |
Hello,
You received a "mixed-bag" . . .
Suggest you work with whoever provided the data and have them use ascii spaces instead of the x'40's when creating the data.
Unless this was a one-time shot - then it won't matter |
Thank you This would be a one time requirement and I was advised not to change anything in the input file.
The initial requirement was to do all three steps in one sort:
1. Convert VB to FB
2. TRAN=ATOE
3. Now that we have '@' in o/p, we need to change it back to space. Please note here that we first copied the VB to FB as a result space came in the file. But in the VB file there is no space after the data which means it looks like below:
Code: |
--------------------------------------------------
ä?>ÈÁ>È.èÊ/>ËÃÁÊ.á>Ä?ÀÑ>Å..Â/ËÁ...
4667667257667667246666666326676330
3FE45E4D421E3652D5E3F49E7A0213564A |
The following sytax
Code: |
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT1,VTOF,
INREC FINDREP=(INOUT=(X'40',X'20')) --> Now we dont have space after the data so I thing this wont be used
OUTREC=(1:5,100,TRAN=ATOE) |
Can it be done in one Sort step ? |
I am able to do it in two steps:
Step1:
Code: |
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT1,VTOF,
OUTREC=(1:5,100,TRAN=ATOE) |
Step2:
Code: |
SORT FIELDS=COPY
OUTREC FINDREP=(IN=(C'@'),OUT=C' ') |
But the Step2 can also replace @ with space which may be incorrect for some record |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Niki,
You really don't need 2 steps to perform the conversion. Since your input file is VB you need not specify the length.
Use the following DFSORT JCL which will give you the desired results
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=Your Input VB ASCII file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,4,5,TRAN=ATOE)
OUTFIL VTOF,BUILD=(5,100)
//* |
|
|
Back to top |
|
|
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
Skolusu wrote: |
Niki,
You really don't need 2 steps to perform the conversion. Since your input file is VB you need not specify the length.
Use the following DFSORT JCL which will give you the desired results
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=Your Input VB ASCII file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,4,5,TRAN=ATOE)
OUTFIL VTOF,BUILD=(5,100)
//* |
|
Short and Sweet. Thank you so much Skolusu |
|
Back to top |
|
|
|