View previous topic :: View next topic
|
Author |
Message |
blpraveen123 Currently Banned New User
Joined: 26 Apr 2007 Posts: 12 Location: Mysore
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
blpraveen123 Currently Banned New User
Joined: 26 Apr 2007 Posts: 12 Location: Mysore
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Looks good, but if me, I'd verify from the manual (not that good remembering formats... ).
You do not need to sort, just copy, the records are already in the sort sequence. |
|
Back to top |
|
|
|