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

Syncsort Convert FROM Ascii


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Apr 25, 2014 1:50 am
Reply with quote

Howdy,

A new opportunity has just presented itself.

One of our groups has received a one-time file that was delivered to the mainframe. I have not yet been able to find someone who knows the mechanics of how it got on the system - I suspect ftp.

When looked at in hex it is an ascii file that was probably uploaded as BINARY.

Is there a way with the sort to read the file and write it back out as ebcdic? I've not been able to find an example and there are DFSORT topics that mention there is no such capability in DFSORT.

Thoughts . . . Suggestions?

Thanks,

d
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Fri Apr 25, 2014 2:29 am
Reply with quote

Is this of any use?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Apr 25, 2014 3:13 am
Reply with quote

Verry Possibly!

I'll give it a try later tonight or tomorow . . .

Thanks icon_smile.gif

d
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3049
Location: NYC,USA

PostPosted: Fri Apr 25, 2014 4:50 am
Reply with quote

Dick,You can try for TRAN=ATOE ( DFSORT) or OCOPY or OGET options.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Apr 25, 2014 6:14 am
Reply with quote

Hello,

As I mentioned at the beginning, this site uses Syncsort.

Does Syncsort have this also? My Syncsort stuff is at the site, not my house.

Than ks,

d
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Apr 25, 2014 12:47 pm
Reply with quote

Hi Dick,

Not sure about the other options, but Syncsort 1.4.1 does nt support ATOE or ETOA functions.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Apr 25, 2014 2:42 pm
Reply with quote

Unless it is on tape, I don't think you'll do it with SyncSort (can be wrong).

Get it to a PC and look at it there.

Ftp it somewhere else. Ftp it back again. Along the way, somewhere, attempt translation and get record-lengths/line-ends done as well.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Sat Apr 26, 2014 10:58 pm
Reply with quote

Hello Dick,
dick scherrer wrote:
Is there a way with the sort to read the file and write it back out as ebcdic? I've not been able to find an example and there are DFSORT topics that mention there is no such capability in DFSORT.

Thoughts . . . Suggestions?
If SyncSort is not the only solution you are looking at, below Job can be considered as other thought, possibly icon_smile.gif :

Code:
//STEP01 EXEC PGM=IKJEFT01
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//ASCIN DD DSN=ascii.dataset,DISP=SHR
//EBCOUT DD DSN=ebcdic.dataset,
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(xx,xx),RLSE),
//SYSTSIN DD *
OCOPY INDD(ASCIN) OUTDD(EBCOUT) CONVERT((BPXFX311)) TO1047
/*


And without knowing the version of Syncsort at your shop - the general solution is to use TRAN=ALTSEQ feature, as was said earlier, but you'd need to provide your own ALTSEQ table to do the ASCII to EBCDIC translation as there isn't a standard table for that. You'd have to code your own chart for the conversion. For example, for an input data set with RECFM=FB and LRECL=80, you could use:
Code:

//SYSIN     DD *                                       
  SORT FIELDS=COPY
  OUTREC FIELDS=(1,80,TABLE=ALTSEQ)
  ALTSEQ CODE=(...)
/*

Assuming input/output are both FB/80.

Hope this helps.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Sun Apr 27, 2014 12:27 am
Reply with quote

There are more potential issues here than you can imagine.
  • Was the original data from Windoze or *nix? This is important for the next bullet, and probably others.
  • Was the original data a text file or a binary file?
  • Is there embedded binary data? You do not translate binary data to EBCDIC!

That will get you started.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Apr 28, 2014 8:43 am
Reply with quote

Hello,

Quote:
There are more potential issues here than you can imagine.
Oh, I rather seriously doubt that . . . And I'm way past started<g>

Quote:
•Is there embedded binary data? You do not translate binary data to EBCDIC!
Well, if the binary file got that way inadvertently, you can convert that binary data to ebcdic. . . The file appears to be a pure text file that was transferred as Binary.

I plan on using the code Akatsukami provided. Have not been on the mainframe since Thursday because that night the vehicles with lights and sirens took me away to the house with many beds . . . (hospital, e/r).

We'll see what the morrow brings.

Anuj, tried the OCOPY and I do not remember the reason it failed.

Apologies for the absence.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Mon Apr 28, 2014 9:12 am
Reply with quote

dick scherrer wrote:
... Have not been on the mainframe since Thursday because that night the vehicles with lights and sirens took me away to the house with many beds . . . (hospital, e/r). ...
Oh my. I hope you're OK.

It's been 6+ years since I had a similar trip, followed by an unwanted helicopter trip since the 2 local hospitals apparently were filled up. The ambulance ride was around 0100 so they didn't bother with the siren. While I remember the ambulance ride, and I'm certain about no siren, I don't know about flashing lights. Oddly enough, the helicopter trip wound up at the same hospital where I was born. A week or so later an ambulance hauled me back to one of the local hospitals that turned me away February 3 for what turned out to be nearly 3 months of rehab.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Apr 28, 2014 12:25 pm
Reply with quote

Take care, Dick.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Apr 28, 2014 12:25 pm
Reply with quote

Perhaps I was being pessimistic. I was thinking if transferred in error as BINARY what is the chance that someone got an LRECL in there correctly. If you have a problem knowing where one line ends and the next begins, send it back (BINARY) and receive it again (as a text file, into a pre-allocated DSN).
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Mon Apr 28, 2014 3:46 pm
Reply with quote

Bill Woodger wrote:
Perhaps I was being pessimistic. I was thinking if transferred in error as BINARY what is the chance that someone got an LRECL in there correctly. If you have a problem knowing where one line ends and the next begins, send it back (BINARY) and receive it again (as a text file, into a pre-allocated DSN).
Good advice if the source system is known and available, which does not appear to be the case here.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Mon Apr 28, 2014 4:12 pm
Reply with quote

dick scherrer wrote:
Have not been on the mainframe since Thursday because that night the vehicles with lights and sirens took me away to the house with many beds . . . (hospital, e/r).

Bad news; best wishes;
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon Apr 28, 2014 6:51 pm
Reply with quote

Get well quickly, dick.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Apr 28, 2014 7:32 pm
Reply with quote

Hope you get well quickly!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Apr 30, 2014 2:13 am
Reply with quote

Thanks everyone for the kind words - most appreciated icon_biggrin.gif

Finally got around the connection issues from the house and was able to run the code Akatsukami provided. Worked like a champ!

I've passed the converted file along and should hear rather quickly if it is what they were looking for.

Thanks again for everyone's participation.

d
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Apr 30, 2014 7:54 am
Reply with quote

Welcome back. Hope all is well.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Apr 30, 2014 10:36 pm
Reply with quote

Workin' on it . . .
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
Search our Forums:

Back to Top