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

Copy only particular block of records.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Jan 16, 2009 9:59 pm
Reply with quote

Hi,

We have a file of LRECL 500 and RECFM FB that appears as shown here:

Code:

@HDRIND         081107214531     00892

@TLR311057AUT   11071509AUTOMARTS  B   00000123451     AUT200811071509ATGUIORDER
@ETLR999999999999999999999999999999999999999999999999999999999999999999999999999
99999999999999999999999999999999999999999999999999999999999999999999999999999999
@HDRIND         081107214531     00898                                         
                                                                               
@TLR303274AUT   11071500AUTOMARTS  A   0000012345200000AUT200811071500ATGUIORDER
1111112345200000NA162009          00000189624000010000018962400001VERSA   000100
1111112345200000NA162009          00000189624000010000018962400001VERSA   000100
@ETLR999999999999999999999999999999999999999999999999999999999999999999999999999
99999999999999999999999999999999999999999999999999999999999999999999999999999999
@HDRIND         081107214537     00892                                         
                                                                               
@TLR315024AUT   11071823AUTOMARTS  C   0000012345300001AUT200811071823ATGUIORDER
1111112345300001NA132009          00000113866000040000011500400001OPTRA05N000110
1111112345300001NA122009          00000234833000020000011382300001OPTRA  N000129
@ETLR999999999999999999999999999999999999999999999999999999999999999999999999999
99999999999999999999999999999999999999999999999999999999999999999999999999999999


I want to copy only the below shown block to output file of same LRECL and RECFM. Would you please tell me how we can do it using Syncsort?

Code:

@HDRIND         081107214531     00898                                         
                                                                               
@TLR303274AUT   11071500AUTOMARTS  A   0000012345200000AUT200811071500ATGUIORDER
1111112345200000NA162009          00000189624000010000018962400001VERSA   000100
1111112345200000NA162009          00000189624000010000018962400001VERSA   000100
@ETLR999999999999999999999999999999999999999999999999999999999999999999999999999
99999999999999999999999999999999999999999999999999999999999999999999999999999999


I am asked to test only with above set of records. Not able to VIEW or EDIT the file because of its size. I thought it will be very tedious to copy paste the entire length of record to new file though only 6 records are required !

Please help.

Thanks.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Jan 16, 2009 10:06 pm
Reply with quote

Ramsri,

Is there anything in particular which identifies this group?
Do you have 'entire blank records' as seen above?
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Jan 16, 2009 10:17 pm
Reply with quote

Arun, Blank will be there after each @HDRIND record. The set of records I want copy has 00898 in @HDRIND record. But all set of records have @ETLR to end that set! I thought it is not possible. I am not even getting the idea of doing it using a COBOL or EAZYTRIEVE.

Thanks.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Jan 16, 2009 11:13 pm
Reply with quote

Ramsri,

The below SYNCTOOL application should work for your requirement. From the sample data you posted, I assumed the below positions. If it's different from your actual data positions, you can modify it accordingly.

'00898' - 34,5,CH
'@HDRIND' - 1,7,CH

Code:
//STEP0100 EXEC PGM=SYNCTOOL                                           
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN       DD DSN= Input  file ---- FB/LRECL=500                       
//OUT      DD DSN= Output file ---- FB/LRECL=500                       
//TOOLIN   DD *                                                       
 SPLICE FROM(IN) TO(OUT) ON(509,8,CH) WITHALL WITH(1,500) -           
             KEEPBASE KEEPNODUPS USING(CTL1)                           
//CTL1CNTL DD *                                                       
 INREC IFTHEN=(WHEN=INIT,                                             
      OVERLAY=(501:SEQNUM,8,ZD)),                                     
       IFTHEN=(WHEN=(1,7,CH,EQ,C'@HDRIND'),                           
      OVERLAY=(509:SEQNUM,8,ZD),HIT=NEXT),                             
       IFTHEN=(WHEN=(1,7,CH,EQ,C'@HDRIND',AND,34,5,CH,EQ,C'00898'),   
      OVERLAY=(517:C'Y')),                                             
       IFTHEN=(WHEN=NONE,                                             
      OVERLAY=(509:SEQNUM,8,ZD,509:501,8,ZD,SUB,509,8,ZD,M11,LENGTH=8))
 OUTFIL INCLUDE=(517,1,CH,EQ,C'Y'),BUILD=(1,500)                       
/*
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Sat Jan 17, 2009 12:21 pm
Reply with quote

Arun, excellent.......It worked wonderfully.

Thanks for your help.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Sat Jan 17, 2009 4:04 pm
Reply with quote

Ramsri,

You're welcome. icon_smile.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
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 VB to VB copy - Full length reached SYNCSORT 8
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top