View previous topic :: View next topic
Author
Message
Jeffrey Ranney New User Joined: 23 Dec 2010Posts: 20 Location: USA
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
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
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
Jeffrey Ranney New User Joined: 23 Dec 2010Posts: 20 Location: USA
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
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
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
dbzTHEdinosauer Global Moderator Joined: 20 Oct 2006Posts: 6966 Location: porcelain throne
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
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
We don' need no steenkin' regression test . . .
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
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
enrico-sorichetti Superior Member Joined: 14 Mar 2007Posts: 10873 Location: italy
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
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Well, not having the full picture of what the OP is trying to do, I wouldn't make that assumption, but ...
Back to top
Jeffrey Ranney New User Joined: 23 Dec 2010Posts: 20 Location: USA
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
Please enable JavaScript!