MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Comma Seperated File

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
vijay
Beginner


Joined: 09 May 2003
Posts: 131
Topics: 64

PostPosted: Fri May 23, 2003 9:35 am    Post subject: Comma Seperated File Reply with quote

Hi ,

I've a file like this
"feild1","feild2","feild3","","","feild4"
A comma seperated file with each feild value enclosed in double quotes.

I need an output file like this
feild1 feild2 feild3 (blank) (blank) feild4
with no double quotes and no commas and each feild starting at a specific byte.
I need to use this output file in another program.
I can do this with easytreive.But I would like to like to know if we can do this
using syncsort or any other utility.

Vijay
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Fri May 23, 2003 10:10 am    Post subject: Reply with quote

Vijay,
I do not use Syncsort. But, purely out of a programmer's curiosity, I would like to ask, whether, the lengths of field1, field2 etc. will be always be constant. At my place, often a character delimited file has trailing blanks in a field removed, so the field length becomes "variable". That is, the field might have been defined in a COBOL program as PIC X(5), but the type of data might make it's actual length to anything between 0 and 5. If this is the case, then I hope, you understand the onerous nature of your requirement. You will not be sure of the starting field or of it's length; these being the basic requirements of any SORT product.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
vijay
Beginner


Joined: 09 May 2003
Posts: 131
Topics: 64

PostPosted: Tue May 27, 2003 8:59 am    Post subject: Reply with quote

Do u guys have any solution for this in SAS ?If you know post the solution.I want to read the external file and create an external file as output.Please give the JCL
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Tue May 27, 2003 4:46 pm    Post subject: Reply with quote

Vijay,

This code is an example of the kind of thing you need. The most important word is DSD:

[code:1:488dfcac85]
//G774909P JOB (7749),'FASTLOAD CSV',
// CLASS=C,MSGCLASS=E,NOTIFY=G774909
//*
//STEP010 EXEC SAS6 <== this may not match your version of SAS
//SYSPRINT DD SYSOUT=*
//FILEOUT DD DSN=&&CSV,DISP=(,PASS),
// UNIT=SYSDA,SPACE=(1,(5,1),RLSE),AVGREC=M,
// RECFM=FB,LRECL=80
//FILEIN DD *
101.1,FIELD002,FLD3,FIELD004
"2","FLD002","FIELD3","FIELD004"
32,FD002,,FLD004
,FD2,,
//SYSIN DD *
DATA _NULL_;
INFILE FILEIN DSD;
INPUT FIELD1 FIELD2
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue May 30, 2006 2:22 pm    Post subject: Reply with quote

With z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006), you can now use DFSORT's new PARSE function to do this kind of thing, as shown by the DFSORT job below:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
"field1","field2","field3","","","field6"
"","field2","","field4","field5",""
"field1","","","","field5","field6"
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC PARSE=(%01=(STARTAFT=C'"',ENDBEFR=C'"',FIXLEN=8),
               %02=(STARTAFT=C'"',ENDBEFR=C'"',FIXLEN=8),
               %03=(STARTAFT=C'"',ENDBEFR=C'"',FIXLEN=8),
               %04=(STARTAFT=C'"',ENDBEFR=C'"',FIXLEN=8),
               %05=(STARTAFT=C'"',ENDBEFR=C'"',FIXLEN=8),
               %06=(STARTAFT=C'"',ENDBEFR=C'"',FIXLEN=8)),
    BUILD=(%01,%02,%03,%04,%05,%06)
/*


SORTOUT has:

Code:

field1  field2  field3                  field6   
        field2          field4  field5           
field1                          field5  field6   


For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTFs, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Thu Apr 19, 2007 7:55 am    Post subject: Reply with quote

Any solutions to this using SYNCSORT? Question
Back to top
View user's profile Send private message
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Thu Apr 19, 2007 11:55 am    Post subject: Reply with quote

Support for delimited fields and the PARSE feature will be available in SyncSort for z/OS shortly.
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Thu Apr 19, 2007 2:14 pm    Post subject: Reply with quote

Alissa,

Any documentation on the same ?? Please let me know..
Back to top
View user's profile Send private message
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Thu Apr 19, 2007 3:44 pm    Post subject: Reply with quote

Martin,

When these features become available, they will be fully documented.
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Apr 19, 2007 3:49 pm    Post subject: Reply with quote

Quote:

Martin,

When these features become available, they will be fully documented.


Syncsort Z/OS 1.2 supports IFTHEN, Overlay, Build parms, I don't see any documentation of the above features in syncsort z/os 1.2 Programmer's guide.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Fri Apr 20, 2007 12:55 pm    Post subject: Reply with quote

Quote:

Syncsort Z/OS 1.2 supports IFTHEN, Overlay, Build parms, I don't see any documentation of the above features in syncsort z/os 1.2 Programmer's guide.

Syncsort has created an Addendum to the SyncSort for z/OS 1.2 Programmer's Guide which documents the BUILD, IFTHEN, IFOUTLEN, and OVERLAY Parameters. This Addendum is available to any licensed SyncSort for z/OS customer upon request. These features, along with PARSE, JFY, and SQZ will also be fully documented in our upcoming SyncSort for z/OS 1.3 manuals.
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Apr 20, 2007 1:13 pm    Post subject: Reply with quote

Quote:

Syncsort has created an Addendum to the SyncSort for z/OS 1.2 Programmer's Guide which documents the BUILD, IFTHEN, IFOUTLEN, and OVERLAY Parameters. This Addendum is available to any licensed SyncSort for z/OS customer upon request. These features, along with PARSE, JFY, and SQZ will also be fully documented in our upcoming SyncSort for z/OS 1.3 manuals.


amargulies,

Thanks for the prompt response.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group