Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Extracting fields from a delimited file and arranging the f

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
debojitpal

New User


Joined: 16 Jul 2009
Posts: 5
Location: Chennai

PostPosted: Tue Jul 21, 2009 3:13 pm    Post subject: Extracting fields from a delimited file and arranging the f
Reply with quote

Hi.... I have a space delimited file having four fields of the following format

abcdefgh 139 aa 12
asdgfsd 234 ff 98
asdfasdgasdgas 346 gt 34

I know the max length of each field. Is there a way to sort the file such that all the four fields come as separated. Please have a look at the attachment fot the output since if i type it here, the format is not coming properly.

Code:
abcdefgh                       139  aa  12
asdgfsd                        234  ff  98
asdfasdgasdgas                 346  gt  34


edited to take away attachment an tag the data with the CODE TAGS
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8620
Location: Back in jolly old England

PostPosted: Tue Jul 21, 2009 4:26 pm    Post subject:
Reply with quote

Please DO NOT post attachments as not everyone can open them.

This reduces the number of people available to help you.
Back to top
View user's profile Send private message
debojitpal

New User


Joined: 16 Jul 2009
Posts: 5
Location: Chennai

PostPosted: Tue Jul 21, 2009 5:04 pm    Post subject:
Reply with quote

Sorry...but there was formatting problem when i tried to write the output. icon_sad.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jul 21, 2009 9:00 pm    Post subject:
Reply with quote

debojitpal,

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=SORT                                   
//SYSOUT    DD  SYSOUT=*                                 
//SORTIN DD *                                           
abcdefgh 139 aa 12                                       
asdgfsd 234 ff 98                                       
asdfasdgasdgas 346 gt 34                                 
/*
//SORTOUT DD SYSOUT=*                                   
//SYSIN    DD    *                                       
  OPTION COPY                                           
  INREC PARSE=(%01=(ENDBEFR=C' ',FIXLEN=31),             
               %02=(ENDBEFR=C' ',FIXLEN=4),             
               %03=(ENDBEFR=C' ',FIXLEN=3),             
               %04=(FIXLEN=2)),                         
    BUILD=(%01,%02,%03,%04)                             
/*
Back to top
View user's profile Send private message
debojitpal

New User


Joined: 16 Jul 2009
Posts: 5
Location: Chennai

PostPosted: Wed Jul 22, 2009 9:25 am    Post subject:
Reply with quote

Frank,

Thanks a bunch...this code worked fine.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1252
Location: Israel

PostPosted: Wed Jul 22, 2009 12:48 pm    Post subject: Reply to: Extracting fields from a delimited file and arrang
Reply with quote

Nice!
And it works with SYNCSORT (ver 1.3.0) as well!
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us