Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Sort help needed

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1201
Location: Bangalore,India

PostPosted: Tue Jul 01, 2014 11:34 am    Post subject: Sort help needed
Reply with quote

Hi All,

I have input file with FB and length 80 bytes like below

Code:
C100   Arun, Suresh
C200   John, Sam, Leah.ron, Joe
C300   Raj


and i want the output in below format

Code:
C100   Arun
C100   Suresh
C200   John
C200   Sam
C200   Leah.ron
C200   Joe
C300   Raj


I tried using Parse but number of name which will be comma separated are unknown.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7312

PostPosted: Tue Jul 01, 2014 12:43 pm    Post subject: Reply to: Sort help needed
Reply with quote

Well, you need to use PARSE. You may not know how many, but you know the maximum (since your records are fixed-length).

If you use ICETOOL's RESIZE with USING(xxxx) and there PARSE the maximum to fixed positions, you can exclude any blanks on OUTFIL OMIT=/INCLUDE=.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1201
Location: Bangalore,India

PostPosted: Tue Jul 01, 2014 2:56 pm    Post subject:
Reply with quote

Hello Bill,

Thanks for your input.
Code:
//TOOLIN DD *                                                       
  RESIZE FROM(IN) TO(OUT) TOLEN(60) USING(CPY1)                     
//CPY1CNTL DD *                                                     
  OPTION COPY                                                       
  OUTFIL PARSE=(%01=(ENDBEFR=C',',FIXLEN=20),                       
                %02=(ENDBEFR=C',',FIXLEN=20),                       
                %03=(ENDBEFR=C',',FIXLEN=20),                       
                %04=(ENDBEFR=C',',FIXLEN=20)),                       
  BUILD=(%01,/,1,4,%02,/,1,4,%03,/,1,4,%04),INCLUDE=(6,1,CH,NE,C' ')
/*           


But some changes required as output
Code:

C100 ARUN     
C100 SURESH   
C100         
C100         
C200 JOHN     
C200 SAM     
C200 LEAH.RON
C200 JOE     
C300 RAJ     
C300         
C300         
C300         


Please advise
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7312

PostPosted: Tue Jul 01, 2014 3:50 pm    Post subject: Reply to: Sort help needed
Reply with quote

You need OUTFIL OMIT= for where the name is blank.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1201
Location: Bangalore,India

PostPosted: Tue Jul 01, 2014 3:59 pm    Post subject:
Reply with quote

Tried but not working

Code:
//TOOLIN DD *                                     
  RESIZE FROM(IN) TO(OUT) TOLEN(60) USING(CPY1)   
//CPY1CNTL DD *                                   
  OPTION COPY                                     
  OUTFIL PARSE=(%01=(ENDBEFR=C',',FIXLEN=20),     
                %02=(ENDBEFR=C',',FIXLEN=20),     
                %03=(ENDBEFR=C',',FIXLEN=20),     
                %04=(ENDBEFR=C',',FIXLEN=20)),   
  OMIT=(6,1,CH,EQ,C' '),                         
  BUILD=(%01,/,1,4,%02,/,1,4,%03,/,1,4,%04)       
/*                         
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7312

PostPosted: Tue Jul 01, 2014 5:00 pm    Post subject: Reply to: Sort help needed
Reply with quote

Sorry, just flitting in and out, and didn't look at your code, just the output.

You need to do the PARSE on INREC, to make one long record with all your PARSEd fields on, noting that you need your 1,4 data prefixing each PARSEd field:

Code:
BUILD=(1,4,%01,1,4,%02,1,4,%03....)


You have 20 for your names, so you need the TOLEN to be 24. This will chop up your records into 24 bytes, and OUTFIL will see them one-at-a-time. So you have an OUTFIL just to do the OMIT (if you need final formatting, inserting of blanks perhaps, you can do it on BUILD in OUTFIL).

Check all the 20 bytes for space, else you can be trapped by a leading blank on a name.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts One-One matching using SORT dearlux SYNCSORT 7 Fri Oct 11, 2019 12:11 am
No new posts Create Dynamic Sort card with Omit co... balaji81_k DFSORT/ICETOOL 9 Thu Sep 26, 2019 10:06 pm
No new posts need assistance on a sort rajiv rengasamy SYNCSORT 11 Fri Jul 26, 2019 8:19 pm
No new posts need help with a tricky sort - Continued rajiv rengasamy SYNCSORT 8 Tue Jul 16, 2019 1:26 pm
No new posts Sort records within a data block rajiv rengasamy DFSORT/ICETOOL 0 Fri Jul 12, 2019 3:25 pm

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