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

multiple input multiple output ?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
LinkinPark
Warnings : 1

New User


Joined: 20 Nov 2005
Posts: 44
Location: DALIAN,CHINA

PostPosted: Mon Jan 23, 2006 5:46 am
Reply with quote

Hi Frank Yaeger,

tell u my requirement:
S1.KE and S2.KE have same layout :
e.g
S1.KE
Code:

----------------
NAME     ID
----------------
0 1      26 2
----------------
A        01
B        02
C        01
D        02
E        03
F        04

S2.KE
Code:
 
----------------
NAME     ID
----------------
0 1     26 2
----------------
G       01
H       02
I       01
J       02
K       03
L       04

and after sort
make sure
dateset sortout1 include following records which only ID=01
Code:
 
----------------
NAME    ID
----------------
0 1    26 2
----------------
A       01
C       01
G       01
I       01

sortout2 include following records which only ID=02

.............................................

that's all
Thanks&Regards,

LinkinPark
Back to top
View user's profile Send private message
fixdoubts

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Mon Jan 23, 2006 6:32 pm
Reply with quote

Hi,

Assuming that in both the files the second field starts in the same position
i have given this soln, hope this helps

Code:

//STEP EXEC PGM=SORT
//SORTIN DD *       
A        01         
B        02         
C        01         
D        02         
E        03         
F        04         
//       DD *       
G        01         
H        02         
I        01         
J        02         
K        03                       
L        04                       
/*                               
//SORTOUT DD SYSOUT=*             
//SYSIN DD *                     
  SORT FIELDS=COPY               
  INCLUDE COND=(10,2,CH,EQ,C'01')
/*                               
//*                               


i have coded it with in-stream u can use ur files instead

the output will be
Code:

A        01 
C        01 
G        01 
I        01 


This is with out headers.

Regards,
Back to top
View user's profile Send private message
Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Mon Jan 23, 2006 6:43 pm
Reply with quote

Linkinpark,,

Do the 5 1st records need to be reported in the output : could you clarify this please

You say
Code:

and after sort


But what field needs to be sorted ?

Alain
Back to top
View user's profile Send private message
fixdoubts

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Mon Jan 23, 2006 6:46 pm
Reply with quote

Hi,

Sorry i didnt read it completely i think this would do,

Code:

//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG   DD SYSOUT=*   
//DFSMSG    DD SYSOUT=*   
//FILEIN1   DD *           
A        01               
B        02               
C        01               
//FILEIN2   DD *           
G        01               
H        02               
I        01               
//OUT   DD SYSOUT=*       
//OUT1  DD SYSOUT=*       
//TOOLIN   DD *                           
    COPY FROM(FILEIN1) TO(OUT) USING(CPY1)
    COPY FROM(FILEIN2) TO(OUT1) USING(CPY2)
/*                                         
//CPY1CNTL DD *                           
    INCLUDE COND=(10,2,CH,EQ,C'01')       
/*                                         
//CPY2CNTL DD *                           
    INCLUDE COND=(10,2,CH,EQ,C'02')       
/*                                         
//                                         


outut
out
Code:

A        01
C        01

out1
Code:

H        02


Regards,
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Jan 23, 2006 10:06 pm
Reply with quote

LinkinPark,

You didn't actually show the records you wanted in SORTOUT2, but assuming that it's all the records with '02', you can use a DFSORT job like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=S1.KE,DISP=SHR
//       DD DSN=S2.KE,DISP=SHR
//SORTOUT1 DD DSN=..  output file1 ('01' records)
//SORTOUT2 DD DSN=..  output file2 ('02' records)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=SORTOUT1,INCLUDE=(26,2,CH,EQ,C'01')
  OUTFIL FNAMES=SORTOUT2,INCLUDE=(26,2,CH,EQ,C'02')
/*


SORTOUT1 will have:

Code:

A                        01 
C                        01 
G                        01 
I                        01 


SORTOUT2 will have:

Code:

B                        02 
D                        02 
H                        02 
J                        02 


In your example, the records are already sorted by position 1, but if you actually need to sort by position 1, just change OPTION COPY to:

Code:

   SORT FIELDS=(1,1,CH,A)
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Tue Jan 24, 2006 12:56 am
Reply with quote

Can this help you?
Code:
//STEP010S EXEC PGM=ICETOOL           
//DFSMSG   DD SYSOUT=*               
//TOOLMSG  DD SYSOUT=*               
//IN1      DD *                       
----------------                     
NAME     ID                           
----------------                     
0 1      26 2                         
----------------                     
A        01                           
B        02                           
C        01                           
D        02                           
E        03                           
F        04                           
//IN2      DD *                       
----------------                     
NAME     ID                           
----------------                     
0 1      26 2                         
----------------                     
G        01                           
H        02                                             
I        01                                             
J        02                                             
K        03                                             
L        04                                             
//OUT      DD SYSOUT=*                                   
//TOOLIN   DD *                                         
 COPY FROM(IN1)         USING(CTL1)                     
 COPY FROM(IN1)         USING(CTL2)                     
 COPY FROM(IN2)         USING(CTL2)                     
//CTL1CNTL DD *                                         
  OUTFIL FNAMES=OUT,ENDREC=5                             
//CTL2CNTL DD *                                         
  OUTFIL FNAMES=OUT,STARTREC=6,INCLUDE=(10,2,CH,EQ,C'01')


I hope in this.

P.S.= You can also divide header and body to do the same...
If you try this solution your output must be coded with
Code:
DISP=(MOD,...)
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Tue Jan 24, 2006 1:01 am
Reply with quote

Ops...
for multiple output you must change, after OUT DD SYSOUT=* with:
Code:
//OUT01    DD SYSOUT=*                                     
//OUT02    DD SYSOUT=*                                     
//OUT03    DD SYSOUT=*                                     
//OUT04    DD SYSOUT=*                                     
//TOOLIN   DD *                                             
 COPY FROM(IN1)         USING(CTL1)                         
 COPY FROM(IN1)         USING(CTL2)                         
 COPY FROM(IN2)         USING(CTL2)                         
//CTL1CNTL DD *                                             
  OUTFIL FNAMES=OUT01,ENDREC=5                             
  OUTFIL FNAMES=OUT02,ENDREC=5                             
  OUTFIL FNAMES=OUT03,ENDREC=5                             
  OUTFIL FNAMES=OUT04,ENDREC=5                             
//CTL2CNTL DD *                                             
  OUTFIL FNAMES=OUT01,STARTREC=6,INCLUDE=(10,2,CH,EQ,C'01')
  OUTFIL FNAMES=OUT02,STARTREC=6,INCLUDE=(10,2,CH,EQ,C'02')
  OUTFIL FNAMES=OUT03,STARTREC=6,INCLUDE=(10,2,CH,EQ,C'03')
  OUTFIL FNAMES=OUT04,STARTREC=6,INCLUDE=(10,2,CH,EQ,C'04')
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jan 24, 2006 1:38 am
Reply with quote

Hmmm ... there seems to be a whole lot of confusion about what LinkinPark is trying to do. The way I read it, it's just a matter of putting the records with '01' into output file1 and the records with '02' into output file2? How are the rest of you interpreting it? Where did the idea about the "first 5 records" come from?

LinkinPark,

If any of the solutions given is the one you need, please say so, and explain why. If none of the solutions given are the one you need, please explain exactly what it is you do need.
Back to top
View user's profile Send private message
LinkinPark
Warnings : 1

New User


Joined: 20 Nov 2005
Posts: 44
Location: DALIAN,CHINA

PostPosted: Tue Jan 24, 2006 5:54 am
Reply with quote

Hi

Frank, it's what you say , I wanna put the records with '01' into output file1 and the records with '02' into output file2 using program "SORT".
but , I dont know "ICEMAN", what is it ?How to use it ? Can I change to "SORT"?Is there any document about it like "SORT" u provide me ?

Thank u very much ,
LinkinPark
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jan 24, 2006 6:32 am
Reply with quote

PGM=ICEMAN and PGM=SORT both invoke the sort product installed at your site which may be DFSORT (ICE messages), Syncsort (WER messages) or CA-SORT (CAS messages). You can use PGM=SORT instead of PGM=ICEMAN if you like - they are identical.

If you're using DFSORT:

All of the DFSORT documentation is available at:

Use [URL] BBCode for External Links

Since you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online from the link above.
Back to top
View user's profile Send private message
LinkinPark
Warnings : 1

New User


Joined: 20 Nov 2005
Posts: 44
Location: DALIAN,CHINA

PostPosted: Tue Jan 24, 2006 9:15 am
Reply with quote

Hi Frank Yaeger,

The method u provide me is not feasibe VASM data set,
"SORTIN VSAM CONCATENATED SORTIN NOT ALLOWED"
How about VASM ? Can I use the "MERGE" instead of "SORT" ?

Regards&Thanks,

LinkinPark
Back to top
View user's profile Send private message
LinkinPark
Warnings : 1

New User


Joined: 20 Nov 2005
Posts: 44
Location: DALIAN,CHINA

PostPosted: Tue Jan 24, 2006 2:02 pm
Reply with quote

Hi Frank

I changed the "SORT" to "MERGE" ,following is code :
Code:
//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN01 DD DSN=S1.KE,DISP=SHR
//SORTIN02       DD DSN=S2.KE,DISP=SHR
//SORTOUT1 DD DSN=..  output file1 ('01' records)
//SORTOUT2 DD DSN=..  output file2 ('02' records)
//SYSIN    DD    *
  MERGE FIELDS=(1,1,CH,A)
  OUTFIL FNAMES=SORTOUT1,INCLUDE=(26,2,CH,EQ,C'01')
  OUTFIL FNAMES=SORTOUT2,INCLUDE=(26,2,CH,EQ,C'02')
/*

abend with error code 16 ,How to solve this problem?

Regards&Thanks,
LinkinPark
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Tue Jan 24, 2006 2:45 pm
Reply with quote

Hi Frank an LinkinPark, I suppose that as usual I'm wrong.
I try to explain my interpreted solution:
We have two file like:
Code:
----------------
NAME     ID     
----------------
0 1      26 2   
----------------
A        01     
B        02     
C        01     
D        02     
E        03     
F        04     

Code:
----------------
NAME     ID     
----------------
0 1      26 2   
----------------
G        01     
H        02     
I        01     
J        02     
K        03     
L        04     

that LinkinPark call S1.KE and S2.KE.
Nobody asked to Linkin if the header is repeated with jump page or other thing so I assume that we have only 5 record for the header.
If the layout is the same(but if is different nothing change) we can accept that the header can be unique for these two file(or more).
Now LinkinPark told us that he need as output this layout:
Code:

----------------
NAME    ID
----------------
0 1    26 2
----------------
A       01
C       01
G       01
I       01

that for what I can see is the same of previous except for the content of body section. So I assume that LinkinPark need to filter the content of body only!
For this reason, if the header is not repeated, you can divide, using ICETOOL the header from first or second file and after make a filter like the sample above. If he needs only item 01 and 02, in my opinion he can use this method... I can't see complication in this...
If linkinPark has doubt about ICETOOL noone other than Frank can explain better how it work.
I repeate the sample above using your DD (SORTINnn and SORTOUTn)
Code:
//STEP010S EXEC PGM=ICETOOL                   
//DFSMSG   DD SYSOUT=*                       
//TOOLMSG  DD SYSOUT=*                       
//SORTIN01 DD *                               
----------------                             
NAME     ID                                   
----------------                             
0 1      26 2                                 
----------------                             
A        01                                   
B        02                                   
C        01                                   
D        02                                   
E        03                                   
F        04                                   
//SORTIN02 DD *                               
----------------                             
NAME     ID                                   
----------------                             
0 1      26 2                                 
----------------                             
G        01                                   
H        02                                                   
I        01                                                   
J        02                                                   
K        03                                                   
L        04                                                   
//SORTOUT1 DD SYSOUT=*                                       
//SORTOUT2 DD SYSOUT=*                                       
//TOOLIN   DD *                                               
 COPY FROM(SORTIN01)    USING(CTL1)                           
 COPY FROM(SORTIN01)    USING(CTL2)                           
 COPY FROM(SORTIN02)    USING(CTL2)                           
//CTL1CNTL DD *                                               
  OUTFIL FNAMES=SORTOUT1,ENDREC=5                             
  OUTFIL FNAMES=SORTOUT2,ENDREC=5                             
//CTL2CNTL DD *                                               
  OUTFIL FNAMES=SORTOUT1,STARTREC=6,INCLUDE=(10,2,CH,EQ,C'01')
  OUTFIL FNAMES=SORTOUT2,STARTREC=6,INCLUDE=(10,2,CH,EQ,C'02')

and your output will be:
SORTOUT1:
Code:
----------------
NAME     ID     
----------------
0 1      26 2   
----------------
A        01     
C        01     
G        01     
I        01     

SORTOUT2
Code:
----------------
NAME     ID     
----------------
0 1      26 2   
----------------
B        02     
D        02     
H        02     
J        02     


Now Mr Linkin, has you input a variable header or repetitive?

As usual I hope in my helps but I can be wrong.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jan 24, 2006 10:05 pm
Reply with quote

MGIndaco,

Oh, I see. You assumed that the "headers" were actually part of the file. I assumed they were just for illustrative purposes and not actually in the file.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jan 24, 2006 10:14 pm
Reply with quote

Linkinpark,

Why didn't you mention that the input files were VSAM? That's kind of an important thing to leave out. Are the records in the VSAM files all the same length (fixed-length) or different lengths (variable-length)?
What type of VSAM file is it? Does it have a key? If so, how was the key defined?

Are the output files VSAM or non-VSAM?

It's true that the system does not allow concatenation of VSAM files.

You can only use MERGE if the VSAM files are already sorted by the key you want to merge on.

Quote:
abend with error code 16 ,How to solve this problem?


When you get an error or an ABEND, you need to show the information that tells us why you got the error or ABEND. For DFSORT, that would be the //SYSOUT messages.

I suspect the files were not in order by the key you specified, but I couldn't say for sure without seeing the messages.

If you can't merge the files, then you may have to copy them individually.

If you want people to help you in a timely way, you need to learn how to give all of the details of what you're trying to do when you post.
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top