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 

Can we use IF-ELSE condition in sort control card

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


Joined: 22 May 2013
Posts: 3
Topics: 1

PostPosted: Tue Apr 08, 2014 2:30 am    Post subject: Can we use IF-ELSE condition in sort control card Reply with quote

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
View user's profile Send private message
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Tue Apr 08, 2014 5:36 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Apr 08, 2014 10:59 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Kumar Kuppanna
Beginner


Joined: 22 May 2013
Posts: 3
Topics: 1

PostPosted: Wed Apr 09, 2014 7:20 am    Post subject: Reply with quote

kolusu,

Thanks a lot for your inputs it has worked out for me.
_________________
Kumar Kuppanna
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