Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

ASCII and EBCDIC conversion padded with '@'

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Thu Jan 24, 2013 11:04 pm    Post subject: ASCII and EBCDIC conversion padded with '@'
Reply with quote

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
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jan 24, 2013 11:09 pm    Post subject:
Reply with quote

Hello,

Please post a bit of the problem data in Hex.

It looks like you may already have ebcdic data . . .
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Thu Jan 24, 2013 11:13 pm    Post subject:
Reply with quote

Please find the screenshot below in Hex

Input:

Code:
ä?>ÈÁ>È.è`øÁ..Ñ_/ÅÁ.¦øÅ.                                       
466766725776326666626760444444444444444444444444444444444444
3FE45E4D4905A09D175FA07A000000000000000000000000000000000000


Output:
Code:
Content-Type:    image/jpg.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
C99A89A6EA9874898886998277777777777777777777777777777777777
365355303875A09417511775CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Thu Jan 24, 2013 11:27 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Fri Jan 25, 2013 12:15 am    Post subject:
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jan 25, 2013 12:59 am    Post subject:
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Fri Jan 25, 2013 2:08 am    Post subject:
Reply with quote

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 icon_smile.gif


Thank you icon_smile.gif 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
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Fri Jan 25, 2013 2:38 am    Post subject:
Reply with quote

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 icon_smile.gif


Thank you icon_smile.gif 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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Jan 25, 2013 3:47 am    Post subject: Reply to: ASCII and EBCDIC conversion padded with '@'
Reply with quote

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
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Fri Jan 25, 2013 4:22 am    Post subject: Re: Reply to: ASCII and EBCDIC conversion padded with '@'
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Conversion of a VB file to FB. isssal DFSORT/ICETOOL 1 Mon Oct 31, 2016 10:23 pm
No new posts EBCDIC to ASCII conversion using OCOPY mistah kurtz All Other Mainframe Topics 5 Tue Sep 06, 2016 2:26 pm
No new posts Converting EBCDIC to Unicode (TimeStamp) muralikrishnan_new COBOL Programming 2 Mon Jul 25, 2016 10:42 pm
No new posts Comparex utility to Syncsort conversion mistah kurtz SYNCSORT 11 Fri Jul 22, 2016 1:53 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us