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

Selecting 5 records using "INCLUDE="


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

New User


Joined: 23 Dec 2010
Posts: 20
Location: USA

PostPosted: Tue Dec 28, 2010 2:27 am
Reply with quote

I want to copy some records from production for a test file to use with a COBOL program change.
I am using the following cards :

SORT FIELDS=COPY
OPTION VLSCMP
OUTFIL INCLUDE=(36,1,CH,EQ,C'J',OR,
36,1,CH,EQ,C'H',OR,
36,1,CH,EQ,C'I',OR,
36,1,CH,EQ,C'K',OR,
36,1,CH,EQ,C'L')

Rather than choosing all 10,000 records which match this criterion, I would like to choose only 5 records from each criterion.

If this is even possible,
What would the cards look like to choose 5 "J"s, 5 "H"'s ..etc... ?
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 Dec 28, 2010 7:18 am
Reply with quote

Yes, it is possible but I need more information.

What is the RECFM and LRECL of your input file.

Are the input records already sorted by position 36, or not?

Do you have input records with other values in position 36 besides HIJKL?
Back to top
View user's profile Send private message
Jeffrey Ranney

New User


Joined: 23 Dec 2010
Posts: 20
Location: USA

PostPosted: Tue Dec 28, 2010 4:40 pm
Reply with quote

Thank you Frank !!
The DCB is RECFM=VB, LRECL=547. The shortest record is 9.
The file is sorted @ 1 for a length of 9
There are more values in column 36 other than HIJKL, however, I only want HIJKL as the change to my program affects only these records.
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 Dec 28, 2010 11:11 pm
Reply with quote

Here's a DFSORT job that will do what you asked for. I assumed "position 36" includes the RDW. If not, you'll need to use 40 instead of 36.

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (VB)
//SORTOUT DD DSN=...  output file (VB)
//SYSIN DD *
  INCLUDE COND=(36,1,SS,EQ,C'HIJKL')
  OPTION COPY,VLSCMP
  INREC IFTHEN=(WHEN=(36,1,CH,EQ,C'H'),
          BUILD=(1,4,5:SEQNUM,8,ZD,13:5)),
        IFTHEN=(WHEN=(36,1,CH,EQ,C'I'),
          BUILD=(1,4,5:SEQNUM,8,ZD,13:5)),
        IFTHEN=(WHEN=(36,1,CH,EQ,C'J'),
          BUILD=(1,4,5:SEQNUM,8,ZD,13:5)),
        IFTHEN=(WHEN=(36,1,CH,EQ,C'K'),
          BUILD=(1,4,5:SEQNUM,8,ZD,13:5)),
        IFTHEN=(WHEN=(36,1,CH,EQ,C'L'),
          BUILD=(1,4,5:SEQNUM,8,ZD,13:5))
  OUTFIL INCLUDE=(5,8,ZD,LE,5),BUILD=(1,4,5:13)
/*
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Dec 29, 2010 3:13 pm
Reply with quote

Jeffrey Ranney wrote:
I only want HIJKL as the change to my program affects only these records.


you should include records of other types to insure that your changes have not affected 'the other types'.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Dec 29, 2010 8:33 pm
Reply with quote

We don' need no steenkin' regression test . . . icon_smile.gif
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 Dec 29, 2010 10:49 pm
Reply with quote

Dick,

I'm not sure what your point is.

I assumed only the HIJKL records were wanted for output.

I did include other record types in the input file for MY testing to assure they were not included for output.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Dec 29, 2010 11:43 pm
Reply with quote

Dick**2 points were not sort related,
they were simply related to the testing methodology...

process changed for some record types...
the TS wants to extract samples to test the changes only!

the suggestion was to process also other record types to test for <broken> things
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 Dec 30, 2010 1:15 am
Reply with quote

Well, not having the full picture of what the OP is trying to do, I wouldn't make that assumption, but ...
Back to top
View user's profile Send private message
Jeffrey Ranney

New User


Joined: 23 Dec 2010
Posts: 20
Location: USA

PostPosted: Thu Dec 30, 2010 2:09 am
Reply with quote

Sweeeeeeet wine !!!!!!!!!!!!!!

Thank you again, Frank... EXACTLY what the doctor ordered !!

Thanks all for the additional comments regarding testing and such, but for now, my Alpha testing is testing only the record 'types' which the code immediately affects.

I needed the SORT syntax to strip off only a count of records and Frank came through,... as always !!!

Thanks again ALL !!
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top