IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort -> How to get system date + records count of a f


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mturangi

New User


Joined: 26 Jul 2008
Posts: 15
Location: Jefferson city, MO, USA

PostPosted: Tue Jul 29, 2008 3:23 am
Reply with quote

I have a flat file.

My requirement is to get the System date.
Number of records from the input file.

Using the following structure write (append) it to another flat file.

Structure of the Output file is

1:10 --> System Date
11:3 --> '033' (Hard Coded value. This remains constant always)
14:10 --> 'Table Name' (Hard Coded value. This remains constant always)
24:12 --> Records Count

Please let me know using Syncsort how to code the JCL for the above requirement. Your help is greatly appreciated. Thank You.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Jul 29, 2008 9:05 am
Reply with quote

Hello Muralee,

Try out this one. You may change the card as per your file attributes.

Code:
//SYSIN    DD *                                   
  INREC OVERLAY=(81:C'000000000001')             
  SORT FIELDS=(1,80,CH,A)                         
  SUM FIELDS=(81,12,ZD)                           
  OUTREC FIELDS=(&DATE1(-),C'033your table',81,12)


Thanks,
Arun
Back to top
View user's profile Send private message
mturangi

New User


Joined: 26 Jul 2008
Posts: 15
Location: Jefferson city, MO, USA

PostPosted: Tue Jul 29, 2008 8:30 pm
Reply with quote

Thank You Arun for Your response.

I tested the JCL using sort parameters provided by you.
It is giving error on OVERLAY parameter.
In our facility we are using SYNCSORT version 1.2.0.1R.
I am not sure if this version supports OVERLAY parameter or not.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Jul 29, 2008 11:05 pm
Reply with quote

Hello,

Please post your jcl, sort control statements, and the complete diagnostic info from the problem run.

Use copy/paste and the "Code" tag to make your post more readable. Please - Do not re-key any of this.
Back to top
View user's profile Send private message
mturangi

New User


Joined: 26 Jul 2008
Posts: 15
Location: Jefferson city, MO, USA

PostPosted: Wed Jul 30, 2008 1:13 am
Reply with quote

My input file record length is 183 and I want to use this file to count no of records only and I do not want to sort it.

JCL:

Code:
//STEP1    EXEC PGM=SORT                                     
//SORTIN   DD DSN=FILE1
//SORTOUT  DD DSN=FILE2
//SYSOUT   DD SYSOUT=*                                       
//SYSIN    DD *                                             
  INREC OVERLAY=(24:C'000000000001')                         
  SORT FIELDS=(1,183,CH,A)                                   
  SUM FIELDS=(24,12,ZD)                                     
  OUTREC FIELDS=(&DATE1(-),C'033TABLE NAME',24,12)           
/*                                                           
//                                                           


Diagnostic Info:

Code:
SYSIN :                                             
  INREC OVERLAY=(24:C'000000000001')               
        *                                           
  SORT FIELDS=(1,183,CH,A)                         
  SUM FIELDS=(24,12,ZD)                             
  OUTREC FIELDS=(&DATE1(-),C'033TABLE NAME',24,12) 
WER268A  INREC STATEMENT   : SYNTAX ERROR           
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000       
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Jul 30, 2008 3:07 am
Reply with quote

Hello,

Sorry, my mind was on break earlier. . . icon_redface.gif

OVERLAY requires the current release of Syncsort (1.3).
I lied. . . Please see below. d
Back to top
View user's profile Send private message
mturangi

New User


Joined: 26 Jul 2008
Posts: 15
Location: Jefferson city, MO, USA

PostPosted: Wed Jul 30, 2008 8:29 pm
Reply with quote

Yesterday SYNCSORT FOR Z/OS 1.3.0.0N has been installed in our Mainframe. Currently they did it in Test region and asked us to use the following steplib

Code:
//STEPLIB  DD DSN=SYSMPR.SYNCSORT.SYNCLINK,DISP=SHR
//         DD DSN=SYSMPR.SYNCSORT.SYNCRENT,DISP=SHR


Now My JCL Looks Like

Code:
//STEP1    EXEC PGM=SORT
//STEPLIB  DD DSN=SYSMPR.SYNCSORT.SYNCLINK,DISP=SHR       
//         DD DSN=SYSMPR.SYNCSORT.SYNCRENT,DISP=SHR       
//SORTIN   DD DSN=FILE1,DISP=SHR     
//SORTOUT  DD DSN=FILE2,DISP=MOD
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,1)                   
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,1)                   
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,1)                   
//SORTWK04 DD UNIT=SYSDA,SPACE=(CYL,1)                   
//SYSOUT   DD SYSOUT=*                                   
//SYSIN    DD *                                           
  INREC OVERLAY=(24:C'000000000001')                     
  SORT FIELDS=(1,183,CH,A)                               
  SUM FIELDS=(24,12,ZD)                                   
  OUTREC FIELDS=(&DATE1(-),C'033TABLE NAME',24,12)       
/*                                                       
//                                                       


Still I am getting the error

Code:
SYSIN :                                                                 
  INREC OVERLAY=(24:C'000000000001')                                   
  SORT FIELDS=(1,183,CH,A)                                             
  SUM FIELDS=(24,12,ZD)                                                 
  OUTREC FIELDS=(&DATE1(-),C'033TABLE NAME',24,12)                     
WER186I  SVC 201 IS INCORRECT VERSION OR NOT A SYNCSORT SVC; SVC NOT USED - INEFFICIENT SORT
WER164B  6,896K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,     
WER164B     0 BYTES RESERVE REQUESTED, 1,004K BYTES USED               
WER146B  20K BYTES OF EMERGENCY SPACE ALLOCATED                         
WER220A  ILLEGAL OVERLAPPING OF SUM FIELDS                             
WER108I  SORTIN   : RECFM=VB   ; LRECL=   183; BLKSIZE= 27998           
WER211I  SYNCSMF  CALLED BY SYNCSORT; RC=0036                           
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Jul 30, 2008 10:06 pm
Reply with quote

Hello,

Quote:
Still I am getting the error
Yes, but not because of OVERLAY. . .

Code:
WER186I  SVC 201 IS INCORRECT VERSION OR NOT A SYNCSORT SVC;
You need to show this to your Systems people who installed the new release.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Aug 01, 2008 12:50 am
Reply with quote

dick scherrer wrote:
OVERLAY requires the current release of Syncsort (1.3).

Correction, it requires SyncSort for z/OS 1.2.1.0 or later.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Aug 01, 2008 12:54 am
Reply with quote

Code:
WER186I  SVC 201 IS INCORRECT VERSION OR NOT A SYNCSORT SVC; SVC NOT USED - INEFFICIENT SORT
This is an informational message which should be addressed. However, it should not cause the job to fail.

The following is the real problem:
Code:
WER220A  ILLEGAL OVERLAPPING OF SUM FIELDS
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Aug 01, 2008 1:00 am
Reply with quote

Hi Alissa,

Sorry for the mis-info. . .

I replied as i did because my Syncsort 1.2 manual has this right after the table of contents:
Quote:
SyncSort for z/OS Release 1.2 - Summary of Changes

The 1.2.1 (TPF1) level of SyncSort for z/OS Release 1.2 was preceded by SyncSort for z/OS Release 1.2.0. This Summary of Changes identifies changes for both release levels as follows:

In this doc, OVERLAY is not among the "Control Statements" and using the pdf search ges 0 hits.

Do i have the wrong 1.2 manual?

Thanks,

d
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Aug 01, 2008 1:03 am
Reply with quote

Hi Dick.

No, you don't have the wrong manual. We released an Addendum to the SyncSort for z/OS 1.2 Programmer's to include the features and enhancements built into 1.2.1.0. If you don't have it, send me a quick note offline and I can send it to you.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Aug 01, 2008 1:15 am
Reply with quote

Hi Alissa,

Aaarggh. . . icon_redface.gif

Quote:
Addendum. BUILD, IFTHEN, IFOUTLEN, and
OVERLAY Parameters

Yup, i do have it and forgot to look there. . . d'oh. . .

Thanks again,

d
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Aug 01, 2008 5:12 am
Reply with quote

Hi,

I'm a bit confused with this request,
Quote:
My input file record length is 183 and I want to use this file to count no of records only and I do not want to sort it.


You do NOT want to sort it yet there are SORT FIELDS, the File is VB and not FB, so the data starts at byte 5 and not 1.


Gerry
Back to top
View user's profile Send private message
mturangi

New User


Joined: 26 Jul 2008
Posts: 15
Location: Jefferson city, MO, USA

PostPosted: Sat Aug 02, 2008 12:32 am
Reply with quote

Yes. You are right. Data should start at position 5. Sorry for the Confusion created.
Since Arun suggested me to use SORT FIELDS so I was trying with that option.
Since 5 days I am trying to get hold of a solution for this problem but could not succeed.
Still I am waiting from the Forum to get some solution.

Thanks.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Aug 02, 2008 1:01 am
Reply with quote

Hello,

Did you correct the error Alissa pointed out - about the overlap with the sum field?

Quote:
EXPLANATION: A SUM field overlaps another SUM field, a SORT/
MERGE control field or the Record Descriptor Word of a variable-length
record. All of these are illegal.


You need to correct the overlap between the sort field and the sum field. If you have corrected the overlap and still have problems, post back the current problem.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Sun Aug 03, 2008 1:51 am
Reply with quote

Hello Muralee,

The solution given was for an FB file of LRECL=80. Now you can change it as per your requirement. My release is Syncsort 1.2 which supports OVERLAY.

Thanks,
Arun
Back to top
View user's profile Send private message
mturangi

New User


Joined: 26 Jul 2008
Posts: 15
Location: Jefferson city, MO, USA

PostPosted: Thu Aug 07, 2008 9:42 pm
Reply with quote

Thank You Arun.
The following code worked for me.

Code:
  INREC OVERLAY=(196:SEQNUM,12,ZD)           
  SORT FIELDS=COPY                           
  OUTFIL REMOVECC,NODETAIL,                 
  TRAILER1=(&DATE=(MD4/),C'|83 ',           
  C'|TABLE-NAME                    |',196,12),CONVERT


Thank You All/ibmmainframes.com for Helping me to get a solution.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Syncsort help SYNCSORT 3
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts Date format correction using dfsort DFSORT/ICETOOL 3
No new posts SYNCSORT-DB2 interface SYNCSORT 0
No new posts System add a USER parm when job submi... TSO/ISPF 4
Search our Forums:

Back to Top