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: 8593
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: 1243
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 Compare yesterday's date to the one o... migusd SYNCSORT 4 Fri Sep 22, 2017 11:35 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts editting the file by inserting zeros ... pramodrsingh DFSORT/ICETOOL 9 Mon Aug 21, 2017 5:58 pm

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