|
View previous topic :: View next topic
|
| Author |
Message |
rajeshmehra Currently Banned New User
Joined: 06 Dec 2022 Posts: 5 Location: India
|
|
|
|
I have a record of 10 pages and every page has policies and details, policies may be the same or different.
i want to add 1 line at the top of policies and 1 at the end but I have to compare the policies, if policies are matching/are similar. if polcies are matching then I have to add 1 line at the top and 1 at the end of similar policies.
Can u tell me the sort card logic? how to write? |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3112 Location: NYC,USA
|
|
|
|
Welcome!
You could have searched this forum or Google and provided input and expected output data .
ibmmainframes.com/about60729.html
I would let you search for trailer and twist the card. |
|
| Back to top |
|
 |
rajeshmehra Currently Banned New User
Joined: 06 Dec 2022 Posts: 5 Location: India
|
|
|
|
thank you, Rohit for your reply,
My Expected Output -
Code:
CUSTNO,ITEM,COST
1001,234,23.00
1001,437,87.00
1001,787,89.00
Add tails
CUSTNO,ITEM,COST
1002,777,20.00
1002,343,23.30
Add tails
CUSTNO,ITEM,COST
1003,778,09.00
1003,989,99.00
1003,999,99.00
Add tails
I have added the Tails line at the end of every data.
pls help me with code |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1448 Location: Bamberg, Germany
|
|
|
|
Adjust where necessary.
| Code: |
//WHATEVER EXEC PGM=ICEMAN
//SORTIN DD *
1001,234,23.00
1001,437,87.00
1001,787,89.00
1002,777,20.00
1002,343,23.30
1003,778,09.00
1003,989,99.00
1003,999,99.00
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=(SORTOUT),
SECTIONS=(1,4,SKIP=1L,
HEADER3=(C'CUSTNO,ITEM,COST'))
END
/* |
|
|
| Back to top |
|
 |
rajeshmehra Currently Banned New User
Joined: 06 Dec 2022 Posts: 5 Location: India
|
|
|
|
could u pls explain this logic,
how it is comparing the first 4 digits no. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3112 Location: NYC,USA
|
|
| Back to top |
|
 |
rajeshmehra Currently Banned New User
Joined: 06 Dec 2022 Posts: 5 Location: India
|
|
|
|
I am using this:
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT,
SECTIONS=(10,19,SKIP=P,
HEADER1=(1:'START',/,
1:'KEY ',/,
1:'LOB ',/,
1:'START',/,
1:'KEY '),
TRAILER1=(1:'END',/,
1:'END'))
but getting a syntax error ABENDU0223 |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1448 Location: Bamberg, Germany
|
|
|
|
When posting code/data, please use the code tag button.
HEADER1 and TRAILER1 do NOT belong inside a SECTION statement. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3112 Location: NYC,USA
|
|
|
|
| Topic will be locked soon . You need to read the manual link posted above and has everything needed. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2290 Location: USA
|
|
|
|
| rajeshmehra wrote: |
I am using this:
| Code: |
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT,
SECTIONS=(10,19,SKIP=P,
HEADER1=(1:'START',/,
1:'KEY ',/,
1:'LOB ',/,
1:'START',/,
1:'KEY '),
TRAILER1=(1:'END',/,
1:'END')) |
but getting a syntax error ABENDU0223 |
1) Please learn, how to use the Code button when posting
2) Please, read at least ANY SINGLE manual, before asking at the forum |
|
| Back to top |
|
 |
rajeshmehra Currently Banned New User
Joined: 06 Dec 2022 Posts: 5 Location: India
|
|
|
|
Suppose the below one is an input file where students' details are misplaced/unordered.
We want to compress the student's details by the student.
Like: the students1 has all records ( name, mob no. ) then student2 will start, and so on... also we want to write a single line ( start record ) before the student's details & after the end of the record ( end record )
let me know how to write the jcl sort logic.
Input File:
00001 student1 dept1 560
Name
00003 student3 dept2 520
Name
00004 student4 dept1 540
Name
Mob. No.
00005 student1 dept1 500
Mob. no.
00002 student3 dept3 510
Mob. No.
00006 student2 dept3 550
Mob. no.
00008 student2 dept1 530
Name
Expected O/P:
Start Record
00001 student1 dept1 560
Name
Mob. no.
End Record
Start Record
00002 student2 dept3 550
Name
Mob. no.
End Record
Start Record
00003 student3 dept2 520
Name
Mob. no.
End Record
Start Record
00004 student4 dept1 540
Name
Mob. No.
End Record
[/code] |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1448 Location: Bamberg, Germany
|
|
|
|
| If you have a different request, please open a new thread. Also show what you have attempted so far to solve your requirement. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3112 Location: NYC,USA
|
|
|
|
| Locked and please open a new thread with proper code tags. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|