IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Apend a character in a empty line in the input file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Niki

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Wed Mar 11, 2009 7:21 pm
Reply with quote

Hi all,

If my input is like below, lrecl = 80

Code:

----+----1----+----2----+----3----+----4----+----
Header;sdsad;dasda;sdaasd
001;1254;lklk;12222
121554;15454;dfgdg 


I am Using a sort like this,

Code:

SORT FIELDS=COPY                           
  OUTREC IFTHEN=(WHEN=(1,6,CH,EQ,C'Header'),
   BUILD=(1:C'Z;',3:1,80)),               
           IFTHEN=(WHEN=NONE,                 
   BUILD=(1:C'X;',3:1,80))               


So my out put comes as
Code:

----+----1----+----2----+----3----+----4----+----
Z;Header;sdsad;dasda;sdaasd
X;001;1254;lklk;12222
X;121554;15454;dfgdg


But when there is a empty line in the input file i need to apend with character "B;" .
Code:

----+----1----+----2----+----3----+----4----+----
Header;sdsad;dasda;sdaasd
001;1254;lklk;12222

121554;15454;dfgdg

I tried with the following code .

Code:

SORT FIELDS=COPY                           
  OUTREC IFTHEN=(WHEN=(1,6,CH,EQ,C'Header'),
   BUILD=(1:C'Z;',3:1,80)),               
      IFTHEN=(WHEN=(1,50,CH,EQ,C'50X'),
   BUILD=(1:C'B;',3:1,80)),                 
      IFTHEN=(WHEN=NONE,                 
   BUILD=(1:C'X;',3:1,80))               


But here the enmpty line has been apending with "X;" instead of "B;"
So the O?p comes like below,
Code:

----+----1----+----2----+----3----+----4----+----
Z;Header;sdsad;dasda;sdaasd
X;
X;001;1254;lklk;12222
X;121554;15454;dfgdg

But i need it as
Code:

----+----1----+----2----+----3----+----4----+----
Z;Header;sdsad;dasda;sdaasd
B;
X;001;1254;lklk;12222
X;121554;15454;dfgdg


Can anyone help me to achieve this .
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Mar 11, 2009 7:41 pm
Reply with quote

Quote:
Code:
SORT FIELDS=COPY                           
  OUTREC IFTHEN=(WHEN=(1,6,CH,EQ,C'Header'),
   BUILD=(1:C'Z;',3:1,80)),               
      IFTHEN=(WHEN=(1,50,CH,EQ,C'50X'),
   BUILD=(1:C'B;',3:1,80)),                 
      IFTHEN=(WHEN=NONE,                 
   BUILD=(1:C'X;',3:1,80))               
Since you are not expecting a 50 byte field that contains "50X" followed by 47 blanks, wouldn't something like:
Code:
SORT FIELDS=COPY                           
  OUTREC IFTHEN=(WHEN=(1,6,CH,EQ,C'Header'),
   BUILD=(1:C'Z;',3:1,80)),               
      IFTHEN=(WHEN=(1,50,CH,EQ,50X'40'),
   BUILD=(1:C'B;',3:1,80)),                 
      IFTHEN=(WHEN=NONE,                 
   BUILD=(1:C'X;',3:1,80))               
work better?
Or maybe just 50X?
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Wed Mar 11, 2009 7:53 pm
Reply with quote

Hi,

Thanks for the reeply .


I tried by giving ,
Code:

SORT FIELDS=COPY                           
  OUTREC IFTHEN=(WHEN=(1,6,CH,EQ,C'Header'),
   BUILD=(1:C'Z;',3:1,80)),               
      IFTHEN=(WHEN=(1,50,CH,EQ,'50X'),
   BUILD=(1:C'B;',3:1,80)),                 
      IFTHEN=(WHEN=NONE,                 
   BUILD=(1:C'X;',3:1,80))     


and
Code:

SORT FIELDS=COPY                           
  OUTREC IFTHEN=(WHEN=(1,6,CH,EQ,C'Header'),
   BUILD=(1:C'Z;',3:1,80)),               
      IFTHEN=(WHEN=(1,50,CH,EQ,'50X'),
   BUILD=(1:C'B;',3:1,80)),                 
      IFTHEN=(WHEN=NONE,                 
   BUILD=(1:C'X;',3:1,80))     

and


Code:

SORT FIELDS=COPY                           
  OUTREC IFTHEN=(WHEN=(1,6,CH,EQ,C'Header'),
   BUILD=(1:C'Z;',3:1,80)),               
      IFTHEN=(WHEN=(1,50,CH,EQ,50X'40'),
   BUILD=(1:C'B;',3:1,80)),                 
      IFTHEN=(WHEN=NONE,                 
   BUILD=(1:C'X;',3:1,80))     


But the job was abending and the error message is as below,

Code:

 WER268A  OUTREC STATEMENT  : SYNTAX ERROR     
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Mar 11, 2009 7:59 pm
Reply with quote

Please post the entire sysout for the last example.......
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Wed Mar 11, 2009 8:18 pm
Reply with quote

Code:

SYNCSORT FOR Z/OS  1.3.1.0N    U.S. PATENTS: 4210961, 5117495   (C) 2007 SYNCSO
                             022309: SYNCSORT Z/OS 1.3.1.0 + SY67000       z/OS
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 3E14C, MODEL 2094 708             LICEN
SYSIN :                                                                       
   SORT FIELDS=COPY                                                     0013002
     OUTREC IFTHEN=(WHEN=(1,6,CH,EQ,C'Header'),        0014002
     
BUILD=(1:C'Z;',3:1,80)),               
      IFTHEN=(WHEN=(1,50,CH,EQ,'50X'),
   BUILD=(1:C'B;',3:1,80)),                 
      IFTHEN=(WHEN=NONE,                 
   BUILD=(1:C'X;',3:1,80))

WER268A  OUTREC STATEMENT  : SYNTAX ERROR                                     
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                 
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Mar 11, 2009 8:26 pm
Reply with quote

SyncSort for z/OS 1.3 Programmer’s Guide
Chapter 15. Messages wrote:
WER268A statement STATEMENT: SYNTAX ERROR
EXPLANATION: A SyncSort control statement, as indicated in the message text, contains a syntax error. The next line will contain an '*' indicating the approximate location of the syntax error.
No line with an '*'?
Does that first BUILD really start in cc1?
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Wed Mar 11, 2009 8:50 pm
Reply with quote

Code:

BUILD=(1:C'Z;',3:1,80)),               
      IFTHEN=(WHEN=(1,50,CH,EQ,'50X'),
                                 *       
   BUILD=(1:C'B;',3:1,80)),                 
      IFTHEN=(WHEN=NONE,                 
   BUILD=(1:C'X;',3:1,80))


Before submitting if i do a JCL SCAn, Then i got the following error,

DSS10080E VALUE ''50X'' SHOULD HAVE BEEN INIT, ANY, NONE, OR ANYthing
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Mar 11, 2009 8:55 pm
Reply with quote

Code:
SORT FIELDS=COPY                           
  OUTREC IFTHEN=(WHEN=(1,6,CH,EQ,C'Header'),
   BUILD=(1:C'Z;',3:1,80)),               
      IFTHEN=(WHEN=(1,50,CH,EQ,50X'40'),
   BUILD=(1:C'B;',3:1,80)),                 
      IFTHEN=(WHEN=NONE,                 
   BUILD=(1:C'X;',3:1,80))     


Should it not be
Code:

SORT FIELDS=COPY                           
  OUTREC IFTHEN=(WHEN=(1,6,CH,EQ,C'Header'),
   BUILD=(1:C'Z;',3:1,80)),               
      IFTHEN=(WHEN=(1,50,CH,EQ,' '),
   BUILD=(1:C'B;',3:1,80)),                 
      IFTHEN=(WHEN=NONE,                 
   BUILD=(1:C'X;',3:1,80))     
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Wed Mar 11, 2009 8:58 pm
Reply with quote

Hi Expat,

Its working Fine.

Thanks for the help.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Mar 11, 2009 9:00 pm
Reply with quote

FWIW....
Ezhil Murugan wrote:
I got that error message when I did a job scan. But the job went fine when I submitted it. Not sure why it is so..
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Mar 11, 2009 10:06 pm
Reply with quote

Hello,

Quote:
Before submitting if i do a JCL SCAn, Then i got the following error,

DSS10080E VALUE ''50X'' SHOULD HAVE BEEN INIT, ANY, NONE, OR ANYthing
This jcl scan product is quite well known for not being current with the sort products. As the sort products (Syncsort/DFSORT/CA-Sort) are enhanced (usually in different directions), the jcl scan flags more and more good syntax as an error.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top