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

Reading of PS file


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
krunalbafna
Warnings : 1

Active User


Joined: 18 Jan 2010
Posts: 143
Location: Pune

PostPosted: Tue Apr 27, 2010 7:04 pm
Reply with quote

Hi,
I have to every 10 record of my available PS file.
Is there any method to get this read possible..


Regards,
Krunal
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Apr 27, 2010 7:09 pm
Reply with quote

Take a look at the DFSORT forum, there is functionality available to do this. I think, but am not 100% sure, it is the SAMPLE parameter.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Apr 27, 2010 7:22 pm
Reply with quote

krunalbafna wrote:
Hi,
I have to every 10 record of my available PS file.
Is there any method to get this read possible..


Regards,
Krunal


Explanation of problem you have give is clear as mud..

Do you want every 10 records in separate file from set of records in input file?
Back to top
View user's profile Send private message
krunalbafna
Warnings : 1

Active User


Joined: 18 Jan 2010
Posts: 143
Location: Pune

PostPosted: Wed Apr 28, 2010 9:51 am
Reply with quote

I want to read every 10th record from a file..

ex, 1,10,20,30 so on... till end of file..
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Apr 28, 2010 10:07 am
Reply with quote

Either read and skip the nine unwanted records or pre-process the input so the 'every 10th record' is the only thing available to your application.

FWIW, using a sort/copy, a one digit seqnum would allow you to include every tenth record when the seqnum = zero for output.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Apr 28, 2010 11:36 am
Reply with quote

Here let me do YOUR work for you

click HERE and see what YOU could have found for YOURSELF
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10902
Location: italy

PostPosted: Wed Apr 28, 2010 1:17 pm
Reply with quote

Quote:
ex, 1,10,20,30 so on... till end of file..
wrong!
better ==> 1,11,21,31 and so on
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Apr 28, 2010 2:10 pm
Reply with quote

Here is the DFSORT step doing what is required.
Code:

//S1    EXEC  PGM=SORT                 
//SORTIN DD DISP=SHR,DSN=YOUR.INPUT.HERE
//SORTOUT DD SYSOUT=*                   
//SYSOUT    DD  SYSOUT=*               
//SYSIN    DD  *                       
  SORT FIELDS=COPY                     
  OUTFIL SAMPLE=10                     
/*                                     
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
No new posts To Sort detail records in a file with... SYNCSORT 5
No new posts To Populate Trailer cnt in the file w... SYNCSORT 1
No new posts Sort card to know that creation date ... DFSORT/ICETOOL 10
Search our Forums:


Back to Top