Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How can I skip 10th record in a file?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
blpraveen123
Currently Banned

New User


Joined: 26 Apr 2007
Posts: 12
Location: Mysore

PostPosted: Wed May 30, 2007 2:59 pm    Post subject: How can I skip 10th record in a file?
Reply with quote

Hi,

This was an interview question.How can I skip particular single record from a file and write other records into output file?

What this sort card means?
Sort Fields=Copy
Outrec=(1:10,15,CH)

In one of the topic I found copying range of records using
sort card---
//
Sort Fileds=copy
outfil File=DDN1 Startrec(10) ENDREC(10)

Can I write the Sort JCL Like this?
IF any corrections please suggest me.
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed May 30, 2007 3:04 pm    Post subject:
Reply with quote

Praveen,

Quote:
Sort Fields=Copy
Outrec=(1:10,15,CH)


Above card copies data from IP file starting from 10 to 24 column (15 in length) to OP file.

Quote:
This was an interview question.How can I skip particular single record from a file and write other records into output file?


This thing requires two steps -

First step - SORT FIELDS=COPY,STOPAFT=9
Second step - SORT FIELDS=COPY,STARTREC=11
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed May 30, 2007 3:14 pm    Post subject:
Reply with quote

Or, in one step, add a sequence number in the input phase and omit the record that has a 10 in the sequence in output phase.
Back to top
View user's profile Send private message
blpraveen123
Currently Banned

New User


Joined: 26 Apr 2007
Posts: 12
Location: Mysore

PostPosted: Wed May 30, 2007 4:37 pm    Post subject:
Reply with quote

Hi
Is the Sort card using the SEQ NUM is Correct


* Insert the Seq NUM
INREC OVERLAY=(81:SEQNUM,8,ZD)
* Sort on seqnum descending.
SORT FIELDS=(81,8,ZD,A)
* Remove 10th Record
OMIT COND=(81,8,ZD,ZD'00000010')
* OUTPUT TO FILE
OUTREC BUILD=(1,80)


-------?Is the OMIT CONDITION Correct
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed May 30, 2007 5:06 pm    Post subject:
Reply with quote

Looks good, but if me, I'd verify from the manual (not that good remembering formats... icon_cry.gif ).
You do not need to sort, just copy, the records are already in the sort sequence.
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IDCAMS RENAMING VSAM FILE ALONG WITH ... upendrasri JCL & VSAM 11 Tue Apr 17, 2018 10:42 pm
No new posts VSAM file NOT Found error while proce... SumaReva CICS 5 Wed Apr 11, 2018 9:54 pm
No new posts VSAM - Accessing beyond record size Benchwarmer JCL & VSAM 6 Wed Apr 11, 2018 9:20 pm
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am
No new posts VSAM File free space sancraig16 JCL & VSAM 13 Fri Mar 30, 2018 1:02 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us