Page 1 of 1

Extract specified number of characters of special records.

PostPosted: Tue Oct 02, 2012 1:42 pm
by Mehdi shri
Dear friend
I have this input QSAM for SORTIN DD.

ACCTOUNT 00002001 0000000001
BALL 99000001ABCDEFGHIJKLMN
BALL 99000002AABBCCDDEEFFGG


I want to extract records they have ACCOUNT and BALL. But only 13 character of records which contain BALL like below:

ACCTOUNT 00002001 0000000001
BALL 99000001
BALL 99000002


What is the control statement for this?

Re: Extract specified number of characters of special recor

PostPosted: Tue Oct 02, 2012 2:06 pm
by BillyBoyo
Can you construct a large example input file, which represents the combinations of data that can occur.

Can ACCTOUNT (is that a typo?) be present without BALL records following? Can BALL records be present without ACCTOUNT preceding? Are records with ACCTOUNT and BALL also mixed with other records? That type of thing.

Then show the expected output for each group of records.

Re: Extract specified number of characters of special recor

PostPosted: Tue Oct 02, 2012 5:38 pm
by Mehdi shri
I want all records but record which has BALL must be reformated to give of 13 first charactes of its.

Re: Extract specified number of characters of special recor

PostPosted: Tue Oct 02, 2012 5:42 pm
by BillyBoyo
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,4,CH,EQ,C'BALL'),BUILD=(1,13))