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?
hold records temporarily?
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: hold records temporarily?
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=(…,/,…))
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=(…,/,…))
Javas and Pythons come and go, but JCL and SORT stay forever.
-
- Posts: 3
- Joined: Wed Dec 08, 2021 3:59 am
- Skillset: mainframe operations
- Referer: web search
Re: hold records temporarily?
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.
I'll see if I can find an explanation of the other statements you mention.
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: hold records temporarily?
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:
Code: Select all
IF A > B
C = D + 1
END-IF
or a fragment of formatted data:
Code: Select all
111111 AAAAAA BBBBBB
000999 XXXXXX ZZZZZZ
If you refuse doing so, many readers would ignore your questions.
Javas and Pythons come and go, but JCL and SORT stay forever.
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: hold records temporarily?
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.
Last edited by sergeyken on Thu Dec 09, 2021 7:20 pm, edited 1 time in total.
Javas and Pythons come and go, but JCL and SORT stay forever.
-
- Posts: 3
- Joined: Wed Dec 08, 2021 3:59 am
- Skillset: mainframe operations
- Referer: web search
Re: hold records temporarily?
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...
I'm in the manual, and have been for quite some time...
Thanks for nothing...
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: hold records temporarily?
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.
Code: Select all
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))
Javas and Pythons come and go, but JCL and SORT stay forever.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Commit issued without hold and without close cursor statemen
by ravi11081992 » Sat Jan 22, 2022 2:42 pm » in DB2 - 2
- 2203
-
by engh
View the latest post
Tue Sep 20, 2022 6:07 pm
-
-
-
Insert records from File1 between records of File2
by Daouchiche » Wed Nov 10, 2021 6:37 am » in DFSORT/ICETOOL/ICEGENER - 6
- 2317
-
by sergeyken
View the latest post
Thu Nov 11, 2021 12:43 am
-
-
- 3
- 3691
-
by naveenkumar sudha
View the latest post
Mon May 09, 2022 10:15 pm
-
-
File def'n-problem with different records layouts
by ralph » Tue Oct 26, 2021 10:47 pm » in IBM Cobol - 2
- 1502
-
by ralph
View the latest post
Wed Oct 27, 2021 1:42 am
-
-
-
Dropped records when FTP from mainframe to server
by MLK2348 » Tue Mar 19, 2024 9:19 pm » in All other Mainframe Topics - 2
- 3739
-
by sergeyken
View the latest post
Tue Apr 02, 2024 9:32 pm
-