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
 

 

Syncsort Convert FROM Ascii

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
dick scherrer

Site Director


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

PostPosted: Fri Apr 25, 2014 1:50 am    Post subject: Syncsort Convert FROM Ascii
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: 1738
Location: Bloomington, IL

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

Is this of any use?
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 Apr 25, 2014 3:13 am    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Fri Apr 25, 2014 4:50 am    Post subject:
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

Site Director


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

PostPosted: Fri Apr 25, 2014 6:14 am    Post subject:
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: 2158
Location: @my desk

PostPosted: Fri Apr 25, 2014 12:47 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Apr 25, 2014 2:42 pm    Post subject: Reply to: Syncsort Convert FROM Ascii
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

Senior Member


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

PostPosted: Sat Apr 26, 2014 10:58 pm    Post subject: Re: Syncsort Convert FROM Ascii
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 User


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

PostPosted: Sun Apr 27, 2014 12:27 am    Post subject:
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

Site Director


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

PostPosted: Mon Apr 28, 2014 8:43 am    Post subject:
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 User


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

PostPosted: Mon Apr 28, 2014 9:12 am    Post subject:
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

Senior Member


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

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

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Apr 28, 2014 12:25 pm    Post subject: Reply to: Syncsort Convert FROM Ascii
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 User


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

PostPosted: Mon Apr 28, 2014 3:46 pm    Post subject: Re: Reply to: Syncsort Convert FROM Ascii
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: 1738
Location: Bloomington, IL

PostPosted: Mon Apr 28, 2014 4:12 pm    Post subject:
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: 1238
Location: Richfield, MN, USA

PostPosted: Mon Apr 28, 2014 6:51 pm    Post subject:
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: 7904
Location: Bellevue, IA

PostPosted: Mon Apr 28, 2014 7:32 pm    Post subject: Reply to: Syncsort Convert FROM Ascii
Reply with quote

Hope you get well quickly!
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: Wed Apr 30, 2014 2:13 am    Post subject:
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: 1238
Location: Richfield, MN, USA

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

Welcome back. Hope all is well.
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: Wed Apr 30, 2014 10:36 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am


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