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 

Multiple File outputs in SAS based on condition

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
jimmy_augustine
Beginner


Joined: 23 Jun 2004
Posts: 32
Topics: 13

PostPosted: Wed Sep 15, 2004 11:40 am    Post subject: Multiple File outputs in SAS based on condition Reply with quote

Hi,
Is it possbile to output records in to different files base on certain condition(s) in SAS?
I have a large file. I need to split that in to multiple output file (A maximum number of 36 files) using SAS (I know the same can be achived by FILE-AID, but we need to do some more processing before outputing, which can be done by SAS).

Could any one help?
Thanks in advance
Jimmy
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Sep 15, 2004 1:51 pm    Post subject: Reply with quote

Jimmy,

I am not expert in SAS, but if the processing is simpler it can be done in sort also. Post a sample input and desired output with DCB parameters of input and output files.

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

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


Joined: 23 Jun 2004
Posts: 32
Topics: 13

PostPosted: Thu Sep 16, 2004 4:16 am    Post subject: Reply with quote

Kolusu,
I am attaching a sample input data. Infact it is a JCL generated by a program and now i need to split this JCL based on the delimiters '//EETU' and '//*END'
we managed to split this in to different files by using FILEAID. But the CTS (Our System guys & system operations) don't want a single comment line in the JCL as it is against their standards. so If I use FILEAID, i can't find a way to remove '//*END ' from the splited jcls.
There are hundreds of lines in between '//EETU' and '//*END'. I just pasted only few lines for giving you a feel.

The input and output records are of 80 char format...
the Maximum occurances of //*END is 36. That means a max of 36 output files will be created.

Code:


//EETU5401 JOB (A,D,ETRS00),'00  ETRS       &:YWC',                       
//         MSGCLASS=T,USER=ZIIGAOS,TIME=07                                 
//*AUTOBEEP PAGE=JAXTAX                                                   
//PROCS    JCLLIB ORDER=(AD87CM.LBP.IIFS.PROC.JES.JCLLIB,                 
//         AD87CM.LBP.IIFS.VKCARD.JES.JCLLIB,                             
//         ADIIGE.LBP.FAC.LIB.JES.JCLLIB,                                 
//         AD87CM.LBP.CTSP.PROC.JES.JCLLIB)                               
//ACCTCODE INCLUDE MEMBER=ACCTCODE                                         
//OUT1     OUTPUT ROOM=0075,NAME='ETRS DNPSPA    &:YWC',CLASS=A,           
//         COPIES=2,DEST=JSTD,FORMS=NHOL,WRITER=SIMPLEX                   
//ETU54101 EXEC ETRU546,MEDIA=CARTRIDGE,N1=1,N2=001,PASS=PB,               
//         UNIT=TAPE,CYCLE=D&:YWC                                         
//ETU54102 EXEC ETRU546,MEDIA=CARTRIDGE,N1=1,N2=002,PASS=PB,               
//         UNIT=TAPE,CYCLE=D&:YWC                                         
//*END   
//EETU5402 JOB (A,D,ETRS00),'00  ETRS       &:YWC',               
//         MSGCLASS=T,USER=ZIIGAOS,TIME=07                         
//*AUTOBEEP PAGE=JAXTAX                                           
//PROCS    JCLLIB ORDER=(AD87CM.LBP.IIFS.PROC.JES.JCLLIB,         
//         AD87CM.LBP.IIFS.VKCARD.JES.JCLLIB,                     
//         ADIIGE.LBP.FAC.LIB.JES.JCLLIB,                         
//         AD87CM.LBP.CTSP.PROC.JES.JCLLIB)                       
//ACCTCODE INCLUDE MEMBER=ACCTCODE                                 
//OUT1     OUTPUT ROOM=0075,NAME='ETRS DNPSPA    &:YWC',CLASS=A,   
//         COPIES=2,DEST=JSTD,FORMS=NHOL,WRITER=SIMPLEX           
//ETU54101 EXEC ETRU546,MEDIA=CARTRIDGE,N1=1,N2=012,PASS=PB,       
//         UNIT=TAPE,CYCLE=D&:YWC                                 
//ETU54102 EXEC ETRU546,MEDIA=CARTRIDGE,N1=1,N2=013,PASS=PB,       
//         UNIT=TAPE,CYCLE=D&:YWC                                 
//ETU54111 EXEC ETRU546,MEDIA=CARTRIDGE,N1=1,N2=022,PASS=PB,         
//         UNIT=TAPE,CYCLE=D&:YWC                                   
//*END                   


Hope you got a clear picture.
Thanks
Jimmy
Back to top
View user's profile Send private message
jimmy_augustine
Beginner


Joined: 23 Jun 2004
Posts: 32
Topics: 13

PostPosted: Thu Sep 16, 2004 5:04 am    Post subject: Reply with quote

I just came to know that we can do this easily in REXX. but i have no idea how to code a REXX program. Will it be going to be a long code? will take whole lot of time to code a REXX program to do this??
Thanks
Jimmy
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Sep 16, 2004 5:13 am    Post subject: Reply with quote

Jimmy,


Quote:

But the CTS (Our System guys & system operations) don't want a single comment line in the JCL as it is against their standards. so If I use FILEAID, i can't find a way to remove '//*END ' from the splited jcls.


So you don't want any thing which starts with a //* ? Do you need to eliminate //*AUTOBEEP also?

We use File-aid to remove the comment lines. Sort also can be used to split the files.

Thanks

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

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


Joined: 23 Jun 2004
Posts: 32
Topics: 13

PostPosted: Thu Sep 16, 2004 8:59 am    Post subject: Reply with quote

Kolusu,
They just dont like the '//*END' lines only. They said they will be happy as long as that lines are not in the jcls. So is there any option in FILE AID to do a split along with omiting these lines?

Jimmy
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Sep 16, 2004 10:17 am    Post subject: Reply with quote

Jimmy,

The following file-aid JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=FILEAID         
//SYSPRINT DD SYSOUT=*             
//SYSTOTAL DD SYSOUT=*             
//DD01     DD DSN=YOUR INPUT FILE,
//            DISP=SHR
//OUT01    DD DSN=YOUR OUTPUT FILE01,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//*
//OUT02    DD DSN=YOUR OUTPUT FILE02,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//*
... code all your output file allocation here

//OUT36    DD DSN=YOUR OUTPUT FILE36,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
$$DD01 USER MAXOUT=36,STOP=(1,EQ,C'//*END'),WRITE=OUT01   
$$DD01 SPACE STOP=(1,NE,C'//*END')                       
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT02             
$$DD01 SPACE STOP=(1,NE,C'//*END') 
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT03             
$$DD01 SPACE STOP=(1,NE,C'//*END')                                             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT04             
$$DD01 SPACE STOP=(1,NE,C'//*END')                       
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT05             
$$DD01 SPACE STOP=(1,NE,C'//*END')                       
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT06             
$$DD01 SPACE STOP=(1,NE,C'//*END')                       
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT07             
$$DD01 SPACE STOP=(1,NE,C'//*END')                       
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT08             
$$DD01 SPACE STOP=(1,NE,C'//*END')                       
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT09             
$$DD01 SPACE STOP=(1,NE,C'//*END')                       
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT10             
$$DD01 SPACE STOP=(1,NE,C'//*END')                       
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT11             
$$DD01 SPACE STOP=(1,NE,C'//*END')                       
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT12             
$$DD01 SPACE STOP=(1,NE,C'//*END')                       
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT13             
$$DD01 SPACE STOP=(1,NE,C'//*END')                       
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT14             
$$DD01 SPACE STOP=(1,NE,C'//*END')                       
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT15             
$$DD01 SPACE STOP=(1,NE,C'//*END')                       
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT16             
$$DD01 SPACE STOP=(1,NE,C'//*END')                       
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT17             
$$DD01 SPACE STOP=(1,NE,C'//*END')                       
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT18             
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT19 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT20 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT21 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT22 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT23 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT24 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT25 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT26 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT27 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT28 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT29 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT30 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT31 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT32 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT33 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT34 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT35 
$$DD01 SPACE STOP=(1,NE,C'//*END')             
$$DD01 USER STOP=(1,EQ,C'//*END'),WRITE=OUT36 
//*


Hope this helps...

Cheers

kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

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


Joined: 23 Jun 2004
Posts: 32
Topics: 13

PostPosted: Mon Sep 27, 2004 4:28 am    Post subject: Reply with quote

HI Kolusu,
Thanks a million
That worked:)
Jimmy
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 -> Utilities 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