View previous topic :: View next topic
|
Author |
Message |
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Verry Possibly!
I'll give it a try later tonight or tomorow . . .
Thanks
d |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3049 Location: NYC,USA
|
|
|
|
Dick,You can try for TRAN=ATOE ( DFSORT) or OCOPY or OGET options. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi Dick,
Not sure about the other options, but Syncsort 1.4.1 does nt support ATOE or ETOA functions. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 :
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 |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Take care, Dick. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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 |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Get well quickly, dick. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Hope you get well quickly! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Thanks everyone for the kind words - most appreciated
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 |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Welcome back. Hope all is well. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Workin' on it . . . |
|
Back to top |
|
|
|