Joined: 26 Nov 2002 Posts: 12401 Topics: 75 Location: San Jose
Posted: Wed Sep 22, 2004 5:51 pm Post subject:
Vivek,
You have older version of syncsort which does not support the DATE1 Parm. Here is an alternate way of doing it. As you are adverse to use synctool, I have to split the job into 3 steps.
A brief explanation of the job. STEP0100 writes out a single record with current date in the format CCYY/MM/DD. since we are using the report feature the recfm will be FBA
Now step0200 takes in the date file and creates a dynamic control card as follows.
Code:
INCLUDE COND=(14,8,CH,EQ,C'20040922')
SORT FIELDS=COPY
Using this dynamic control card we select the desired records in step0300.
Does this mean a date format with date separator / ?
Quote:
OUTFIL OUTREC=(C' INCLUDE COND=(14,8,CH,EQ,C',
C'''',
02,4,
07,2,
10,2,
C'''',
C')',/,
C' SORT FIELDS=COPY',/,
80:X)
I am trying to under stand the syntax rules behind this
you say 02,04 , 07,2,10,2 does it mean starting at column 2 and length 4 , starting at 7 length 2, starting at 10 length 2 ? so column 1,5,9 will have the date separator ?? _________________ Vivek,NJ
Joined: 26 Nov 2002 Posts: 12401 Topics: 75 Location: San Jose
Posted: Thu Sep 23, 2004 5:57 am Post subject:
vivek,
Quote:
Does this mean a date format with date separator / ?
yes the date will be of format CCYY/MM/DD
Quote:
I am trying to under stand the syntax rules behind this you say 02,04 , 07,2,10,2 does it mean starting at column 2 and length 4 , starting at 7 length 2, starting at 10 length 2 ? so column 1,5,9 will have the date separator ??
You are partially correct. Let me explain it clearly. When you use a report feature like header or trailer then the sortout dataset is created with a carriage control character. Ofcourse the latest versions of sort can supress this carriage control character with REMOVECC parm.
so the output from step0100 will look like this
Code:
----+----1-
*2004/09/23
I used * to denote the carriage control character. Now your date format is CCYYMMDD. Look at the date generated above.
At pos 2 for 4 bytes you have the year.
At pos 7 for 2 bytes you have the month.
At pos 10 for 2 bytes you have the day
The / parm after the closing parenthesis is used to split the line and write a new line.
80:x means pad with spaces up to 80 bytes for rest of the bytes. Let us say SORT FIELDS=COPY occupies 17 bytes then starting from 18 th byte to 80th byte spaces are padded.
If you want to understand the control cards more then grab a manual and look at the OUTREC parm. You can also remove the temp datasets to catlg datasets and see how each step is working.
thanks for the good and quick responses. in the following code the first two lines with an asterisk on the column 1 are treated as commentes and ignored by sort utility right ?
[Code:]
* SORT ASCENDING ON DOCKET AND DESCENDING ON DATE SO THAT LATEST REC
* WILL BE ON TOP
SORT FIELDS=(1,13,CH,A,14,8,CH,D)
[Code:] _________________ Vivek,NJ
Hi Kolusu,
I am using your first post JCL with little modification in toolin as follows
Quote:
//TOOLIN DD *
COPY FROM(DATEIN) USING(CTL1)
COPY FROM(SORTIN) TO(SORTOUT) USING(CTL2)
//CTL1CNTL DD *
OUTFIL FNAMES=CTL2CNTL,
OUTREC=(C' INCLUDE COND=(37,2,CH,EQ,72,AND,
26,5,PD,GT,C',
C'''', $ OPENING QUOTE
20,8, $ DATE FROM PARM
C'''', $ CLOSING QUOTE
C')', $ CLOSING PARENTHESIS
10004:X) $ PAD SPACES TO 10004 BYTES
//CTL2CNTL DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(100,100),RLSE)
Toolin messages as follows
Quote:
SYT002I "TOOLIN" INTERFACE BEING USED
COPY FROM(DATEIN) USING(CTL1)
SYT020I SYNCSORT CALLED WITH IDENTIFIER "0001"
SYT012E SYNCSORT COMPLETED UNSUCCESSFULLY
SYT030I OPERATION COMPLETED WITH RETURN CODE 16
DFSMSG messages as follows
Quote:
WER428I CALLER-PROVIDED IDENTIFIER IS "0001"
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
I want compare with charecter 72 in include cond so can I change it to
Quote:
OUTREC=(C' INCLUDE COND=(37,2,CH,EQ,c''72'',AND,
26,5,PD,GT,C',
Please let me know what is problem here _________________ Regards,
Chandra
All times are GMT - 5 Hours Goto page Previous1, 2
Page 2 of 2
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum