I have two requirements which I need to achieve using sort.
First:
There is a file FileA (FB, Lrecl=290). In this file we get some unreadable/junk values which I need to convert to spaces. this I have done using ALTSEQ command in sort. The sort card for which is as follows
Second:
I need to compare FileA and FileB on a Field1 (position 1, length 5, Packed decimal) and if match is found then move 'Y' to Field2 of FileA (position 6, length 1, char) or else move 'N'. I am trying to figure out the sort for this. But is it possible to combine the above two sorts in one go. If so then please let me know.
Following will make it more clear.
FileA
Code:
FIELD1 FIELD2
5/PS 1/AN
(1-5) (6-6)
1---------- 2-----
****** ******************
000001 2 A
000002 11 X
000003 31 B
000004 46 F
000005 61 R
000006 90 T
000007 107 G
FIELD1 FIELD2
5/PS 1/AN
(1-5) (6-6)
1---------- 2-----
****** ******************
000001 2 Y
000002 11 Y
000003 31 N
000004 46 N
000005 61 Y
000006 90 N
000007 107 N
Thanks a lot. The solution works fine.
I tried using sort in place of icetool (since my existing production job contains sort). There seemed to be a problem.
While using sort will all the existinf syntax remamin same or there will be a change.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
PGM=SORT is NOT the same as PGM=ICETOOL! You can't use them interchangeably. You must use PGM=ICETOOL for this job.
PGM=SORT invokes DFSORT. PGM=ICETOOL invokes DFSORT's ICETOOL. DFSORT and ICETOOL require different JCL and syntax.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
I had changed the basic syntax between SORT and ICETOOL. The job was also modified and I am trying to change the solution so that I can use it with sort rather than with ICETOOL. My main reason to combine both is because currently we are using SORT in production and using ICETOOL will require changes in JCL and Proc as well. So to avois this I am trying to combine the new requirement with old sort in production.
Therefore I am looking for some solution in SORT .
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
muffirulz,
If you create the 2 files with equals lengths you can get the desired results with just 1 sort step. However create the look up file with a string that is unique to the look up file. Here I used '$' symbol. So if you create the look up file with something like that then we can get the desired results in one step.
When trying to execute the above I am getting the following error.
Code:
ICE143I 0 BLOCKSET SORT TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 14:50 ON MON AUG
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
muffirulz,
You are concatenating a 80 byte in stream data with a 290 byte dataset which is NOT valid and hence the error. You need to create the header record separately for 290 bytes.
Use the following JCL. step0100 will create a hdr record with 290 bytes and we will concatenate that in the next step.