MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Write the particular set of records

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Thu Apr 22, 2010 10:44 am    Post subject: Write the particular set of records Reply with quote

I have a input file with lrecl 80 & recfm=fb with following records


****** ***************************** Top of Data ******************************
TYP-1
REC1
REC2
REC3

TYP-2
REC4
REC5
REC6

TYP-3
REC7
REC8
REC9

TYP-4
REC10
REC11
REC12

TYP-1
REC13
REC14
REC15

TYP-2
REC16
REC17
REC18

TYP-3
REC19
REC20
REC21

TYP-4
REC22
REC23
REC24

**************************** Bottom of Data ****************************


I need the output file in the following way.

output file

****** ***************************** Top of Data ******************************
TYP-1
REC1
REC2
REC3

TYP-4
REC10
REC11
REC12

TYP-1
REC13
REC14
REC15

TYP-4
REC22
REC23
REC24

**************************** Bottom of Data ****************************
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Apr 22, 2010 11:02 am    Post subject: Reply with quote

sivafdms,

Use the following DFSORT control cards

Code:

//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                                 
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'TYP'),PUSH=(81:1,5))
  OUTFIL BUILD=(1,80),INCLUDE=(81,5,SS,EQ,C'TYP-1,TYP-4')         
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Thu Apr 22, 2010 12:51 pm    Post subject: Reply with quote

I tried to use the card in following jcl
Code:

//JSTY0010  EXEC PGM=ICEMAN                                         
//SYSOUT    DD SYSOUT=*                                             
//SORTIN    DD DISP=SHR,DSN=ISDXFSJ.FSAMS.TESTFILE.ARIF             
//SORTOUT   DD DSN=ISDXFSJ.FSAMS.TESTFILE.ARIF.OUT,                 
//             DISP=(,CATLG,DELETE),                               
//             UNIT=SYSDA,                                         
//             DCB=(*.SORTIN),                                     
//             SPACE=(TRK,(10,10),RLSE)                             
//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                 
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'TYP'),PUSH=(81:1,5)) 
  OUTFIL BUILD=(1,80),INCLUDE=(81,5,SS,EQ,C'TYP-1,TYP-4')           
//* 



i am getting following error
Code:
 
 E1  8 DSS10065E  PARAMETER 'BEGIN' IS UNIDENTIFIED. 
 E2  8 DSS10065E  PARAMETER 'PUSH' IS UNIDENTIFIED.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Apr 22, 2010 1:08 pm    Post subject: Reply with quote

sivafdms,

The messages you show are NOT DFSORT messages and it is the JCL checker software which is way beyond keeping up with the latest features of DFSORT. I suggest you run the job and get back if you get an error
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Thu Apr 22, 2010 1:43 pm    Post subject: Reply with quote

Thanks.. It ran fine.however when i tried to use same concpet with folllowing file & sort, it did not work. Could you please tell what is wrong in the card


Code:

***************************** Top of Data ******************************
AT APRIL 13, 2010 05:10:02.3958 AM                                     
TYPE PT-1 LABEL YES1 REFNUM 00003X49     FORMAT ISO                     
LOAD DIST LABEL: LDC2                                                   
                                                                       
TERM ID '01003041' MERCH ID ''                                         
 MESSAGE TYPE   : 0100                                                 
 BIT MAP 1            : 7238458228C08032                               
                                                                       
AT APRIL 13, 2010 05:10:02.3958 AM                                     
TYPE PT-2 LABEL YES1 REFNUM 00003X49     FORMAT ISO                     
LOAD DIST LABEL: LDC2                                                   
                                                                       
TERM ID '01003041' MERCH ID ''                                         
 MESSAGE TYPE   : 0100                                                 
 BIT MAP 1            : 7238458228C08032                               
                                                                       
AT APRIL 13, 2010 05:10:02.3958 AM                                     
TYPE PT-3 LABEL YES1 REFNUM 00003X49     FORMAT ISO                     
LOAD DIST LABEL: LDC2                                                   
                                                                       
TERM ID '01003041' MERCH ID ''                                         
 MESSAGE TYPE   : 0100                                                 
 BIT MAP 1            : 7238458228C08032                               
                                                                       
AT APRIL 13, 2010 05:10:02.3958 AM                                     
TYPE PT-4 LABEL YES1 REFNUM 00003X49     FORMAT ISO                     
LOAD DIST LABEL: LDC2                                                   
                                                                       
TERM ID '01003041' MERCH ID ''                                         
 MESSAGE TYPE   : 0100                                                 
 BIT MAP 1            : 7238458228C08032                               
                                                                       
**************************** Bottom of Data ****************************




used the sort card
Code:

//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                   
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(6,3,CH,EQ,C'PT-'),PUSH=(81:1,4))   
  OUTFIL BUILD=(1,80),INCLUDE=(81,4,SS,EQ,C'PT-1,PT-4')             
//*                                                                 
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Apr 22, 2010 1:47 pm    Post subject: Reply with quote

sivadfms,

You are pushing the value at pos 1 for 4 bytes which would push TYPE on to every record. You should push the contents from 6 for 4 bytes.

PUSH=(81:6,4))
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Fri Apr 23, 2010 9:19 am    Post subject: Reply with quote

Kolusu,

Thanks It worked fine.. Is this possible to explain how this sort card works..
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Apr 23, 2010 11:05 am    Post subject: Reply with quote

sivafdms,

Read this white paper which explains WHEN=GROUP function in detail with examples

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000085
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Fri May 07, 2010 9:55 am    Post subject: Reply with quote

When i am running the following jcl i am not able to create members TYP1 & TYP3 and the jcl is going to with space abend. I am using the same pds X.Y.Z for everything.

Code:

//STEP010  EXEC PGM=SORT                                               
//SYSOUT    DD SYSOUT=*                                                 
//SORTIN    DD DISP=SHR,DSN=X.Y.Z(IN)                 
//SORTOUT   DD DSN=X.Y.Z(OUT),                         
//             DISP=(MOD,KEEP,KEEP)                                     
//SYSIN    DD *                                                         
  SORT FIELDS=COPY                                                     
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(6,4,CH,EQ,C'TYP-'),PUSH=(75:6,5))     
  OUTFIL BUILD=(1,80),INCLUDE=(75,5,SS,EQ,C'TYP-1,TYP-3')               
/*                                                                     
//STEP020 EXEC PGM=SORT                                                 
//SYSOUT    DD SYSOUT=*                                                 
//SORTIN    DD DISP=SHR,DSN=X.Y.Z(OUT)                 
//SORTOF01  DD DSN=X.Y.Z(TYP1),DISP=(MOD,KEEP,KEEP)
//SORTOF02  DD DSN=X.Y.Z(TYP3),DISP=(MOD,KEEP,KEEP)                                     
//SYSIN    DD *                                                         
  SORT FIELDS=COPY                                                                                   
   OUTFIL FILES=01,INCLUDE=(75,4,SS,EQ,C'TYP-1') 
   OUTFIL FILES=02,INCLUDE=(75,4,SS,EQ,C'TYP-3') 
/*                                               
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri May 07, 2010 10:35 am    Post subject: Reply with quote

sivafdms,

I just don't understand as to why you need 2 steps in the first place.

Why are you having DISP=(MOD, KEEP,KEEP) for a creating a PDS Member?

Your Include cond on OUTFIL is checking for a length of 4 bytes where as the target string is 5 bytes.

If you are using DFSORT you canNOT use OUTFIL to write to PDS members in parallel. You can do that with regular sequential data sets or with PDSE members, but NOT with PDS members.

Assuming your output PDS is PDS-E the following DFSORT JCL will give you the desired results

Code:

//STEP010  EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DISP=SHR,DSN=X.Y.Z(IN)                 
//SORTOF01 DD DSN=X.Y.Z(TYP1),DISP=SHR
//SORTOF02 DD DSN=X.Y.Z(TYP3),DISP=SHR
//SYSIN    DD *                                                         
  SORT FIELDS=COPY                                                     
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(6,4,CH,EQ,C'TYP-'),PUSH=(75:6,5))   

  OUTFIL FILES=01,INCLUDE=(75,5,SS,EQ,C'TYP-1')
  OUTFIL FILES=02,INCLUDE=(75,5,SS,EQ,C'TYP-3') 
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Fri May 07, 2010 3:04 pm    Post subject: Reply with quote

Kolusu..

It worked for me.. However when i tried to run following jcl it is giving WER039A INSUFFICIENT VIRTUAL STORAGE
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri May 07, 2010 4:14 pm    Post subject: Reply with quote

sivafdms wrote:
Kolusu..

It worked for me.. However when i tried to run following jcl it is giving WER039A INSUFFICIENT VIRTUAL STORAGE


That message indicates you are using SYNCSORT. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Fri May 07, 2010 4:59 pm    Post subject: Reply with quote

What does the documentation say about the WER039A message?

Read the info and post your doubt here if something is not clear.
_________________
All the best,

di
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group