|
View previous topic :: View next topic
|
| Author |
Message |
Abhishek Goel
New User
Joined: 05 Apr 2006 Posts: 6 Location: India
|
|
|
|
Hi folks,
I am trying to sort a file which has records in batches (Blue is one batch and green is the other) and each batch has records of different types (20, 40, 60). The layout is like this:
aaaaaaaaaa 20 aa 2222222222
bbbbbbbbbb 40 bb low-values
dddddddddd 60 cc low-values
eeeeeeeeee 20 dd 1111111111
gggggggggg 40 ee low-values
hhhhhhhhhh 60 ff low-values
Now only the 20 type records have account number value depicted here by 111111111 and 222222222, the 40 and 60 type records have low values…. I want the file to be sorted on the account number keeping the batch still together. In the above example the output should be like:
eeeeeeeeee 20 dd 1111111111
gggggggggg 40 ee low-values
hhhhhhhhhh 60 ff low-values
aaaaaaaaaa 20 aa 2222222222
bbbbbbbbbb 40 bb low-values
dddddddddd 60 cc low-values
I tried using Syncsort to achieve this by copying the account number from the 20 type records to the end of all the records in the particular batch (after doing which the file would look like as follows), then sort the file on the added account number at the end of the record and then remove it from going to the output file by just copying the required fields to the output record.
aaaaaaaaaa 20 aa 2222222222 2222222222
bbbbbbbbbb 40 bb low-values 2222222222
dddddddddd 60 cc low-values 2222222222
eeeeeeeeee 20 dd 1111111111 1111111111
gggggggggg 40 ee low-values 1111111111
hhhhhhhhhh 60 ff low-values 1111111111
I used the following SYSIN card to achieve this and was able to copy the account number at the end of the 20 type record but not to the remaining records of the batch.. (The input file is 600 bytes in length and the account number is 19 byte long starting at 552)
| Code: |
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(55,2,CH,EQ,C'20'),
PARSE=(%00=(ABSPOS=552,FIXLEN=19)),
OVERLAY=(601:%00),HIT=NEXT),
IFTHEN=(WHEN=(55,2,CH,NE,C'20'),
OVERLAY=(601:%00))
/* |
but I kept getting the error message:
| Code: |
SYSIN :
OPTION COPY
INREC IFTHEN=(WHEN=(55,2,CH,EQ,C'20'),
PARSE=(%00=(ABSPOS=552,FIXLEN=19)),
OVERLAY=(601:%00),HIT=NEXT),
IFTHEN=(WHEN=(55,2,CH,NE,C'20'),
OVERLAY=(601:%00))
*
WER271A INREC STATEMENT : NUMERIC FIELD ERROR |
Please help me get through this… |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
| Quote: |
| WER271A INREC STATEMENT : NUMERIC FIELD ERROR |
This message indicates that you use SYNCSORT and NOT DFSORT. But PARSE function is supported by Syncsort Release 1.3. See the SYSOUT messages to see which version you're having.
BTW, Do you expect duplicate types (20, 40, 60) in each group? |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Your "other" topic for the same question has been locked. . .
Knowing that you use Syncsort, it is not proper to post your question in the DFSORT part of the forum.
Please do not double-post as that is a quick way to be excused from further participation. . .  |
|
| Back to top |
|
 |
Abhishek Goel
New User
Joined: 05 Apr 2006 Posts: 6 Location: India
|
|
|
|
Hi,
I am not using SYNCSORT.. I am using DFSORT ICEMAN... I am sorry for mistakenly mentioning SYNCSORT in the subject line.. Thats why I posted the same topic under the DFSORT category.. I am sorry for the incovinience.. I wil take care of it going forward.. Could you please unlock the topic from DFSORT category? I need to get this solved ASAP... Am sorry again and thanks for being concerned...
Abhi |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| WER271A INREC STATEMENT : NUMERIC FIELD ERROR |
This message indicates you're using Syncsort. If you were using DFSORT, you'd see ICExxxs messages, not WERxxxs messages. Why do you think you're using DFSORT? |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10900 Location: italy
|
|
|
|
| Quote: |
| I am not using SYNCSORT.. I am using DFSORT ICEMAN... |
from Your previous post
| Quote: |
| WER271A INREC STATEMENT : NUMERIC FIELD ERROR |
the WER prefix message shows indeed that You are using SYNCSORT
using in the jcl PGM=ICEMAN does not mean that You are using IBM DFSORT
The Syncsort installation process makes ICEMAN an alias for SYNCSORT |
|
| Back to top |
|
 |
Abhishek Goel
New User
Joined: 05 Apr 2006 Posts: 6 Location: India
|
|
|
|
Hi...
Thanks for straightening me out.. I am sorry I was not aware of that... How can we possibly achieve what I am looking for using SYNCSORT ... Please help... |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello Abhi (and a belated welcome to the forum),
Which release of Syncsort is being used on your system? If you are not sure, the release is shown in the informational output created each time the sort is run.
Your problem may be the PARSE statement:
| Quote: |
| PARSE is supported in SyncSort for z/OS 1.3. |
|
|
| Back to top |
|
 |
Abhishek Goel
New User
Joined: 05 Apr 2006 Posts: 6 Location: India
|
|
|
|
Hi Dick...
Thanks for the warm welcome :-)
THis is what sysout says:
SYNCSORT FOR Z/OS 1.3.0.2R
so I think it is the version 1.3 |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
| Quote: |
| so I think it is the version 1.3 |
I think so too
PARSE should work with 1.3.
Please run your job again and this time copy/paste the entire informational SYSOUT dataset from the run. Please do not edit anything by hand.
I don't have access to a 1.3 system, so i can't run a test. |
|
| Back to top |
|
 |
Abhishek Goel
New User
Joined: 05 Apr 2006 Posts: 6 Location: India
|
|
|
|
Thanks everyone for the help.. I found a solution to the problem using ICETOOL:
| Code: |
//TOOLIN DD *
COPY FROM(SORTIN00) TO(TEMP) USING(CP00)
SPLICE FROM(TEMP) TO(OUT00) ON(601,8,CH) WITH(1,616) WITHALL KEEPBASE
SORT FROM(OUT00) TO(OUT01) USING(CP01)
/*
//CP00CNTL DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(601:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(55,2,CH,EQ,C'20'),
OVERLAY=(617:579,3,620:552,19,601:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(55,2,CH,NE,C'20'),
OVERLAY=(609:SEQNUM,8,ZD,601:601,8,ZD,SUB,
609,8,ZD,M11,LENGTH=8))
/*
//CP01CNTL DD *
SORT FIELDS=(617,22,CH,A,601,16,CH,A)
OUTREC FIELDS=(1,600)
/* |
|
|
| Back to top |
|
 |
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
| Thanks for posting your solution, Abhishek, but in the future please use BBCode to preserve actual character positions (see FAQ). |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Thank you for posting your solution - good to hear it is working
As Terry mentions, it is best to use the "Code" tag when posting source code, jcl, etc as it is far more readable (in addition to the green on black, it also preserves alignment).
Your solution has been "Code"ed to wshow how it will appear. When you are posting this kind of info, you can use the Preview to see your post as it will appear to the forum rather than how it appears n the Reply editor. When you are satisfied with how it appears, Submit. Make sure you click Submit or your post will be lost (i've done that a time or few ). |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|