Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Apend a character in a empty line in the input file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Wed Mar 11, 2009 7:21 pm    Post subject: Apend a character in a empty line in the input file
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: 2150
Location: At my coffee table

PostPosted: Wed Mar 11, 2009 7:41 pm    Post subject:
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: 102
Location: Bangalore

PostPosted: Wed Mar 11, 2009 7:53 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Wed Mar 11, 2009 7:59 pm    Post subject:
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: 102
Location: Bangalore

PostPosted: Wed Mar 11, 2009 8:18 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Wed Mar 11, 2009 8:26 pm    Post subject:
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: 102
Location: Bangalore

PostPosted: Wed Mar 11, 2009 8:50 pm    Post subject:
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: 8619
Location: Back in jolly old England

PostPosted: Wed Mar 11, 2009 8:55 pm    Post subject:
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: 102
Location: Bangalore

PostPosted: Wed Mar 11, 2009 8:58 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Wed Mar 11, 2009 9:00 pm    Post subject:
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

Site Director


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

PostPosted: Wed Mar 11, 2009 10:06 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us