View previous topic :: View next topic |
Author |
Message |
Kumar Kuppanna Beginner

Joined: 22 May 2013 Posts: 3 Topics: 1
|
Posted: Tue Apr 08, 2014 2:30 am Post subject: Can we use IF-ELSE condition in sort control card |
|
|
Hi,
I have a requirement to copy 1 input file into 3 output files,
the conditions goes like the below
if a condition is satisfied it should write into 1st output file
else it has to write into 2nd output file.
Please advice. _________________ Kumar Kuppanna |
|
Back to top |
|
 |
William Collins Supermod
Joined: 03 Jun 2012 Posts: 437 Topics: 0
|
Posted: Tue Apr 08, 2014 5:36 am Post subject: |
|
|
First you say three files, then you mention the 1st and 2nd only.
You specify multiple output files with OUTFIL. OUTFIL has INCLUDE=/OMIT= and SAVE which should give you what you want, probably, but can't be certain as don't know what you actually want.
Read the documentation. Look at the examples. Find other examples here, internet. Experiment. If still having problems, show sample input, expected output, rules to map from one to the other, RECFM, LRECL, position and length of important fields |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
|
Posted: Tue Apr 08, 2014 10:59 am Post subject: |
|
|
Kumar Kuppanna,
Code: |
//STEP0050 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC - GOES TO FILE-1
DEF - FILE-2
EFG - FILE-2
HIJ - FILE-2
KLM - FILE-2
NOP - FILE-2
QRS - GOES TO FILE-1
TUV - FILE-2
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT1,INCLUDE=(1,3,SS,EQ,C'ABC,QRS')
OUTFIL FNAMES=OUT2,SAVE
//* |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Kumar Kuppanna Beginner

Joined: 22 May 2013 Posts: 3 Topics: 1
|
Posted: Wed Apr 09, 2014 7:20 am Post subject: |
|
|
kolusu,
Thanks a lot for your inputs it has worked out for me. _________________ Kumar Kuppanna |
|
Back to top |
|
 |
|
|