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

regarding reading 5th record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Mon Jan 16, 2006 2:20 pm
Reply with quote

i want to read every 5th record of non-vsam file in jcl pls help me.

regards..
manjinder
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Mon Jan 16, 2006 2:47 pm
Reply with quote

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
View user's profile Send private message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Mon Jan 16, 2006 2:53 pm
Reply with quote

please can you write a small example
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Mon Jan 16, 2006 3:07 pm
Reply with quote

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
View user's profile Send private message
sbalajibe

New User


Joined: 15 Aug 2005
Posts: 62

PostPosted: Mon Jan 16, 2006 3:12 pm
Reply with quote

//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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Jan 16, 2006 10:59 pm
Reply with quote

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
View user's profile Send private message
Borebeat

New User


Joined: 16 Jan 2006
Posts: 7
Location: Coimbatore

PostPosted: Tue Jan 17, 2006 12:04 am
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jan 17, 2006 1:29 am
Reply with quote

ICEMAN is IBM's SORT.

O.
Back to top
View user's profile Send private message
Borebeat

New User


Joined: 16 Jan 2006
Posts: 7
Location: Coimbatore

PostPosted: Tue Jan 17, 2006 1:55 am
Reply with quote

Nevertheless its a product that needs to be bought and installed.

Frank could give us some idea if this is widespread. !!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jan 17, 2006 2:08 am
Reply with quote

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
View user's profile Send private message
Borebeat

New User


Joined: 16 Jan 2006
Posts: 7
Location: Coimbatore

PostPosted: Tue Jan 17, 2006 2:14 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jan 17, 2006 2:33 am
Reply with quote

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
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Jan 17, 2006 5:02 am
Reply with quote

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
View user's profile Send private message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Tue Jan 17, 2006 10:21 am
Reply with quote

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
View user's profile Send private message
itssreehere
Warnings : 1

New User


Joined: 10 Jan 2006
Posts: 65
Location: chennai

PostPosted: Wed Jan 18, 2006 3:10 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jan 18, 2006 9:36 pm
Reply with quote

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
View user's profile Send private message
itssreehere
Warnings : 1

New User


Joined: 10 Jan 2006
Posts: 65
Location: chennai

PostPosted: Thu Jan 19, 2006 5:20 pm
Reply with quote

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
View user's profile Send private message
rajasekhar reddy

New User


Joined: 17 Jan 2006
Posts: 10

PostPosted: Thu Jan 19, 2006 7:53 pm
Reply with quote

//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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jan 19, 2006 8:38 pm
Reply with quote

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
View user's profile Send private message
itssreehere
Warnings : 1

New User


Joined: 10 Jan 2006
Posts: 65
Location: chennai

PostPosted: Fri Jan 20, 2006 2:25 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Jan 20, 2006 9:52 pm
Reply with quote

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
View user's profile Send private message
itssreehere
Warnings : 1

New User


Joined: 10 Jan 2006
Posts: 65
Location: chennai

PostPosted: Sat Jan 21, 2006 10:53 am
Reply with quote

Thanks a lot Frank..Now it's pretty clear.

Sreejith
Back to top
View user's profile Send private message
RANJINI
Warnings : 1

New User


Joined: 19 Apr 2005
Posts: 11

PostPosted: Tue Jan 24, 2006 2:24 pm
Reply with quote

Sreejith,
Instead of " SORT FIELDS=COPY " it is asked to use "OPTIONS=COPY".

The suggested solution is working fine.

Thanks Frank.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jan 24, 2006 10:18 pm
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top