MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Writing 1 Output based on 2 conditions in Input file.
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
nimb
Beginner


Joined: 01 Feb 2007
Posts: 8
Topics: 1

PostPosted: Wed Jun 06, 2007 2:01 pm    Post subject: Writing 1 Output based on 2 conditions in Input file. Reply with quote

I have a fixed length Input file. This is current sort card:
Code:

INCLUDE COND=(64,1,CH,EQ,C'1',AND,   
                          261,1,CH,NE,C' ')       
OUTREC FIELDS=(1:9X,[b]10:261[/b],18,28:18X,46:82,15, 
                71:97,12,96:199X,295:64,1,296:3X)

I want to modify this for following conditions.
1) If (64,1,CH,EQ,C'1',AND,261,1,CH,NE,C' ') , write O/P as per Outrec.
2) If (64,1,CH,EQ,C'1',AND,261,1,CH,EQ,C' '), write O/P as
=(1:9X,10:41,18,28:18X,46:82,15, 71:97,12,96:199X,295:64,1,296:3X).

I need only one Output file.
Can we do this using Sort/Icetool in one step.
I tried searching similar posts, but I was not able to conclude.
Thanks for your help.

Regards,
Tushar
Back to top
View user's profile Send private message
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Wed Jun 06, 2007 2:12 pm    Post subject: Reply with quote

You should be able to use IFTHEN in the OUTFIL and do what you want.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Jun 06, 2007 2:16 pm    Post subject: Reply with quote

nimb,

Try these untested control cards

Code:

//SYSIN    DD *                           
 SORT FIELDS=COPY                         
 INCLUDE COND=(64,1,CH,EQ,C'1')           
 OUTREC IFTHEN=(WHEN=(261,1,CH,EQ,C' '), 
         BUILD=(001:09X,                 
                010:41,18,               
                028:18X,                 
                046:82,15,               
                071:97,12,               
                096:199X,                 
                295:64,1,                 
                296:3X)),                 
        IFTHEN=(WHEN=NONE,               
         BUILD=(001:09X,                 
                010:261,18,               
                028:18X,                 
                046:82,15,               
                071:97,12,               
                096:199X,                 
                295:64,1,                 
                296:3X))                 


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nimb
Beginner


Joined: 01 Feb 2007
Posts: 8
Topics: 1

PostPosted: Thu Jun 07, 2007 1:32 pm    Post subject: Reply with quote

Thank you Kolusu. Unfortunately, this is not working in our shop. I think this one needs DFSORT.
We have SYNCSORT and ICETOOL. Can we do this using either of them?

Regards.
Back to top
View user's profile Send private message
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Thu Jun 07, 2007 1:42 pm    Post subject: Reply with quote

nimb wrote:
Unfortunately, this is not working in our shop. I think this one needs DFSORT.
We have SYNCSORT and ICETOOL. Can we do this using either of them?
Syncsort has IFTHEN and BUILD, what release of Syncsort are you at and what are the error messages?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Jun 07, 2007 1:44 pm    Post subject: Reply with quote

nimb,

Post the sysout error messages which will let us know the version of syncsort you have.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nimb
Beginner


Joined: 01 Feb 2007
Posts: 8
Topics: 1

PostPosted: Thu Jun 07, 2007 1:51 pm    Post subject: Reply with quote

Kolusu,

I want to do this using ICETOOL. I am getting following messages:
Code:

SYT000I  SYNCTOOL RELEASE 1.4D - COPYRIGHT 2003  SYNCSORT INC.
SYT001I  INITIAL PROCESSING MODE IS "STOP"
SYT002I  "TOOLIN" INTERFACE BEING USED

         **** COPY MEMBER REFERENCE FILE TO T4
          COPY FROM(XREF) TO(T4)
SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0001"
SYT030I  OPERATION COMPLETED WITH RETURN CODE 0

         **** COPY FINAL NCI FILE TO T4
          COPY FROM(MEMIN) TO(T4) USING(CTL1)
SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0002"
======================================
OUTREC IFTHEN = (WHEN=(261,1,CH,NE,C' '),
       *
        BUILD=(1:9X,10:261,18,28:18X,46:82,15,
        *
                71:97,12,96:199X,295:64,1,296:3X)),
                *
======================================
WER428I  CALLER-PROVIDED IDENTIFIER IS "0002"
WER268A  OUTREC STATEMENT  : SYNTAX ERROR
WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000

Thanks for your help.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Jun 07, 2007 2:04 pm    Post subject: Reply with quote

Quote:

I want to do this using ICETOOL. I am getting following messages:


nimb,

You need to get your facts right. Your shop has syncsort and You doNOT have ICETOOL. Icetool is a part of DFSORT. Check these links which will explain the difference

http://www.mvsforums.com/helpboards/viewtopic.php?t=2275&highlight=icetool+synctool

http://www.mvsforums.com/helpboards/viewtopic.php?t=1530&highlight=icetool+synctool

http://www.mvsforums.com/helpboards/viewtopic.php?t=2504&highlight=icetool+synctool

I need to see the DFSMSG sysout for the version of syncsort.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nimb
Beginner


Joined: 01 Feb 2007
Posts: 8
Topics: 1

PostPosted: Thu Jun 07, 2007 2:22 pm    Post subject: Reply with quote

Kolusu,
I am sorry for the trouble but I thought I was using ICETOOL because I am using PGM=ICETOOL in my JCL.
Here is the JCL.
Code:

//STEP0510  EXEC,PGM=ICETOOL,
//MEMIN     DD DSN=TEST.APM.FINAL.MBR,DISP=SHR
//XREF      DD DSN=TEST.APM.MBR.XREF,DISP=SHR
//T4        DD DSN=&&T4,DISP=(MOD,PASS),SPACE=(CYL,(300,300)),
//             UNIT=SYSDA
//TOOLMSG   DD SYSOUT=*
//DFSMSG    DD SYSOUT=*
//TOOLIN    DD DSN=TEST.CTLSTLIB(CTLJOB7),DISP=SHR
//CTL1CNTL  DD DSN=TEST.CTLSTLIB(CTLJOB8),DISP=SHR

Here is the DFMSG sysout.
Code:

1 SYNCSORT FOR Z/OS  1.1DRI  TPF3A  U.S. PATENTS: 4210961, 5117495  (C) 2002 SYNCSORT INC.  DATE=2007/158  TIME=14.08.53
                                      PRODUCT LICENSED FOR CPU SERIAL NUMBER 13F4C, MODEL 2086 460              LICENSE/PRODUCT EXPIRATION DATE: 18 JUN 2007
  PARMLIST :
  OPTION RESINV=0,ARESINV=0,MSGDDN=DFSMSG,SORTIN=XREF,SORTOUT=T4,COPY
  WER428I  CALLER-PROVIDED IDENTIFIER IS "0001"
  WER108I  XREF     :  RECFM=FB   ; LRECL=   298; BLKSIZE= 27714
  WER110I  T4       :  RECFM=FB   ; LRECL=   298; BLKSIZE= 27714
  WER054I  RCD IN          0, OUT          0
  WER169I  RELEASE 1.1D BATCH 0426 TPF LEVEL 3A
  WER052I  END SYNCSORT - UID,STEP0510,,DIAG=8200,510C,AAB5,E0F7,CB4A,6C83,AAA8,CE60
1 SYNCSORT FOR Z/OS  1.1DRI  TPF3A  U.S. PATENTS: 4210961, 5117495  (C) 2002 SYNCSORT INC.  DATE=2007/158  TIME=14.08.53
                                       PRODUCT LICENSED FOR CPU SERIAL NUMBER 13F4C, MODEL 2086 460              LICENSE/PRODUCT EXPIRATION DATE: 18 JUN 2007
  CTL1CNTL :
   INCLUDE COND=(64,1,CH,EQ,C'1')
   OUTREC IFTHEN = (WHEN=(261,1,CH,NE,C' '),
          *
           BUILD=(1:9X,10:261,18,28:18X,46:82,15,
           *
                   71:97,12,96:199X,295:64,1,296:3X)),
                   *
          IFTHEN = (WHEN=(261,1,CH,EQ,C' '),
          *
           BUILD=(1:9X,10:41,18,28:18X,46:82,15,
           *
                   71:97,12,96:199X,295:64,1,296:3X))
                   *
  WER428I  CALLER-PROVIDED IDENTIFIER IS "0002"
  WER268A  OUTREC STATEMENT  : SYNTAX ERROR
  WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT
  WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT
  WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT
  WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT
  WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT
  WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000

Thank You again for your patience and help.
Back to top
View user's profile Send private message
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Thu Jun 07, 2007 2:30 pm    Post subject: Reply with quote

Quote:

SYNCSORT FOR Z/OS 1.1

Nope, can't use them......
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Jun 07, 2007 2:36 pm    Post subject: Reply with quote

nimb,

try this

Code:

//CTL1CNTL   DD *                                   
 OUTREC FIELDS=(001:09X,                         
                010:261,1,CHANGE=(18,C' ',41,18),
                          NOMATCH=(261,18),       
                028:18X,                         
                046:82,15,                       
                071:97,12,                       
                096:199X,                         
                295:64,1,                         
                296:3X)                           
/*


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Thu Jun 07, 2007 2:46 pm    Post subject: Re: Writing 1 Output based on 2 conditions in Input file. Reply with quote

nimb wrote:
I want to modify this for following conditions.
1) If (64,1,CH,EQ,C'1',AND,261,1,CH,NE,C' ') , write O/P as per Outrec.
2) If (64,1,CH,EQ,C'1',AND,261,1,CH,EQ,C' '), write O/P as
=(1:9X,10:41,18,28:18X,46:82,15, 71:97,12,96:199X,295:64,1,296:3X).
Just wondering, what would you want to do with records that 64,1 is not a C'1'?
Quote:
I need only one Output file.
Can we do this using Sort/Icetool in one step.
I can't think of any one step to do this (other than a program), what's wrong with two steps?
You know, the manual dosn't explicitly say that the fileids on multiple outfils must be unique....Maybe that would work, want to give it a try?
Back to top
View user's profile Send private message
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Thu Jun 07, 2007 2:51 pm    Post subject: Reply with quote

Quote:

SYNCSORT FOR Z/OS 1.1DRI TPF3A

Quote:

OUTREC IFTHEN = (WHEN=(261,1,CH,NE,C' '),
*
BUILD=(1:9X,10:261,18,28:18X,46:82,15,
*
71:97,12,96:199X,295:64,1,296:3X)),
*
======================================
WER428I CALLER-PROVIDED IDENTIFIER IS "0002"
WER268A OUTREC STATEMENT : SYNTAX ERROR

Nimb,

IFTHEN and BUILD were introduced in SyncSort for z/OS 1.2.2. If you have a SyncSort Online Support Account, then you can download the new release for free. If you do not already have an online account, but would like to request one, please contact SyncSort Product Services at 201-930-8260 or email zos_tech@syncsort.com.

Regards,
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Jun 07, 2007 2:51 pm    Post subject: Reply with quote

Quote:

Just wondering, what would you want to do with records that 64,1 is not a C'1'?


1. I am guessing that he is interested in only picking the records with '1' in 64th position

Quote:

I can't think of any one step to do this (other than a program), what's wrong with two steps?


It is actually quite simple. All he do want to do is

1. pick all the records with '1' at pos 64
2. For the picked records from condition 1 he wants to populate one of the output field from 2 fields.

If the contents at 261 for 1 byte is a space he wants the contents from pos 41 for 18 bytes from the input file to the output file at pos 10

If the contents at 261 for 1 byte is NOT a space he wants the contents from pos 261 for 18 bytes as is from the input file to the output file at pos 10

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nimb
Beginner


Joined: 01 Feb 2007
Posts: 8
Topics: 1

PostPosted: Thu Jun 07, 2007 3:09 pm    Post subject: Reply with quote

Kolusu, This is giving a SYNTAX error as well.
Code:

1 SYNCSORT FOR Z/OS  1.1DRI  TPF3A  U.S. PATENTS: 4210961, 5117495  (C) 2002 SYNCSORT INC.  DATE=2007/158  TIME=16.01.46
                                       PRODUCT LICENSED FOR CPU SERIAL NUMBER 13F4C, MODEL 2086 460              LICENSE/PRODUCT EXPIRATION DATE: 18 JUN 2007
  PARMLIST :
  OPTION RESINV=0,ARESINV=0,MSGDDN=DFSMSG,SORTIN=XREF,SORTOUT=T4,COPY
  WER428I  CALLER-PROVIDED IDENTIFIER IS "0001"
  WER108I  XREF     :  RECFM=FB   ; LRECL=   298; BLKSIZE= 27714
  WER110I  T4       :  RECFM=FB   ; LRECL=   298; BLKSIZE= 27714
  WER054I  RCD IN          0, OUT          0
  WER169I  RELEASE 1.1D BATCH 0426 TPF LEVEL 3A
  WER052I  END SYNCSORT - UID,STEP0510,,DIAG=8800,5B06,A0BB,E8FD,C146,6CAB,A2E8,E466
1 SYNCSORT FOR Z/OS  1.1DRI  TPF3A  U.S. PATENTS: 4210961, 5117495  (C) 2002 SYNCSORT INC.  DATE=2007/158  TIME=16.01.46
                                     ASSOCIATED INSURANCE COMPANIES   z/OS   1.4.0
  PRODUCT LICENSED FOR CPU SERIAL NUMBER 13F4C, MODEL 2086 460              LICENSE/PRODUCT EXPIRATION DATE: 18 JUN 2007
  CTL1CNTL :
   INCLUDE COND=(64,1,CH,EQ,C'1')
   OUTREC FIELDS=(1:9X,10:261,1,CHANGE=(18,C' ',41,18),NOMATCH=(261,18),
                                                *
                   28:18X,46:82,15,
                   71:97,12,96:199X,295:64,1,296:3X)
  WER428I  CALLER-PROVIDED IDENTIFIER IS "0002"
  WER268A  OUTREC STATEMENT  : SYNTAX ERROR
  WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000

Please let me know if I am doing something wrong.
Thank You.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group