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

Copying Specified records based on condition


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

New User


Joined: 14 Nov 2007
Posts: 18
Location: US

PostPosted: Thu Nov 06, 2008 12:55 pm
Reply with quote

Quote:
Hi,

I have to copy specified record from input to output if the cols (59 to 8) is less than 20050101 and 68th column is N (last two parameters in the below example). My ouput should contain 4th,6th,10th,11th
parameters and append another 'Y' at the last
Input

Code:
APV;DPR;DPR;$AGSDICO;RPL;RLDPRAD ;  876;19940110;20000929;20081030;Y;


Output

Code:
Output:

$AGSDICO;RLDPRAD ;20081030;Y;Y;


I'm using Icetool to copy all the parameters now but the condition is not working

JCL used

Code:
//STEP01   EXEC PGM=ICETOOL                             
//TOOLMSG  DD  SYSOUT=*                                 
//DFSMSG   DD  SYSOUT=*                                 
//IN       DD  DSN=Z000470.REXX.UTIL(LED),DISP=SHR     
//OUT      DD  DSN=Z000470.REXX.REDUC1,                 
//             DISP=(NEW,CATLG,DELETE),                 
//             SPACE=(CYL,(1,1),RLSE)
//TOOLIN   DD *                                         
  COPY FROM(IN) TO(OUT) USING(CTL1)                   
//CTL1CNTL DD *                                         
  INCLUDE COND=(59,8,ZD,LT,20050101)                   
/*       


Input: FB, lenght: 80
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Nov 06, 2008 1:22 pm
Reply with quote

jramuk,

Quote:
I'm using Icetool to copy all the parameters now but the condition is not working

I guess you get empty output simply because your sample input does n't satisfy the condition given. The date at 59th position 20081030 is NOT less than 20050101. Also you'll need OUTREC/BUILD to reformat your output.
Back to top
View user's profile Send private message
jramuk

New User


Joined: 14 Nov 2007
Posts: 18
Location: US

PostPosted: Thu Nov 06, 2008 2:01 pm
Reply with quote

arcvns


Thnx for ur reply but that was a sample i/p
Code:

APV;DPR;DPR;$AGSDICO;RPL;RLDPRAD ;  876;19940110;20000929;20081030;Y;
APV;DPR;DPR;$AGSPREM;RPL;RLDPRAD ;  538;20030612;20030612;20030612;Y;
APV;DPR;DPR;$AGSPREV;RPL;RLDPRAD ;  540;19930325;20030612;20081002;Y;
APV;DPR;DPR;$AGSSTOK;RPL;RLDPRAD ; 1292;19910805;20050616;20081031;Y;
APV;DPR;DPR;$AGSSTO1;RPL;RLDPRAD ; 1179;19990225;19990225;19990225;Y;
APV;DPR;DPR;$DICREFD;RPL;RLDPRAD ;  215;20031024;20060522;20080722;Y;
APV;DPR;DPR;$DICREMO;RPL;RLDPRAD ;   43;19990521;19990527;19990527;Y;
APV;DPR;DPR;$HVEMOID;RPL;RLDPRAD ;   49;19960423;19960423;19960423;Y;
APV;DPR;DPR;$HVESEMD;RPL;RLDPRAD ;   17;19960423;19960423;20020724;Y;


Even for this i/p i'm getting an empty file as output
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 Nov 06, 2008 10:26 pm
Reply with quote

jramuk,

The DFSORT/ICETOOL job below will do what you asked for. However, for your input example, you will NOT get any output records because position 68 has 'Y' in all of your records and you are checking for 'N'. An example of a record that would be included is:

Code:

APV;DPR;DPR;$HVESEMD;RPL;RLDPRAD ;   17;19960423;19960423;20020724;N;


Code:

//STEP01   EXEC PGM=ICETOOL
//TOOLMSG  DD  SYSOUT=*
//DFSMSG   DD  SYSOUT=*
//IN       DD  DSN=Z000470.REXX.UTIL(LED),DISP=SHR
//OUT      DD  DSN=Z000470.REXX.REDUC1,
//             DISP=(NEW,CATLG,DELETE),
//             SPACE=(CYL,(1,1),RLSE)
//TOOLIN   DD *
  COPY FROM(IN) TO(OUT) USING(CTL1)
//CTL1CNTL DD *
  INCLUDE COND=(59,8,ZD,LT,20050101,AND,
    68,1,CH,EQ,C'N')
  OUTREC BUILD=(13,9,26,9,59,9,68,2,C'Y;')
/*
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 Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top