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

IF statements in DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sprikitik

New User


Joined: 29 Jan 2007
Posts: 61
Location: Makati City, Philippines

PostPosted: Mon Apr 28, 2008 7:52 am
Reply with quote

Can I do this using DFSORT:

INPUT file:

100STUDENT1001
101STUDENT1002

If input(11:4) - position, length) is equal to 1001 use 'MATH'
If input(11:4) - position, length) is equal to 1001 use 'ENGLISH'

output file:

1001STUDENTMATH
1002STUDENTENGLISH

basically, in have to decode the last 4 characters of the input file. Is there anyway that i can do this using DFSORT?
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 Apr 28, 2008 9:19 pm
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1       EXEC  PGM=ICEMAN                               
//SYSOUT   DD  SYSOUT=*                                   
//SORTIN   DD *                                           
100STUDENT1001                                             
101STUDENT1002                                             
/*                                                         
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD    *                                         
  OPTION COPY                                             
  INREC IFTHEN=(WHEN=(11,4,CH,EQ,C'1001'),                 
        OVERLAY=(11:C'MATH   ')),                         
      IFTHEN=(WHEN=(11,4,CH,EQ,C'1002'),                   
        OVERLAY=(11:C'ENGLISH'))                           
/*                                                         
Back to top
View user's profile Send private message
sprikitik

New User


Joined: 29 Jan 2007
Posts: 61
Location: Makati City, Philippines

PostPosted: Tue Apr 29, 2008 9:46 am
Reply with quote

Thanks for the reply!

Can you teach me how i can accomplish this using ICEMAN?

I have 2 files

File 1 :

10001STUDENT1
10002STUDENT2

FILE 2:

10001XXXXXXX

The output that i need is:

10001STUDENT1XXXXXXX
10002STUDENT2

Thanks!
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 Apr 29, 2008 8:27 pm
Reply with quote

You've posted the same question asking for a Syncsort solution, so I assume you're using Syncsort, not DFSORT. Please don't post Syncsort questions in the DFSORT Forum.
Back to top
View user's profile Send private message
sprikitik

New User


Joined: 29 Jan 2007
Posts: 61
Location: Makati City, Philippines

PostPosted: Tue Apr 29, 2008 9:14 pm
Reply with quote

Hi,

File 1 and file 2 will not have any duplicates but it is possible that record key from file 1 will not exist in file 2.

Record length of file 1 is 500 and file 2 is 21.

What i wanted to achieve is:

file 1

1001STUDENT..... <upto 500>

file 2
1001XXXXXXX <upto 21>

output file:

concatenate file 1 and file 2 if a record with the same key exist.
Back to top
View user's profile Send private message
sprikitik

New User


Joined: 29 Jan 2007
Posts: 61
Location: Makati City, Philippines

PostPosted: Tue Apr 29, 2008 9:16 pm
Reply with quote

Frank Yaeger wrote:
You've posted the same question asking for a Syncsort solution, so I assume you're using Syncsort, not DFSORT. Please don't post Syncsort questions in the DFSORT Forum.


sorry for the confusion, im using iceman.. Thanks!
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 Apr 29, 2008 9:18 pm
Reply with quote

PGM=ICEMAN invokes the sort product used by your site - DFSORT (ICExxxs messages) or Syncsort (WERxxxs messages). Which one are you actually using?
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts DFSORT - VB file RDW getting overridden DFSORT/ICETOOL 3
Search our Forums:

Back to Top