View previous topic :: View next topic
|
Author |
Message |
alan_blore
New User
Joined: 01 Aug 2007 Posts: 50 Location: Hosur
|
|
|
|
I need to replace 'AMAP' to some othe value (say XXXX) only for records '10092200' in 17th position. I tried OUTREC with IFTHEN but was not able to run it through. Any help appreciated.
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
********************************* Top of Data *********
INVTADI6PO 103910077127 AMAP 00
INVTADI8 103910092200 AMAP 00
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Alan and welcome to the forums,
Quote: |
I tried OUTREC with IFTHEN but was not able to run it through. Any help appreciated. |
For someone to help, you need to post the jcl, sort control statements, and any diagnostic info presented by the problem run. You also need to explain if there were unexpected/incorrect results. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Alan,
I don't know what you tried, but you can use a DFSORT job like the following to do what I think you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
INVTADI6PO 103910077127 AMAP 00
INVTADI8 103910092200 AMAP 00
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(17,8,CH,EQ,C'10092200',
AND 35,4,CH,EQ,C'AMAP),
OVERLAY=(35:C'XXXX'))
/*
|
If that's not what you want, then explain more clearly what it is you do want. |
|
Back to top |
|
|
alan_blore
New User
Joined: 01 Aug 2007 Posts: 50 Location: Hosur
|
|
|
|
Thanks Frank Yaeger and Dick scherrer,
I tried using the above code and it gives me SYNTAX ERROR for IFTHEN, and from the other posts I believe I need release 1.3 in order to use IFTHEN feature.
Now is there a different of changing the record without IFTHEN.
Also there is another small change in requirement, for the below two records, I need AMAP to be changed to XXXX only if 'PO' falls in 9th position and '10092200' falls in 17th position.
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
********************************* Top of Data *********
INVTADI6PO 103910092200 AMAP 00
INVTADI6 103910092200 AMAP 00 |
I believe I should run 3 sorts, first to split the files with records to change in one file, change it in that file and again merge it with the other file. But I fear the order of records might be changed.
The JCL I used :
Code: |
//ISS064JB JOB (1TOS0160),'0001 TSG SORT',
// REGION=6M,MSGLEVEL=(1,1),
// CLASS=B,MSGCLASS=X,NOTIFY=ISS064
//*
//J010 EXEC PGM=SORT
//*SORTIN DD DSN=W.USD.ARP465.ARRCHK2.S03,DISP=SHR
//SORTIN DD DSN=TEST.FLATFILE.FOR.SORT,DISP=SHR
//*SORTOUT DD DSN=ISS064.W.USD.ARP465.ARRCHK2.S03.NEW,
//SORTOUT DD DSN=TEST.FLATFILE.AFTER.SORTZ,
// DISP=(,CATLG,DELETE),UNIT=WORK,
// SPACE=(CYL,(50,50),RLSE),DCB=*.SORTIN
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC IFTHEN=(WHEN=(17,8,CH,EQ,C'10092200'),
BUILD=(1,34,C'XXXX',39,95))
/* |
(Here I dint check for the other condition too.
Please let me know if you can provide any ideas here which will be compatible.
Thanks for your help! |
|
Back to top |
|
|
alan_blore
New User
Joined: 01 Aug 2007 Posts: 50 Location: Hosur
|
|
|
|
Typo:
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+
********************************* Top of Data ********
INVTADI6PO 103910092200 AMAP 00
INVTADI6 103910092200 AMAP 00 |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
As requested before - post the diagnostic info.
When you mention 1.3, that sounds more like Syncsort. . . |
|
Back to top |
|
|
alan_blore
New User
Joined: 01 Aug 2007 Posts: 50 Location: Hosur
|
|
|
|
Code: |
********************************* TOP OF DATA **************
SYNCSORT FOR Z/OS 1.1BR TPF3 U.S. PATENTS: xx,y (C) 2002 SYNC
SERVICE DELIVERY - AAAA z/OS 1.6.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER GGG, MODEL 2086 150 LICEN
SYSIN :
SORT FIELDS=COPY
OUTREC FIELDS=(35,4,CHANGE=(4,'AMAP','G81A'),NOMATCH=(35,4))
*
WER268A OUTREC STATEMENT : SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
******************************** BOTTOM OF DATA ************* |
[/code] |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Instead of:
Code: |
CHANGE=(4,'AMAP','G81A'), |
try:
Code: |
CHANGE=(4,C'AMAP',C'G81A'), |
Sorry i can't test this just now, but i believe this will resolve the syntax error. . . |
|
Back to top |
|
|
alan_blore
New User
Joined: 01 Aug 2007 Posts: 50 Location: Hosur
|
|
|
|
Thanks for the help.
Actaully I had got the same for IFTHEN, (Yesterday I had given the other)
Code: |
********************************* TOP OF DATA **************
SYNCSORT FOR Z/OS 1.1BR TPF3 U.S. PATENTS: xx,y (C) 2002 SYNC
SERVICE DELIVERY - AAAA z/OS 1.6.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER GGG, MODEL 2086 150 LICEN
SYSIN :
OPTION COPY
OUTREC IFTHEN=(WHEN=(17,8,CH,EQ,C'10092200'),
*
BUILD=(1,34,C'AMAP',38,296))
WER268A OUTREC STATEMENT : SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
******************************** BOTTOM OF DATA ************* |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You are confused. . . This is not the same error.
I believe this problem is due to unbalanced parentheses - you have 2 "open"s but 3 "close"s. |
|
Back to top |
|
|
Gousiya Mulla
New User
Joined: 02 Jun 2008 Posts: 87 Location: Bangalore
|
|
|
|
Hi Alan ,
Donno where your getting stucked ..
I have checked for one of you condition (not with PO) and the JCL is the same which you have used , and it gives me the same output what your expecting . C the below code and output .
I am not able to copy the image here .. so attaching .. let me know if it works for you .
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I am not able to copy the image here |
Rather than trying to post the image, it works better if you copy/paste the screen content into your reply and then use the "Code" tag to preserve alignment.
Please refer to some of the earlier replies in this topic to see how that works. Attachments can cause problems because several of the people who provide help here are prohibited from downloading attachments by their site admin policies.
Keep in mind that when you want to post come code/jcl/etc, you can use the "Preview" to see how your reply will appear to the forum (rather than the way it looks in the Reply editor). Once you are satisified with the appearance of your post, then clidk Submit. |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
alan_blore wrote: |
I tried using the above code and it gives me SYNTAX ERROR for IFTHEN, and from the other posts I believe I need release 1.3 in order to use IFTHEN feature. |
Just to clarify, IFTHEN, BUILD, and OVERLAY are supported in SyncSort for z/OS 1.2.1.0 and later. |
|
Back to top |
|
|
alan_blore
New User
Joined: 01 Aug 2007 Posts: 50 Location: Hosur
|
|
|
|
Thanks a Lot... |
|
Back to top |
|
|
|