Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

IF statements in DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sprikitik

New User


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

PostPosted: Mon Apr 28, 2008 7:52 am    Post subject: IF statements in DFSORT
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 Moderator


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

PostPosted: Mon Apr 28, 2008 9:19 pm    Post subject:
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: 58
Location: Makati City, Philippines

PostPosted: Tue Apr 29, 2008 9:46 am    Post subject: Reply to: IF statements in DFSORT
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 Moderator


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

PostPosted: Tue Apr 29, 2008 8:27 pm    Post subject:
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: 58
Location: Makati City, Philippines

PostPosted: Tue Apr 29, 2008 9:14 pm    Post subject: Reply to: IF statements in DFSORT
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: 58
Location: Makati City, Philippines

PostPosted: Tue Apr 29, 2008 9:16 pm    Post subject:
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 Moderator


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

PostPosted: Tue Apr 29, 2008 9:18 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am
No new posts Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us