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 count records & match with the count in trailer
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
t5590ag

Active User


Joined: 21 May 2009
Posts: 139
Location: United States

PostPosted: Thu Apr 29, 2010 7:20 pm    Post subject: Syncsort count records & match with the count in trailer
Reply with quote

Hi,

my requierement is as-

1 a
2 b
3 c
4 d
5 e
6 f
7 TRAILER 0006

I need to take the count of records(i.e. first 6 in example) in the file and then compare that count with the number that is mentioned against TRAILER(0006). How can it be done using SORT or other utility?
Now if that matches/not matches, is it possible to get some output/return code, based on which I'll run one more step to generate a mail ?
Back to top
View user's profile Send private message

t5590ag

Active User


Joined: 21 May 2009
Posts: 139
Location: United States

PostPosted: Thu Apr 29, 2010 7:22 pm    Post subject:
Reply with quote

file length can be taken as 80-FB.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 7:26 pm    Post subject:
Reply with quote

what are the exact column locations
of the word TRAILER
and
the count within the trailer record.
will the count always contain leading zeroes
and always be the same length?

can there be more than one trailer record?
are all records to be considered as detail records?
except
the trailer record, which you will define according to the above questions.
Back to top
View user's profile Send private message
t5590ag

Active User


Joined: 21 May 2009
Posts: 139
Location: United States

PostPosted: Thu Apr 29, 2010 7:36 pm    Post subject:
Reply with quote

Thanks for response.

File looks like this-


Code:
=COLS>    ----+----1----+----2--
001260    03111     99999     42
001261    TRAILER 001259       


This tells you the positioning and count information.
Leading zeroes presence depends on the count as you can see.

yes Length would be same.
Single trailer record wil be there.

Yes all records are same, kind of detail recs.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Apr 29, 2010 8:29 pm    Post subject:
Reply with quote

Below code will give you, RC 16 if count doesn't match else 0
Code:

//S1    EXEC  PGM=SORT                     
//SORTIN DD *                               
03111     99999     42                     
03111     99999     42                     
03111     99999     42                     
03111     99999     42                     
03111     99999     42                     
03111     99999     42                     
03111     99999     42                     
03111     99999     42                     
03111     99999     42                     
03111     99999     42                     
03111     99999     42                     
TRAILER 000112                             
//SORTOUT DD DSN=&&TEMP,DISP=(NEW,PASS)     
//SYSOUT    DD  SYSOUT=*                   
//SYSIN    DD  *                           
  SORT FIELDS=COPY                                               
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,6,ZD))               
  OUTFIL INCLUDE=(1,7,CH,EQ,C'TRAILER',AND,9,6,ZD,EQ,81,6,ZD),   
  NULLOFL=RC16                                                   
/*
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Apr 29, 2010 9:13 pm    Post subject:
Reply with quote

Opps... I have included trailer records also while comparing count.
In your first record shown there are 6 records so rec count at trailer is without including trailer record.
Do the change in sortcard as shown below to do what you expected.
Code:

//SYSIN    DD  *                                               
  SORT FIELDS=COPY                                             
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,6,ZD,START=0))     
  OUTFIL INCLUDE=(1,7,CH,EQ,C'TRAILER',AND,9,6,ZD,EQ,81,6,ZD), 
  NULLOFL=RC16                                                 
Back to top
View user's profile Send private message
t5590ag

Active User


Joined: 21 May 2009
Posts: 139
Location: United States

PostPosted: Thu Apr 29, 2010 9:54 pm    Post subject:
Reply with quote

Escapa..thanks a lot for your help. I'll test run it and confirm the results, which most probably would be positive.

Apart from this solution can you pls brief me over the parameters/steps you have mentioned. What they actually will do. For eg-

Code:
OVERLAY=(81:SEQNUM,6,ZD))               


So that next time i can frame it up myself in case I need. or i can at least modify the card based on LRECL etc which can vary.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Apr 29, 2010 10:10 pm    Post subject:
Reply with quote

t5590ag wrote:
I'll test run it and confirm the results, which most probably would be positive.

It is tested.

t5590ag wrote:
can you pls brief me over the parameters/steps you have mentioned. What they actually will do.

Here you will get all required. icon_smile.gif

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/ice1ca40/CONTENTS?SHELF=&DT=20090527161936#3.8
Back to top
View user's profile Send private message
t5590ag

Active User


Joined: 21 May 2009
Posts: 139
Location: United States

PostPosted: Thu Apr 29, 2010 11:22 pm    Post subject:
Reply with quote

Hi am using this- my I/P file has LRECL=400, so I replaced 81 with 401-


Code:
//SORTIN  DD DSN=T5590AG.BPTQ625Z.REFORMAT.INPUT,DISP=SHR     
//SORTOUT DD DSN=T5590AG.BPTQ625Z.REFORMAT.INPUT.SORTED,       
//            DISP=(NEW,CATLG,KEEP),                           
//            UNIT=DISK,                                       
//            SPACE=(CYL,(50,100),RLSE),                       
//            DCB=(RECFM=FB,LRECL=400,BLKSIZE=0)               
//SYSOUT    DD  SYSOUT=*                                       
//SYSIN    DD  *                                               
  SORT FIELDS=COPY                                             
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(401:SEQNUM,6,ZD))           
  OUTFIL INCLUDE=(1,7,CH,EQ,C'TRAILER',AND,9,6,ZD,EQ,401,6,ZD),
  NULLOFL=RC16                                                 
/*                                                             





Do u see a problem here ? am getting RC=0 only everytime.

Here is the spool-

Code:
WER108I  SORTIN   : RECFM=FB   ; LRECL=   400; BLKSIZE= 27600                 
WER257I  INREC RECORD LENGTH =   406                                           
WER238I  POTENTIALLY INEFFICIENT USE OF INREC                                 
WER110I  SORTOUT  : RECFM=FB   ; LRECL=   400; BLKSIZE= 27600                 
WER405I  SORTOUT  :  DATA RECORDS OUT          0; TOTAL RECORDS OUT          0
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                 
WER054I  RCD IN          5, OUT          5             
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Apr 29, 2010 11:33 pm    Post subject:
Reply with quote

SyncSort for z/OS 1.3 Programmer’s Guide wrote:
The NULLOFL parameter specifies the action to be taken when any non-SORTOUT OUTFIL data set contains no data records.
I think your problem is that you have a SORTOUT OUTFIL, try using FILES or FNAMES to make it a non-SORTOUT OUTFIL data set.
Back to top
View user's profile Send private message
t5590ag

Active User


Joined: 21 May 2009
Posts: 139
Location: United States

PostPosted: Thu Apr 29, 2010 11:52 pm    Post subject:
Reply with quote

ohh !! damn it..! thanks Will, that was silly.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Apr 29, 2010 11:53 pm    Post subject:
Reply with quote

t5590ag wrote:
that was silly.
See what happens when you actually look at the manual?....grin.....
Back to top
View user's profile Send private message
t5590ag

Active User


Joined: 21 May 2009
Posts: 139
Location: United States

PostPosted: Fri Apr 30, 2010 12:01 am    Post subject:
Reply with quote

am sorry Will, i thot its my mistake, but I just took it frm Escapa as is I see. I changed names to FILEIN and FILEOUT. Still the spool says-
Code:
 SYSIN :                                                           
   SORT FIELDS=COPY                                               
   INREC IFTHEN=(WHEN=INIT,OVERLAY=(401:SEQNUM,6,ZD))             
   OUTFIL INCLUDE=(1,7,CH,EQ,C'TRAILER',AND,9,6,ZD,EQ,401,6,ZD),   
   NULLOFL=RC16                                                   
 WER276B  SYSDIAG= 3105571, 4858101, 4858101, 4731549             
 WER164B  7,908K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
 WER164B     0 BYTES RESERVE REQUESTED, 2,016K BYTES USED         
 WER146B  32K BYTES OF EMERGENCY SPACE ALLOCATED                   
 WER224A  SORTOUT  NOT DEFINED                                     
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                     
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                     


and it abends
Back to top
View user's profile Send private message
t5590ag

Active User


Joined: 21 May 2009
Posts: 139
Location: United States

PostPosted: Fri Apr 30, 2010 12:02 am    Post subject:
Reply with quote

can you pls tell me whats gonna work..what names shall I use?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Apr 30, 2010 12:19 am    Post subject:
Reply with quote

William Thompson wrote:
try using FILES or FNAMES to make it a non-SORTOUT OUTFIL data set.
Have you looked at the manual? It is all explained there, please try looking again.
Back to top
View user's profile Send private message
t5590ag

Active User


Joined: 21 May 2009
Posts: 139
Location: United States

PostPosted: Fri Apr 30, 2010 7:10 pm    Post subject:
Reply with quote

ok I have tried few things. This is one-

Code:
//STEP01  EXEC PGM=SORT                                         
//SORTIN  DD DSN=T5590AG.BPTQ625Z.REFORMAT.INPUT,DISP=SHR       
//SORTOF01 DD DSN=T5590AG.BPTQ625Z.REFORMAT.INPUT.SORTED,       
//            DISP=(NEW,CATLG,KEEP),                           
//            UNIT=DISK,                                       
//            SPACE=(CYL,(50,100),RLSE),                       
//            DCB=(RECFM=FB,LRECL=400,BLKSIZE=0)               
//SYSOUT    DD  SYSOUT=*                                       
//SYSIN    DD  *                                               
  SORT FIELDS=COPY                                             
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(401:SEQNUM,6,ZD,START=0))   
  OUTFIL INCLUDE=(1,7,CH,EQ,C'TRAILER',AND,9,6,ZD,EQ,401,6,ZD),
  NULLOFL=RC16                                                 
/*                                                             
can anyone pls let me know what is prob here.

here is my spool-

Code:
 SYNCSORT FOR Z/OS  1.3.0.3R    U.S. PATENTS: 4210961, 5117495   (C)
                                             Chrysler LLC   z/OS   1
 SYNCSORT LICENSED FOR CPU SERIAL NUMBER 1F444, MODEL 2097 510     
 SYSIN :                                                           
   SORT FIELDS=COPY                                                 
   INREC IFTHEN=(WHEN=INIT,OVERLAY=(401:SEQNUM,6,ZD,START=0))       
   OUTFIL INCLUDE=(1,7,CH,EQ,C'TRAILER',AND,9,6,ZD,EQ,401,6,ZD),   
   NULLOFL=RC16                                                     
 WER276B  SYSDIAG= 3116379, 4868895, 4868895, 4731549               
 WER164B  7,908K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
 WER164B     0 BYTES RESERVE REQUESTED, 2,016K BYTES USED           
 WER146B  32K BYTES OF EMERGENCY SPACE ALLOCATED                   
 WER224A  SORTOUT  NOT DEFINED                                     
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                     
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                     
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Apr 30, 2010 7:14 pm    Post subject:
Reply with quote

WER224A SORTOUT NOT DEFINED
Back to top
View user's profile Send private message
t5590ag

Active User


Joined: 21 May 2009
Posts: 139
Location: United States

PostPosted: Fri Apr 30, 2010 7:21 pm    Post subject:
Reply with quote

yes Dick thats fine, but i am not sure how to put them in sync using both OUTFIL and SORTOUT, so I tried this-

Code:
//SORTIN  DD DSN=T5590AG.BPTQ625Z.REFORMAT.INPUT,DISP=SHR
//SORTOUT  DD DUMMY                                     
//SORTOF01 DD DSN=T5590AG.BPTQ625Z.REFORMAT.INPUT.SORTED,


but its giving simply RC=0. I am expecting a 16 per the sort condition.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Apr 30, 2010 7:44 pm    Post subject:
Reply with quote

Again:
CICS Guy wrote:
William Thompson wrote:
try using FILES or FNAMES to make it a non-SORTOUT OUTFIL data set.
Have you looked at the manual? It is all explained there, please try looking again.
icon_rolleyes.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Apr 30, 2010 7:45 pm    Post subject:
Reply with quote

Try changing this
Code:
OUTFIL INCLUDE=(
to
Code:
OUTFIL FNAMES=SORTOF01,INCLUDE=(
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
Goto page 1, 2, 3  Next
Page 1 of 3

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


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