IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Looking for a Frank Yaeger article


 
IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: :: View next topic  
Author Message
Charles Wolters

New User


Joined: 30 Mar 2011
Posts: 48
Location: United States

PostPosted: Tue Jan 12, 2016 11:39 pm
Reply with quote

Does anyone have a copy of Frank Yaeger's article: DFSORT: Parsing Delimited & Variable Length Fields? I think it was originally published in z/Journal in 2007 but its URL appears defunct. I did find a reprint at the following Web site but the figures cited by Frank are missing and it would be more informative with the figures. The article is very well written for a parsing newbie like myself.

Use [URL] BBCode for Links

Charles Wolters
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Wed Jan 13, 2016 1:09 am
Reply with quote

Did you search the IBM Mainframes DFSORT forum, for Frank Yeager/Yaeger posts? Could very well be that he posted it there as well.

HTH....
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8566
Location: Dubuque, Iowa, USA

PostPosted: Wed Jan 13, 2016 1:37 am
Reply with quote

Google found it for me at Use [URL] BBCode for Links
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

PostPosted: Wed Jan 13, 2016 1:41 am
Reply with quote

Except that's the same link which Charles provided :-)
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

PostPosted: Wed Jan 13, 2016 5:55 pm
Reply with quote

I've rebuilt the examples from the text. Note that there are "scannos" in the text as well (failure of the Optical Character Recognition after text is scanned).

Figure 1

Code:
  OPTION COPY
  INREC PARSE=(%00=(ENDBEFR=C',',
                    FIXLEN=8),
               %01=(ENDBEFR=C',',
                    PAIR=QUOTE,
                    FIXLEN=25),
               %02=(FIXLEN=7)),
        BUILD=(%00,
               %01,
                JFY=(SHIFT=LEFT,PREBLANK=C'"'),
               %02)


Data:
Code:
APRIL,"REX,SELF,DUMBO",GRAY


Output:
Code:
APRIL   REX,SELF,DUMBO           GRAY



Figure 2

Code:
  INREC PARSE=(%00=(ABSPOS=6,
                    ENDBEFR=C';',
                    FIXLEN=7),
               %=(ENDBEFR=C';'),
               %01=(ENDBEFR=C';',
                    FIXLEN=12),
               %02=(FIXLEN=12)),
        OVERLAY=(41:
                  %02,
                 55:
                  %01,
                 70:
                  %00,
                   UFF,TO=PD,LENGTH=4)
                                     
  SORT FIELDS=(41,12,CH,A,
               55,12,CH,A,
               70,4,CH,A)
                                     
  OUTREC BUILD=(1,40)


Data:
Code:
0001;16,786;R732;SUE V;RITZ
0002;20;SALES;RUPERT THE;BEAR
0003;10.01;R732;SUE V;RITZ


Output:
Code:
0002;20;SALES;RUPERT THE;BEAR
0003;10.01;R732;SUE V;RITZ   
0001;16,786;R732;SUE V;RITZ 



Figure 3

Code:
  INREC IFTHEN=(WHEN=INIT,
                 PARSE=(%1=(STARTAFT=C'FIRST=',
                            ENDBEFR=C' ',FIXLEN=8))),
        IFTHEN=(WHEN=INIT,
                 PARSE=(%2=(STARTAFT=C'MIDDLE=',
                            ENDBEFR=C' ',FIXLEN=12))),
        IFTHEN=(WHEN=INIT,
                 PARSE=(%3=(STARTAFT=C'LAST=',
                            ENDBEFR=C' ',FIXLEN=12))),
        IFTHEN=(WHEN=INIT,
                 PARSE=(%4=(STARTAFT=C'PROFIT=',
                            STARTAFT=C'LOSS=',
                            ENDBEFR=C' ',FIXLEN=7))),
        IFTHEN=(WHEN=INIT,
                 BUILD=(%01,
                        %02,
                        %03,
                        %04,
                          SFF,
                          EDIT=(IIT.TTS),
                          SIGNS=(,,+,-)))
  SORT FIELDS=COPY


Data:
Code:
MIDDLE=JEFFERSON FIRST=GEORGE LAST=WASHINGTON LOSS=152.03-
 FIRST=SPACE                               LAST=SHIP


Output:
Code:
GEORGE  JEFFERSON   WASHINGTON  152.03-
SPACE               SHIP          0.00+


The article is indeed very good, as it shows some powerful use of PARSE, and trickier to follow without the examples.

I've included a link to this in the comments part of the article.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

PostPosted: Wed Jan 13, 2016 9:36 pm
Reply with quote

There is a way to use ABSPOS=1, discussed by Frank Yaeger in the article, for the final example, so that the PARSE can be done only once:

Code:
  INREC IFTHEN=(WHEN=INIT,
                      OVERLAY=(81:
                                C' FIRST= ',
                                C' LAST= ',
                                C' MIDDLE= ',
                                C' PROFIT= ',
                                C' LOSS= ')),
        IFTHEN=(WHEN=INIT,
                 PARSE=(%1=(STARTAFT=C'FIRST=',
                            ABSPOS=1,
                            ENDBEFR=C' ',FIXLEN=8),
                        %2=(STARTAFT=C'MIDDLE=',
                            ABSPOS=1,
                            ENDBEFR=C' ',FIXLEN=12),
                        %3=(STARTAFT=C'LAST=',
                            ABSPOS=1,
                            ENDBEFR=C' ',FIXLEN=12),
                        %4=(STARTAFT=C'PROFIT=',
                            ABSPOS=1,
                            STARTAFT=C'LOSS=',
                            ENDBEFR=C' ',FIXLEN=7))),
        IFTHEN=(WHEN=INIT,
                 BUILD=(%01,
                        %02,
                        %03,
                        %04,
                          SFF,
                          EDIT=(IIT.TTS),
                          SIGNS=(,,+,-)))
 SORT FIELDS=COPY


The code ensures that a parameter will always be found, even if not existing in the source data, by adding all the valid parameters to the end of each record.

In itself, not especially useful, but it is a very convenient way to set default values for keyword-field parsing.

Code:
  INREC IFTHEN=(WHEN=INIT,
                      OVERLAY=(81:
                                C' FIRST=JOE ',
                                C' LAST=BLOGS ',
                                C' MIDDLE=X ',
                                C' PROFIT=+30.00 ',
                                C' LOSS= ')),
        IFTHEN=(WHEN=INIT,
                 PARSE=(%1=(STARTAFT=C'FIRST=',
                            ABSPOS=1,
                            ENDBEFR=C' ',FIXLEN=8),
                        %2=(STARTAFT=C'MIDDLE=',
                            ABSPOS=1,
                            ENDBEFR=C' ',FIXLEN=12),
                        %3=(STARTAFT=C'LAST=',
                            ABSPOS=1,
                            ENDBEFR=C' ',FIXLEN=12),
                        %4=(STARTAFT=C'PROFIT=',
                            ABSPOS=1,
                            STARTAFT=C'LOSS=',
                            ENDBEFR=C' ',FIXLEN=7))),
        IFTHEN=(WHEN=INIT,
                 BUILD=(%01,
                        %02,
                        %03,
                        %04,
                          SFF,
                          EDIT=(IIT.TTS),
                          SIGNS=(,,+,-)))
 SORT FIELDS=COPY


The actual example doesn't lend itself to defaults as such, but serves. Here is the output from a blank line of input:

Code:
JOE     X           BLOGS        30.00+


It's also a good example for the use of DFSORT symbols/SYMNAMES...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Any news on Frank Yaeger ? General Talk & Fun Stuff 5
No new posts Article: Will there be a jobless reco... General Talk & Fun Stuff 1
No new posts Documentation disagreements - one for... DFSORT/ICETOOL 7
No new posts I wonder what Frank has to say on this General Talk & Fun Stuff 4
No new posts DFSORT article in z/Journal (Oct/Nov) DFSORT/ICETOOL 4

Back to Top