|
View previous topic :: View next topic
|
| Author |
Message |
subha m
New User
Joined: 01 Jul 2010 Posts: 10 Location: UK
|
|
|
|
Hi everybody,
my sample i/p file:
INPUT:
------
20XXXX111123456AABB01...
30XXXX111123456AABB01...
40XXXX111123456AABB01....
20XXXX111123456BBCC02...
30XXXX111123456BBCC02...
40XXXX111123456BBCC02....
10xxxx111123456GHYTUKJJND...
20XXXX222234567AABB01...
30XXXX222234567AABB01...
40XXXX222234567AABB01....
20XXXX222234567CCDD02...
30XXXX222234567CCDD02...
40XXXX222234567CCDD02....
10xxxx222234567GHYTUKJJNd...
position 1,2 is the record identifier, for every record type of 10 there can be multiple (20,30,40) record for it.
text in yellow can be random. 10 is something like a header record for the group
sample OUTPUT:
--------------------
10xxxx111123456GHYTUKJJND...
20XXXX111123456AABB01...
30XXXX111123456AABB01...
40XXXX111123456AABB01....
20XXXX111123456BBCC02...
30XXXX111123456BBCC02...
40XXXX111123456BBCC02....
10xxxx222234567GHYTUKJJND...
20XXXX222234567AABB01...
30XXXX222234567AABB01...
40XXXX222234567AABB01....
20XXXX222234567CCDD02...
30XXXX222234567CCDD02...
40XXXX222234567CCDD02....
could be simple to u guys..but am not able to find the answer.
let know if above post is not clear or require further info..Thanks
Edited |
|
| Back to top |
|
 |
subha m
New User
Joined: 01 Jul 2010 Posts: 10 Location: UK
|
|
|
|
| Its a VB file, LRECL=900 |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
subha m,
Your post is confusing at best. Please don't put colors and definitely Not yellow color.
From what I see is that your 10 record is at the bottom of 20,30,40 records and all you need is to bring it to the top as the first record? and leave the other records as is?
Is that it or something else? |
|
| Back to top |
|
 |
subha m
New User
Joined: 01 Jul 2010 Posts: 10 Location: UK
|
|
|
|
| Sorry to be confusing and the color, yes, need to bring the 10 record to the top of the group |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
subha m,
Use the following DFSORT JCL which will give you the desired results
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Your input VB file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,16X,5)),
IFTHEN=(WHEN=GROUP,END=(21,2,ZD,EQ,10),PUSH=(5:ID=8,SEQ=8)),
IFTHEN=(WHEN=(21,2,ZD,EQ,10),OVERLAY=(13:8C'0'))
SORT FIELDS=(5,16,CH,A)
OUTREC BUILD=(1,4,21)
//* |
|
|
| Back to top |
|
 |
subha m
New User
Joined: 01 Jul 2010 Posts: 10 Location: UK
|
|
|
|
Thanks Skolusu for your valuable help and time ..
But they seem to be using syncsort here and its not working for me Sorry for wasting ur efforts. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
If your system uses the current release of Syncsort, i believe the code will work. Which release of Syncsort is being used?
Post all of the informational/diagnostic output from the run. |
|
| Back to top |
|
 |
subha m
New User
Joined: 01 Jul 2010 Posts: 10 Location: UK
|
|
|
|
| my system uses syncsort 1.3.0, this doesnt seem to support..this doesnt seem to support GROUP . sorry am away from system, will try to post the exact msg later |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
Hello Subha,
As pointed above, the WHEN=GROUP function is supported by the latest release of SyncSort which is SyncSort for z/OS Release 1.3.2. You said a 'Group' ends with a '10' record. Does a 'Group' always start with a '20' record? |
|
| Back to top |
|
 |
subha m
New User
Joined: 01 Jul 2010 Posts: 10 Location: UK
|
|
|
|
| Code: |
SYNCSORT FOR Z/OS 1.3.0.2R U.S. PATENTS: 4210961, 5117495 (C) 2007 SYNCSO
SORTPARM :
SYSIN :
INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,16X,5)),
IFTHEN=(WHEN=GROUP,END=(21,2,ZD,EQ,10),PUSH=(5:ID=8,SEQ=8)),
*
IFTHEN=(WHEN=(21,2,ZD,EQ,10),OVERLAY=(13:8C'0'))
SORT FIELDS=(5,16,CH,A)
OUTREC BUILD=(1,4,21)
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE |
This is the error message i am getting.
Yes, the 20,30,40 always are written in that order, I only need to bring the '10' record to the beginning of the group |
|
| Back to top |
|
 |
CICS Guy
Senior Member

Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
| I know that this is probably a stupid question, but why not just sort the file to get the '10' records back in sequence? |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
Hi CG,
As per my understanding of the requirement, there are multiple '10' records and they should come at the beginning of each group. If we sort the data as such, all the '10' records will come at the top which is not what the TS wants. |
|
| Back to top |
|
 |
subha m
New User
Joined: 01 Jul 2010 Posts: 10 Location: UK
|
|
|
|
| Yes, thats correct..we need the '10' at the beginning of each group |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
subha m,
Here's an untested piece of code which should work for your requirement. Try it and let us know.
| Code: |
INREC IFTHEN=(WHEN=INIT,
BUILD=(1,4,SEQNUM,8,ZD,16X,5)),
IFTHEN=(WHEN=(29,2,ZD,EQ,10),
OVERLAY=(13:SEQNUM,8,ZD,START=0)),
IFTHEN=(WHEN=NONE,
OVERLAY=(21:SEQNUM,8,ZD,
13:5,8,ZD,SUB,21,8,ZD,M11,LENGTH=8))
SORT FIELDS=(13,16,CH,A)
OUTREC BUILD=(1,4,29) |
|
|
| Back to top |
|
 |
subha m
New User
Joined: 01 Jul 2010 Posts: 10 Location: UK
|
|
|
|
Arun..It worked!!! Many Thanks  |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
You're welcome. Glad that it worked for you.  |
|
| Back to top |
|
 |
subha m
New User
Joined: 01 Jul 2010 Posts: 10 Location: UK
|
|
|
|
hi arun,
sorry to come back with some more questions. but
WHEN=INIT executes before other conditions, but can u pls explain the
BUILD=(1,4,SEQNUM,8,ZD,16X,5)), in the below code
INREC IFTHEN=(WHEN=INIT,
BUILD=(1,4,SEQNUM,8,ZD,16X,5)), |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
subha m,
16X - leaves 16 spaces starting at pos-13, which is later on used to place sequence numbers in the subsequent IFTHEN conditions. The sequence numbers are padded in the beginning in order to 'GROUP' records.
5- Places the data portion of the VB record which starts at pos-5, Since length of a VB record is variable, you need not mention the length information |
|
| Back to top |
|
 |
subha m
New User
Joined: 01 Jul 2010 Posts: 10 Location: UK
|
|
|
|
| Is it 16 spaces starting at position13, Where do we specify the starting position as 13? Did i miss something? |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
| Quote: |
| BUILD=(1,4,SEQNUM,8,ZD,16X,5) |
You don't need to specify the output position unless you need to place it explicitly at some position. Here the first 12 bytes are already occupied by the RDW and Sequence number, hence it's quite obvious that next output postion is 13. Do you have a SyncSort manual? If you dont have one, request one from SyncSort Support or Contact/Send a PM to Alissa Margulies(JCL Moderator). They'll help you in getting you one soon. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|