View previous topic :: View next topic
|
Author |
Message |
manjinder
New User
Joined: 04 Dec 2005 Posts: 45 Location: pune
|
|
|
|
i want to read every 5th record of non-vsam file in jcl pls help me.
regards..
manjinder |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Hi manjinder,
Quote: |
i want to read every 5th record of non-vsam file in jcl pls help me. |
You do read records by program not by JCL... Check for the read counter in program & when multiple of 5 then only process.
Regards,
Priyesh. |
|
Back to top |
|
|
manjinder
New User
Joined: 04 Dec 2005 Posts: 45 Location: pune
|
|
|
|
please can you write a small example |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
This code should help you... Pardon me if this is not syntactically correct.
Code: |
WORKING-STORAGE SECTION.
01 X PIC 9999.99 VALUE ZEROES.
PROCESS-PARA.
READ INPUT-FILE INTO WS-INPUT-REC
AT END SET END-INPUT-FILE-YES TO TRUE
GO TO PROCESS-PARA-EXIT
END-READ.
ADD 1 TO WS-INPUT-READ-COUNT.
COMPUTE X = WS-INPUT-READ-COUNT / 5.
IF NOT X(5:2) = 0
GO TO PROCESS-PARA-EXIT
PROCESSING CONTINUE...
:
:
:
PROCESS-PARA-EXIT
EXIT. |
Regards,
Priyesh. |
|
Back to top |
|
|
sbalajibe
New User
Joined: 15 Aug 2005 Posts: 62
|
|
|
|
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
SORT FIELDS=(...)
OUTFIL STARTREC=1,SAMPLE=5/*
use sortout dsn u will get reaords sampled by 5
u can use it |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
manjinder,
You can use the following DFSORT job to write records 1, 6, 11, 16, ... (every fifth record starting with record 1):
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OUTFIL SAMPLE=5
/*
|
For more information on DFSORT's SAMPLE parameter, see:
www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst02.html#t04 |
|
Back to top |
|
|
Borebeat
New User
Joined: 16 Jan 2006 Posts: 7 Location: Coimbatore
|
|
|
|
Frank,
Just wondering, is ICETOOL being widely used ?
I feel suggesting ICEMAN solutions to problems isn't a good idea when most shops don't seem to have it installed. I have worked in few of the biggest banks and they dont seem to have it. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
ICEMAN is IBM's SORT.
O. |
|
Back to top |
|
|
Borebeat
New User
Joined: 16 Jan 2006 Posts: 7 Location: Coimbatore
|
|
|
|
Nevertheless its a product that needs to be bought and installed.
Frank could give us some idea if this is widespread. !! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Just wondering, is ICETOOL being widely used ?
I feel suggesting ICEMAN solutions to problems isn't a good idea when most shops don't seem to have it installed. I have worked in few of the biggest banks and they dont seem to have it. |
I think you're a little confused. ICEMAN and SORT are the names used to invoke the sort product at a site. Pretty much every site has a sort product installed, generally DFSORT, Syncsort or CA-SORT. Some sites have more than one. Therefore, saying that "most sites don't seem to have ICEMAN installed" makes no sense since virtually every shop has a sort product installed and uses PGM=ICEMAN or PGM=SORT to get to it. ICETOOL is part of DFSORT (it has been since 1991). DFSORT and ICETOOL are widely used. Sort products (PGM=ICEMAN or PGM=SORT) are universally used. |
|
Back to top |
|
|
Borebeat
New User
Joined: 16 Jan 2006 Posts: 7 Location: Coimbatore
|
|
|
|
Frank,
I thought ICEMAN is used specifically to invoke IBM's ICETOOL. Is this incorrect ?
Do you think the
OUTFIL SAMPLE = 5
will work even when I have Syncsort installed (instead of IBMs products) |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I thought ICEMAN is used specifically to invoke IBM's ICETOOL. Is this incorrect ? |
No, that's not correct. PGM=ICEMAN is used to invoke DFSORT (or Syncsort or CA-SORT). PGM=ICETOOL is used to invoke DFSORT's ICETOOL.
Quote: |
Do you think the
OUTFIL SAMPLE=5
will work even when I have Syncsort installed (instead of IBMs products)
|
I'm the DFSORT guy. DFSORT supports SAMPLE. Somebody who uses Syncsort will have to tell you whether Syncsort supports SAMPLE or not. |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
manjinder,
I just checked my SYNCSORT Doc and it doesn't look like SYNCSORT supports SAMPLE=.
Just one more cool thing DFSORT does that SYNCSORT falls short on. |
|
Back to top |
|
|
manjinder
New User
Joined: 04 Dec 2005 Posts: 45 Location: pune
|
|
|
|
thanx everybody for clearing my doubt i have never used this syntax in jcl like sample=5, it is wonderfull it has helped me alotttttt.
thanx alottttt.
regards...
manjinder |
|
Back to top |
|
|
itssreehere Warnings : 1 New User
Joined: 10 Jan 2006 Posts: 65 Location: chennai
|
|
|
|
This code is not working.OUTFIL syntax is not correct.Please tell me what's the error.As per the above discussions it should work.right?
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL SAMPLE=2
/*
Sreejith |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
When you say something doesn't work, you need to show the error messages you received.
If you have at least one blank before SORT and at least one blank before OUTFIL, then those statements do work with DFSORT. |
|
Back to top |
|
|
itssreehere Warnings : 1 New User
Joined: 10 Jan 2006 Posts: 65 Location: chennai
|
|
|
|
Hi Frank,
This is the jcl i submitted.
Code: |
//STEP10 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=T54VS1H.TEST.SORTIN,
// DISP=SHR
//SORTOUT DD DSN=T54VS1H.TEST.SORTOUT,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(1,1),RLSE),
// DCB=*.SORTIN
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL SAMPLE=2
/*
//*
|
This is the error message i got,
................
SYSIN :
SORT FIELDS=COPY
OUTFIL SAMPLE=2
*
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
Sreejith |
|
Back to top |
|
|
rajasekhar reddy
New User
Joined: 17 Jan 2006 Posts: 10
|
|
|
|
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL SAMPLE=2
/*
I USED THIS BUT IT IS NOT WORKING I AM GETTING A RC OF 16 |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The WER messages indicate you're using Syncsort, not DFSORT. These control statements work with DFSORT. Obviously, they don't work with Syncsort. |
|
Back to top |
|
|
itssreehere Warnings : 1 New User
Joined: 10 Jan 2006 Posts: 65 Location: chennai
|
|
|
|
Frank,
But i have given exec pgm=ICEMAN.
That will invoke DFSRT only. right?If Syncsort is the installed one will
pgm= iceman work?
Sreejith |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Sreejith,
PGM=ICEMAN or PGM=SORT invokes the sort product installed at your site. That could be DFSORT, Syncsort or CA-SORT. You can tell which one you're using by the messages - ICExxxs for DFSORT, WERxxxs for Syncsort or CASxxxx for CA-SORT. In your case, the WER messages indicate you're using Syncsort, not DFSORT. |
|
Back to top |
|
|
itssreehere Warnings : 1 New User
Joined: 10 Jan 2006 Posts: 65 Location: chennai
|
|
|
|
Thanks a lot Frank..Now it's pretty clear.
Sreejith |
|
Back to top |
|
|
RANJINI Warnings : 1 New User
Joined: 19 Apr 2005 Posts: 11
|
|
|
|
Sreejith,
Instead of " SORT FIELDS=COPY " it is asked to use "OPTIONS=COPY".
The suggested solution is working fine.
Thanks Frank. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Instead of " SORT FIELDS=COPY " it is asked to use "OPTIONS=COPY".
The suggested solution is working fine. |
Huh? SORT FIELDS=COPY works fine. OPTION COPY works fine. These are equivalent.
OPTIONS=COPY is invalid. |
|
Back to top |
|
|
|