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
 

 

start and end copy based upon some condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
arivazhagan_k

New User


Joined: 05 Dec 2007
Posts: 57
Location: chennai

PostPosted: Thu Jan 10, 2013 1:18 am    Post subject: start and end copy based upon some condition
Reply with quote

Input file :

Code:
********************************* To
READY                               
  LISTDS 'HI.HELLO.HEY' MEMBERS   
HI.HEELO.HEY
--RECFM-LRECL-BLKSIZE-DSORG         
  FB    80    32720   PO           
                                   
--VOLUMES--                         
  XXXXXX
--MEMBERS--                         
  M1111A01                         
  M1111A02                         
  M1111A03                       
  M1111A04                         
  M1111A05                         
READY                               
END                                 
******************************** Bot


output should be including eliminating the sapces :

Code:
M1111A01                         
M1111A02                         
M1111A03                       
M1111A04                         
M1111A05
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jan 10, 2013 2:35 am    Post subject:
Reply with quote

arivazhagan_k,

Use the following DFSORT JCL

Code:

//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD DISP=SHR,DSN=Your Input 137 byte VBA Listds file
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                   
  OPTION COPY,VLSCMP                                             
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(6,11,CH,EQ,C'--MEMBERS--'),     
                 END=(6,5,CH,EQ,C'READY'),PUSH=(5:6,1)),         
  IFTHEN=(WHEN=(6,11,CH,EQ,C'--MEMBERS--',OR,5,6,CH,EQ,C'-READY'),
  OVERLAY=(5:X))                                                 
                                                                 
  OUTFIL VTOF,INCLUDE=(5,1,CH,EQ,C'-'),BUILD=(8,8)               
//*
Back to top
View user's profile Send private message
arivazhagan_k

New User


Joined: 05 Dec 2007
Posts: 57
Location: chennai

PostPosted: Thu Jan 10, 2013 4:15 am    Post subject:
Reply with quote

Thanks Skolusu
Both input and outfile DCB - RECFM=FBA,LRECL=80,BLKSIZE=800

But i am getting
Code:

SYSIN :                                                             
  OPTION COPY,VLSCMP                                               
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(6,11,CH,EQ,C'--MEMBERS--'),       
                 END=(6,5,CH,EQ,C'READY'),PUSH=(5:6,1)),           
  IFTHEN=(WHEN=(6,11,CH,EQ,C'--MEMBERS--',OR,5,6,CH,EQ,C'-READY'), 
  OVERLAY=(5:X))                                                   
                                                                   
  OUTFIL VTOF,INCLUDE=(5,1,CH,EQ,C'-'),BUILD=(8,8)                 
WER276B  SYSDIAG= 11244242, 24964673, 24964673, 14480475           
WER164B  6,904K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED, 
WER164B     0 BYTES RESERVE REQUESTED, 1,012K BYTES USED           
WER146B  12K BYTES OF EMERGENCY SPACE ALLOCATED                     
WER108I  SORTIN   : RECFM=FBA  ; LRECL=    80; BLKSIZE=   800       
WER073I  SORTIN   : DSNAME=XXXX.INPUT
WER257I  INREC RECORD LENGTH =    80                               
WER110I  SORTOUT  : RECFM=FBA  ; LRECL=    80; BLKSIZE=   800       
WER074I  SORTOUT  : DSNAME=XXXX.OUTPUT                             
WER247A  SORTOUT  HAS INCOMPATIBLE LRECL                           
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                       
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                       
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jan 10, 2013 4:38 am    Post subject:
Reply with quote

Hi,

firstly, you are using SYNCSORT and not DFSORT, so topic should be moved to JCL.

secondly, Kolusu specified

Quote:
//SORTIN DD DISP=SHR,DSN=Your Input 137 byte VBA Listds file


As your file is FB, all you need to do is remove VLSCOMP & VTOF and adjust the start positions.


Gerry
Back to top
View user's profile Send private message
arivazhagan_k

New User


Joined: 05 Dec 2007
Posts: 57
Location: chennai

PostPosted: Fri Jan 11, 2013 2:13 am    Post subject:
Reply with quote

I solved the abend but still i am not getting the expected output

input

Code:
********************************* To
READY                               
  LISTDS 'HI.HELLO.HEY' MEMBERS   
HI.HEELO.HEY
--RECFM-LRECL-BLKSIZE-DSORG         
  FB    80    32720   PO           
                                   
--VOLUMES--                         
  XXXXXX
--MEMBERS--                         
  M1111A01                         
  M1111A02                         
  M1111A03                       
  M1111A04                         
  M1111A05                         
READY                               
END                   


SORT IN CARD
Code:
//SYSIN    DD *                                                   
  OPTION COPY                                                     
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,11,CH,EQ,C'--MEMBERS--'),     
                 END=(2,5,CH,EQ,C'READY'),PUSH=(5:6,1)),           
  IFTHEN=(WHEN=(2,11,CH,EQ,C'--MEMBERS--',OR,2,5,CH,EQ,C'-READY'),
  OVERLAY=(5:X))                                                   
                                                                   
  OUTFIL INCLUDE=(1,3,CH,EQ,C'  '),BUILD=(3,8)                     
//*


output

Code:
************
LISTDS     
FB    8     
           
DSISSU     
MMGINH1     
MMIZVW6     
MMJHPW5     
MM807W6     
MM807W6     
MM807W6     
MM807W6     
PM512K5     
PM512X9     
************
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Jan 11, 2013 3:17 am    Post subject:
Reply with quote

Hi,

can you please post correct data if you expect help otherwise you will pisss people off.

The output data does not reflect the input data.

Now you can try this
Code:
  OPTION COPY                                                     
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,11,CH,EQ,C'--MEMBERS--'),     
                 END=(2,5,CH,EQ,C'READY'),PUSH=(12:2,11)),         
  IFTHEN=(WHEN=(2,11,CH,EQ,C'--MEMBERS--',OR,2,5,CH,EQ,C'READY'), 
  OVERLAY=(12:11X))                                               
  OUTFIL INCLUDE=(12,11,CH,EQ,C'--MEMBERS--'),BUILD=(4,8)         



Gerry
Back to top
View user's profile Send private message
arivazhagan_k

New User


Joined: 05 Dec 2007
Posts: 57
Location: chennai

PostPosted: Fri Jan 11, 2013 9:57 pm    Post subject:
Reply with quote

Really sorry for that....lot of multitasking....I have posted wrong expected output. but thankfully you were able to differentiate both expected and posted.
The expected output should be
Code:

M1111A01                         
M1111A02                         
M1111A03                       
M1111A04                         
M1111A05                         


I tweak the sysin card little bit to get the exact result. Thanks Skolusu & gcicchet.

input

Code:
READY                               
  LISTDS 'VIC.XXX.YYYY’ MEMBERS     
VIC.XXX.YYYY                       
--RECFM-LRECL-BLKSIZE-DSORG         
  FB    80    32720   VO             
                                     
--VOLUUES--                         
  DSISSU                             
--UEUBERS--                         
  UEGINH12                           
  UEIZVW63                           
  UEJHVW58                           
  UV807W60                           
  UV807W61                           
  UV807W64                           
  UV807W65                           
  VT512K55                           
  VT512X94                           
READY                               
END           


SORT IN CARD
Code:

 //SYSIN    DD *                                                     
     OPTION COPY                                                     
     INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,11,CH,EQ,C'--MEMBERS--'),     
                    END=(1,5,CH,EQ,C'READY'),PUSH=(12:1,11)),       
     IFTHEN=(WHEN=(1,11,CH,EQ,C'--MEMBERS--',OR,1,5,CH,EQ,C'READY'),
     OVERLAY=(12:11X))                                               
     OUTFIL INCLUDE=(12,11,CH,EQ,C'--MEMBERS--'),BUILD=(3,8)         
 //*                                                                 



OUTPUT
Code:

UEGINH12     
UEIZVW63     
UEJHVW58     
UV807W60     
UV807W61     
UV807W64     
UV807W65     
VT512K55     
VT512X94     
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Sat Jan 12, 2013 1:27 am    Post subject: Reply to: start and end copy based upon some condition
Reply with quote

why complain and waste everybody' s time

the control cards used to obtain the wrong result were different from those suggested

when You used those suggested You got the expected result
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
This topic is locked: you cannot edit posts or make replies. Unwrap the data based on delimiter X'25' bhavana yalavarthi DFSORT/ICETOOL 30 Fri Dec 09, 2016 10:25 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts CICS START AND CANCEL blayek CICS 1 Wed Dec 07, 2016 3:27 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


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