Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

regarding reading 5th record
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: regarding reading 5th record
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: 1452
Location: Chicago, IL

PostPosted: Mon Jan 16, 2006 2:47 pm    Post subject: Re: regarding reading 5th record
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    Post subject: thanx priyesh
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: 1452
Location: Chicago, IL

PostPosted: Mon Jan 16, 2006 3:07 pm    Post subject: Re: regarding reading 5th record
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    Post subject:
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 Moderator


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

PostPosted: Mon Jan 16, 2006 10:59 pm    Post subject:
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:

http://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    Post subject: ICEMAN
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: 2360
Location: Israel

PostPosted: Tue Jan 17, 2006 1:29 am    Post subject:
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    Post subject: Re: regarding reading 5th record
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 Moderator


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

PostPosted: Tue Jan 17, 2006 2:08 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Jan 17, 2006 2:33 am    Post subject:
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    Post subject: Re: regarding reading 5th record
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    Post subject: thanx
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    Post subject:
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 Moderator


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

PostPosted: Wed Jan 18, 2006 9:36 pm    Post subject:
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    Post subject:
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    Post subject: Re: regarding reading 5th record
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 Moderator


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

PostPosted: Thu Jan 19, 2006 8:38 pm    Post subject:
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    Post subject:
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Reading data from PS file and send it... rajatbagga All Other Mainframe Topics 18 Fri Sep 23, 2016 12:51 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us