Page 1 of 1

hold records temporarily?

PostPosted: Wed Dec 08, 2021 11:07 pm
by jamas001
looking for a way to stage each record temporarily until a condition with a record is met, then dump that record first and all the remaining records that were stored temporarily once a 2nd condition is met. example input:

record 1
record 2
record 3
member name
record 4
date

desired output:
member name
record 1
record 2
record 3
record 4
date

member name is the first condition to meet, and date is the 'dump all records' trigger... clear as mud?

Re: hold records temporarily?

PostPosted: Thu Dec 09, 2021 1:23 pm
by sergeyken
1. Learn how to use the CODE tags for your samples of code and data,

2. To “hold temporary” the desired record use
INREC IFTHEN=(WHEN=GROUP,…,PUSH=(…))

3. To change the order of output records use
OUTFIL OMIT=(…),IFTHEN=(WHEN=(…),BUILD=(…,/,…))

Re: hold records temporarily?

PostPosted: Thu Dec 09, 2021 6:25 pm
by jamas001
Thanks, I think... no idea what you mean by "code"

I'll see if I can find an explanation of the other statements you mention.

Re: hold records temporarily?

PostPosted: Thu Dec 09, 2021 6:59 pm
by sergeyken
jamas001 wrote:Thanks, I think... no idea what you mean by "code"

CODE is one of the buttons just above the window where you enter your message.
Click on it before entering any part of your message which represents a program code:
IF A > B
   C = D + 1
END-IF

or a fragment of formatted data:
111111 AAAAAA BBBBBB
000999 XXXXXX ZZZZZZ


If you refuse doing so, many readers would ignore your questions.

Re: hold records temporarily?

PostPosted: Thu Dec 09, 2021 7:13 pm
by sergeyken
jamas001 wrote:You'll see if I can find an explanation of the other statements you mention.

You could easily find the detailed explanation of my “other statements” if you ever opened any manual/reference/schoolbook on any SORT utility.

Without doing so it makes no sense to start coding.

Re: hold records temporarily?

PostPosted: Thu Dec 09, 2021 7:17 pm
by jamas001
wow, so belittling... am so glad I came here for help...

I'm in the manual, and have been for quite some time...

Thanks for nothing...

Re: hold records temporarily?

PostPosted: Thu Dec 09, 2021 8:10 pm
by sergeyken
jamas001 wrote:Thanks for nothing...

This is a help forum, not do-my-job-for-me forum :?

It’s a shame such responses to the correct answer, which is supposed to teach you thinking by your own, and not just stealing others work.


 INREC IFTHEN=(WHEN=GROUP,
               BEGIN=(1,10,SS,EQ,C’member’),
               PUSH=(81:1,80))
 SORT FIELDS=COPY
 OUTFIL OMIT=(1,80,CH,EQ,81,80,CH),
        REMOVECC,
        IFTHEN=(WHEN=(1,10,SS,EQ,C’record3’),
                BUILD=(1,80,/,81,80)),
        IFTHEN=(WHEN=NONE,
                BUILD=(1,80))