View previous topic :: View next topic |
Author |
Message |
mfsrini Beginner
Joined: 10 Aug 2006 Posts: 11 Topics: 6
|
Posted: Wed Apr 07, 2010 5:28 am Post subject: Reordering of the records through SYNCSORT |
|
|
Hi,
My requirement is as below:
Input file has the records in the following order starts with 1 and ends with 9 in the first position of the file.
1
2
3
5
5
9
I want to reorder the file with the following order in the output file.
2
1
3
5
5
9
Please let me know is it possible to do reordering the records using SORT. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Apr 07, 2010 10:29 am Post subject: |
|
|
mfsrini,
Use the following DFSORT JCL
Code: |
//STEP0100 EXEC PGM=SORT
//SORTIN DD *
1
2
3
5
5
9
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,1,AQ,A)
ALTSEQ CODE=(F240)
//* |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
mfsrini Beginner
Joined: 10 Aug 2006 Posts: 11 Topics: 6
|
Posted: Wed Apr 07, 2010 11:09 pm Post subject: |
|
|
Hi Kolusu,
thanks for providing the reply. The asked question is just a part of my requirement. My actual requirement need so many other changes as below:
Reorder the file with each '1' record after each '2' record. Also Remove any records with a ' ' (blank) in position 1.
For the 2 record, hard code in position 220 'ABS'.
For the 2 record, hard code in position 223 '875'.
Copy the value from the '1' record postions 2 thru 5 to the 2 record positions 226-229.
Possible record types, column 1 are: blank, 1,2,3,4,5,6,9.
Ex: The input file looks like this:
Code: |
18220
2
3
5
5
9
blank in col 1
18234
2
3
5
9
18220
2
3
5
5
9
|
Ex: the output file need to be like as this.
Code: |
2 ABS8758220
18220
3
5
5
9
2 ABS8758234
18234
3
5
9
2 ABS8758220
18220
3
5
5
9
|
Please let me know the above requirement is possible through SORT?
I am sure you can help me on this.
Regards,
Srini |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Apr 08, 2010 12:03 am Post subject: |
|
|
mfsrini wrote: | Hi Kolusu,
thanks for providing the reply. The asked question is just a part of my requirement. My actual requirement need so many other changes
|
Why can't you provide ALL of the details at once? You are just wasting my time as well as your time
mfsrini wrote: | I am sure you can help me on this. |
I can't provide solutions with a moving target. Post all the details
1. What is the LRECL and RECFM of the input and output file?
2. What are the rules of changing the 1 and 2 record?
3. Use code blocks to preserve the formatting of data. Read this
http://mvsforums.com/helpboards/viewtopic.php?p=19031#19031
4. Last but not last what sort product are you using? Run the following Job and show me the entire sysout
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
A
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
//* |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
mfsrini Beginner
Joined: 10 Aug 2006 Posts: 11 Topics: 6
|
Posted: Thu Apr 08, 2010 4:28 am Post subject: |
|
|
Hi Kolusu,
Sorry for making you trouble. This is happened because of change in our requirements.
Answers to your questions are as below:
1) Input and Output file LRECL=250 and RECFM=FB
2) There are no other rules to change in 1 and 2 records other than mentioned in the requirements.
4) We are using SYNCSORT. I ran asked JCL and the sysout is as below:
Code: |
---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8-
********************************* TOP OF DATA **********************************
SYNCSORT FOR Z/OS 1.3.2.1R U.S. PATENTS: 4210961, 5117495 (C) 2007 SYNCSO
SYNCSORT RUN FOR SUPERVALU INC. z/OS 1.
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 27FDD, MODEL 2094 707 LICEN
SYSIN :
SORT FIELDS=COPY
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER054I RCD IN 1, OUT 1
WER169I RELEASE 1.3 BATCH 0487 TPF LEVEL 2.1
WER052I END SYNCSORT - HOSXK0S5,SORT0040,,DIAG=CE00,4088,E206,00EE,86FA,69A2,A
******************************** BOTTOM OF DATA ********************************
|
First time, I have used bbcode format. I am not sure whether it will show properly or not. Please let me know if you require any other info.
Once again apologize. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Apr 08, 2010 10:20 am Post subject: |
|
|
mfsrini,
Your sysout messages indicate you are using syncsort. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort. _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
mfsrini Beginner
Joined: 10 Aug 2006 Posts: 11 Topics: 6
|
Posted: Mon Apr 12, 2010 3:16 am Post subject: |
|
|
Hi,
If any one knows the answer for my queries in syncsort, please help me out. |
|
Back to top |
|
 |
|
|