View previous topic :: View next topic
|
Author |
Message |
sprikitik
New User
Joined: 29 Jan 2007 Posts: 61 Location: Makati City, Philippines
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
sprikitik
New User
Joined: 29 Jan 2007 Posts: 61 Location: Makati City, Philippines
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
sprikitik
New User
Joined: 29 Jan 2007 Posts: 61 Location: Makati City, Philippines
|
|
|
|
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 |
|
|
sprikitik
New User
Joined: 29 Jan 2007 Posts: 61 Location: Makati City, Philippines
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|