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
 

 

Copy only particular block of records.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Copy only particular block of records.
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: 2275
Location: @my desk

PostPosted: Fri Jan 16, 2009 10:06 pm    Post subject:
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    Post subject: Reply to: Copy only particular block of records.
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: 2275
Location: @my desk

PostPosted: Fri Jan 16, 2009 11:13 pm    Post subject:
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    Post subject: Reply to: Copy only particular block of records.
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: 2275
Location: @my desk

PostPosted: Sat Jan 17, 2009 4:04 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
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 Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 5 Thu Apr 27, 2017 1:15 am
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am


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