Posted: Wed Sep 15, 2004 11:40 am Post subject: Multiple File outputs in SAS based on condition
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).
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
Posted: Wed Sep 15, 2004 1:51 pm Post subject:
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,
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.
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
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
Posted: Thu Sep 16, 2004 5:13 am Post subject:
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.
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?
//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
//*
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