Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Selecting 5 records using "INCLUDE="

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Selecting 5 records using "INCLUDE="
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Dec 28, 2010 7:18 am    Post subject:
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    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Dec 28, 2010 11:11 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Dec 29, 2010 8:33 pm    Post subject: Reply to: Selecting 5 records using "INCLUDE="
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Dec 29, 2010 10:49 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Wed Dec 29, 2010 11:43 pm    Post subject: Reply to: Selecting 5 records using "INCLUDE="
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Dec 30, 2010 1:15 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us