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

start and end copy based upon some condition


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
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: 1702
Location: Australia

PostPosted: Thu Jan 10, 2013 4:38 am
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
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: 1702
Location: Australia

PostPosted: Fri Jan 11, 2013 3:17 am
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Jan 12, 2013 1:27 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts DB2 Table - Image copy unload IBM Tools 2
No new posts To search DB2 table based on Conditio... DB2 1
Search our Forums:

Back to Top