This is the first time I am trying to create a dynamic sort card, managed to seek some online help, but still unable to generate a sort card. Hence can any body help me out with the following:
Code:
//SORT1 EXEC PGM=SORT
//INDD1 DD DSN=TEMP.FILE, -->containing Julian date in yyddd
// DISP=SHR
//INDD2 DD DSN=INPUT1.FILE, --> Actual data file
// DISP=SHR
//OUT1CNTL DD DSN=MY.OUT1, --> this file will contain the dynamic sortcard
// DISP=(NEW,CATLG,DELETE),
// RECFM=FB,
// LRECL=80,
// SPACE=(CYL,(1,1),RLSE)
//OUTDD2 DD DSN=MY.OUT2, --> this file will contain records based on the criteria generated of the sort card
// DISP=(NEW,CATLG,DELETE),
// RECFM=VB,
// LRECL=900,
// SPACE=(CYL,(1,1),RLSE)
//TOOLIN DD *
SELECT FROM(INDD1) TO(OUT1CNTL) ON (1,5,CH) FIRST USING(CTL1)
COPY FROM(INDD2) TO(OUTDD2) USING(OUT1)
/*
//CTL1CNTL DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,
HEADER1=(3:'SORT FIELDS=COPY'),
HEADER2=(3:'INCLUDE COND=(20,5,CH,GE,'),
OUTREC=(2X,1,5,C')',70X)
/*
//SYSOUT DD SYSOUT=*
Reqt:
INDD1 - contains Julian date - starting at position 1 and of lenght 5
INDD2 - is the input data file sorted on certain key field - Variable length file - where date field starts at 16th position (+4bytes as its VB) of length 5
OUTDD2 - should contain records GE date in INDD1
Code:
Abends with U0016, SYSOUT displays:
********************************* TOP OF DATA *********************************
SYNCSORT FOR Z/OS 1.3.2.1R
WER276B SYSDIAG= 147404, 256460, 256460, 726900
WER164B 1,028K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 1,016K BYTES USED
WER146B 4K BYTES OF EMERGENCY SPACE ALLOCATED
WER267A SORT STATEMENT : STATEMENT NOT FOUND
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Can you please advise what exactly is going wrong here?
Thanks!
Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
Quote:
Originally the reference used had the PGM=SYNCTOOL but it is against our standards.
A shame, as that is the only way that I can think of.
It must be wonderful being a right dickhead - you get promoted out of the way to positions where you can dictate standards to the people who actually try to do some work. Ain't it always the way
My Apologies, but I wasn't trying to dictate standards, it's against the coding standards in our project, hence wanted a way out with SYNCSORT.
Thanks!
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
Why not just use your CTL1 for sort with INDD1 as input and output to OUT1.
Then use your OUT1 for sort with INDD2 as input and output to OUTDD2.
Two physical steps using sort versus a single tool step (with two passes).