Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort - sorting records of different types

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Abhishek Goel

New User


Joined: 05 Apr 2006
Posts: 6
Location: India

PostPosted: Tue Oct 14, 2008 12:06 pm    Post subject: Syncsort - sorting records of different types
Reply with quote

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
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2276
Location: @my desk

PostPosted: Tue Oct 14, 2008 1:27 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Oct 15, 2008 2:22 am    Post subject:
Reply with quote

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. . . icon_rolleyes.gif
Back to top
View user's profile Send private message
Abhishek Goel

New User


Joined: 05 Apr 2006
Posts: 6
Location: India

PostPosted: Wed Oct 15, 2008 3:42 am    Post subject: Reply to: Syncsort - sorting records of different types
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Oct 15, 2008 3:51 am    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Wed Oct 15, 2008 3:56 am    Post subject: Reply to: Syncsort - sorting records of different types
Reply with quote

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
View user's profile Send private message
Abhishek Goel

New User


Joined: 05 Apr 2006
Posts: 6
Location: India

PostPosted: Wed Oct 15, 2008 4:04 am    Post subject: Reply to: Syncsort - sorting records of different types
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Oct 15, 2008 4:56 am    Post subject:
Reply with quote

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
View user's profile Send private message
Abhishek Goel

New User


Joined: 05 Apr 2006
Posts: 6
Location: India

PostPosted: Wed Oct 15, 2008 11:18 am    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Oct 15, 2008 7:51 pm    Post subject:
Reply with quote

Hello,

Quote:
so I think it is the version 1.3
I think so too icon_smile.gif

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
View user's profile Send private message
Abhishek Goel

New User


Joined: 05 Apr 2006
Posts: 6
Location: India

PostPosted: Sun Oct 19, 2008 2:08 am    Post subject:
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Sun Oct 19, 2008 3:03 am    Post subject:
Reply with quote

Thanks for posting your solution, Abhishek, but in the future please use BBCode to preserve actual character positions (see FAQ).
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Oct 19, 2008 3:33 am    Post subject:
Reply with quote

Hello,

Thank you for posting your solution - good to hear it is working icon_smile.gif

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 icon_wink.gif ).
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 10 Thu May 25, 2017 3:49 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us