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
 

 

Copying Specified records based on condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Copying Specified records based on condition
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: 2284
Location: @my desk

PostPosted: Thu Nov 06, 2008 1:22 pm    Post subject:
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    Post subject: Reply to: Copying Specified records based on condition
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 Moderator


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

PostPosted: Thu Nov 06, 2008 10:26 pm    Post subject:
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    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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm


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