Page 1 of 1

ICEMAN control card to copy a particular range of records

PostPosted: Sat Jun 20, 2015 4:04 pm
by vsgurunath
Hi,

I have been lucky to have been able to find answers to all of my questions without creating a new post until now. Thanks to everyone for the extensive information shared in the forum. I respect you all.

I request your guidance in achieving the below requirement:
1. I need to copy a particular range of records (list of application IDs to which the job belongs to) from the input file (OPC scheduler report)

2. The input file is FBA file of LRECL 122. Here is how the input file looks like.

JOBNAME1      APPL_ID1
       APPL_ID2
      APPL_ID3
JOBNAME2   APPL_ID1
      APPL_ID2
JOBNAME3   APPL_ID1
JOBNAME4   APPL_ID1
      APPL_ID2
      APPL_ID3
      APPL_ID4
      APPL_ID5
JOBNAME5   APPL_ID1
JOBNAME6   APPL_ID1
      APPL_ID2
JOBNAME7   APPL_ID1
      APPL_ID2
.
.
.
.
JOBNAMEn   APPL_IDn


3. I have coded the below ICEMAN condition to select the range of records starting from the record having the jobname searched for till the next record containing a job name (non-blank character in the first position of the file --> next set of job name & application IDs)

//SYSIN   DD *                                           
  OPTION COPY                                           
  INREC IFTHEN=(WHEN=GROUP,                             
    BEGIN=(2,8,CH,EQ,C'JOBNAME4'),                           
    END=(2,8,CH,NE,C'       '),                         
    PUSH=(122:ID=8))                                     
  OUTFIL INCLUDE=(122,8,ZD,EQ,1,AND,2,8,CH,EQ,C'       ')
/*                                                       


4. Desired output:
    JOBNAME4 APPL_ID1
    APPL_ID2
    APPL_ID3
    APPL_ID4
    APPL_ID5

I am getting a blank output when I run the utility with the above condition. However, I am getting the desired output when I mention the JOBNAME5 in the condition instead of checking for non-blank record, as shown below:

//SYSIN   DD *                                           
  OPTION COPY                                           
  INREC IFTHEN=(WHEN=GROUP,                             
    BEGIN=(2,8,CH,EQ,C'JOBNAME4'),                           
    END=(2,8,CH,EQ,C'JOBNAME5'),                         
    PUSH=(122:ID=8))                                     
  OUTFIL INCLUDE=(122,8,ZD,EQ,1,AND,2,8,CH,NE,C'JOBNAME5')
/*                                                       


Kindly share your expertise to help me achieve my desired result.

Thanks,
Sivaguru

Re: ICEMAN control card to copy a particular range of record

PostPosted: Sat Jun 20, 2015 4:12 pm
by vsgurunath
I missed to state the below point:

I do not know the next job name in the input file and hence I am checking for a non-blank character in the 1st position of the record. I intend to use the output I am trying to achieve here for further analysis on that particular job using REXX.

Re: ICEMAN control card to copy a particular range of record

PostPosted: Sat Jun 20, 2015 5:33 pm
by BillyBoyo
If you remove the OUTFIL you can see which records are being marked for the group. If is only the first record. The problem is that the END with NE naturally ends the group when the group starts with a non-blank (ie always).

If you have JOBs which start with the word JOB, or you will be being specific each time you run, have an AND in the END which will not cause the group to end on the first record.

Re: ICEMAN control card to copy a particular range of record

PostPosted: Sat Jun 20, 2015 6:13 pm
by vsgurunath
Thanks, Billy, for your input. I will attempt this on Monday and post the result.

I intend to execute these sort steps from within a rexx exec. If you could suggest a better alternative for extracting the desired set of records from the input file, I will be thankful.

Re: ICEMAN control card to copy a particular range of record

PostPosted: Sat Jun 20, 2015 6:38 pm
by BillyBoyo
Just do it with Rexx. A couple of "flags", and you make sure that your test for non-blank is only done on records subsequent to the header.

If you have more processing to do in Rexx, and I don't imagine your data has a huge volume, then do the extract in Rexx, why not?