Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Issue with variable length fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
manuwankenobi

New User


Joined: 02 Mar 2006
Posts: 32
Location: FRANCE

PostPosted: Thu Feb 07, 2013 4:05 pm    Post subject: Issue with variable length fields
Reply with quote

Hello,

I know that many questions have been asked about variables length fields in this forum, but I didn't find (or understand) the answer to my problem.

I want to change some records in some JCL.

I have a flat file, which is FBA LRECL 81.

Snipet in ISPF VIEW:
Code:
V//FSI21B50 EXEC DSNUPROC,PARM='%SYSTDB2.,FSI21B5'                     
-  -  -  -  -  -  -  -  -  -  -  -  -  -  -   171 Line(s) not Displayed
V//FSI21301 EXEC DSNUPROC,PARM='%SYSTDB2.,FSI21301',COND=(4,LT)         
-  -  -  -  -  -  -  -  -  -  -  -  -  -  -   106 Line(s) not Displayed
V//FSI21351 EXEC DSNUPROC,PARM='%SYSTDB2.,FSI21351',COND=(4,LT)         
-  -  -  -  -  -  -  -  -  -  -  -  -  -  -   122 Line(s) not Displayed
V//FSI21401 EXEC DSNUPROC,PARM='%SYSTDB2.,FSI21401',COND=(4,LT)         
-  -  -  -  -  -  -  -  -  -  -  -  -  -  -   124 Line(s) not Displayed
V//FSI21451 EXEC DSNUPROC,PARM='%SYSTDB2.,FSI21451',COND=(4,LT)         


I want to replace for example :
Code:
V//FSI21B50 EXEC DSNUPROC,PARM='%SYSTDB2.,FSI21B5' 
V//FSI21301 EXEC DSNUPROC,PARM='%SYSTDB2.,FSI21301',COND=(4,LT)

by
Code:
V//FSI21B50 EXEC DSNUPROC,SYSTEM=%SYSTDB2.,UID=FSI21B5 
V//FSI21301 EXEC DSNUPROC,SYSTEM=%SYSTDB2.,UID=FSI21301,COND=(4,LT)

I tried this with ICETOOL :
Code:
//TOOLIN   DD *                                           
  COPY FROM(IN)   TO(TMP1) USING(CPY1)                     
//CPY1CNTL DD *                                           
  INCLUDE COND=(1,80,SS,EQ,C'EXEC DSNUPROC')               
  INREC IFTHEN=(WHEN=(1,80,SS,EQ,C'EXEC DSNUPROC'),       
    PARSE=(%00=(ABSPOS=1,ENDBEFR=C',',FIXLEN=40),         
           %01=(STARTAFT=X'7D',ENDBEFR=C',',FIXLEN=40),   
           %02=(ENDBEFR=X'7D',FIXLEN=40),                 
           %03=(ENDAT=BLANKS,FIXLEN=40)),                 
    BUILD=(%00,SQZ=(SHIFT=LEFT,MID=C' ',TRAIL=C',SYSTEM='),
           %01,SQZ=(SHIFT=LEFT,MID=C' ',TRAIL=C',UID='),   
           %02,SQZ=(SHIFT=LEFT,MID=C' '),                 
           %03))                                           

But extra space is always between my parsed fileds :
Code:
EDIT       A500SS.JOB18424.TMP1                            Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----
000116 V//FSI21B50 EXEC DSNUPROC,SYSTEM=       %SYSTDB2.,UID=                          FSI21B5   
000117 V//FSI21301 EXEC DSNUPROC,SYSTEM=       %SYSTDB2.,UID=                          FSI21301                                ,COND=(4,LT)


Some help would be great !

Thank you.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Thu Feb 07, 2013 4:32 pm    Post subject: Reply to: Issue with variable length fields
Reply with quote

Well, did you try SQZ on the whole record? PARSE fields are always a fixed length, you have got the data squeezed to the left, but will always have trailing blanks.
Back to top
View user's profile Send private message
manuwankenobi

New User


Joined: 02 Mar 2006
Posts: 32
Location: FRANCE

PostPosted: Thu Feb 07, 2013 6:09 pm    Post subject:
Reply with quote

Thank you for reading.

Yes I tried to add
Code:
OUTREC BUILD=(1,160,SQZ=(SHIFT=LEFT,MID=C' '))

But it remains two extra blanks (after SYSTEM= and UID=)
Code:
EDIT       A500SS.JOB18499.TMP1                            Columns 00001 00072
Command ===>                                                  Scroll ===> CSR
000116 V//FSI21B50 EXEC DSNUPROC,SYSTEM= %SYSTDB2.,UID= FSI21B5               
000117 V//FSI21301 EXEC DSNUPROC,SYSTEM= %SYSTDB2.,UID= FSI21301 ,COND=(4,LT)

If I try to add
Code:
OUTREC BUILD=(1,160,SQZ=(SHIFT=LEFT))

I'm missing important blanks !
Code:
EDIT       A500SS.JOB18504.TMP1                            Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
000116 V//FSI21B50EXECDSNUPROC,SYSTEM=%SYSTDB2.,UID=FSI21B5                   
000117 V//FSI21301EXECDSNUPROC,SYSTEM=%SYSTDB2.,UID=FSI21301,COND=(4,LT)       


Thank you.
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Thu Feb 07, 2013 8:39 pm    Post subject: Reply to: Issue with variable length fields
Reply with quote

Hi manuwankenobi,

I added "OUTREC FIELDS=(IN=C' ',OUT=C'',STARTPOS=34) " to your code and got the output...

Code:

//*                                                                     
//S05S EXEC PGM=ICETOOL                                                 
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//TOOLMSG DD SYSOUT=*                                                   
//DFSMSG  DD SYSOUT=*                                                   
//IN DD *                                                               
V//FSI21B50 EXEC DSNUPROC,PARM='%SYSTDB2.,FSI21B5'                     
V//FSI21301 EXEC DSNUPROC,PARM='%SYSTDB2.,FSI21301',COND=(4,LT)         
//TMP1 DD SYSOUT=*                                                     
//TOOLIN   DD *                                                         
    COPY FROM(IN)   TO(TMP1) USING(CPY1)                               
//CPY1CNTL DD *                                                         
    INCLUDE COND=(1,80,SS,EQ,C'EXEC DSNUPROC')                         
    INREC IFTHEN=(WHEN=(1,80,SS,EQ,C'EXEC DSNUPROC'),                   
      PARSE=(%00=(ABSPOS=1,ENDBEFR=C',',FIXLEN=40),                     
             %01=(STARTAFT=X'7D',ENDBEFR=C',',FIXLEN=40),               
             %02=(ENDBEFR=X'7D',FIXLEN=40),                             
             %03=(ENDAT=BLANKS,FIXLEN=40)),                             
      BUILD=(%00,SQZ=(SHIFT=LEFT,MID=C' ',TRAIL=C',SYSTEM='),           
             %01,SQZ=(SHIFT=LEFT,MID=C' ',TRAIL=C',UID='),             
             %02,SQZ=(SHIFT=LEFT,MID=C' '),                             
             %03))                                                     
    OUTREC FIELDS=(IN=C' ',OUT=C'',STARTPOS=34)                         


Output:-

Code:

V//FSI21B50 EXEC DSNUPROC,SYSTEM=%SYSTDB2.,UID=FSI21B5                   
V//FSI21301 EXEC DSNUPROC,SYSTEM=%SYSTDB2.,UID=FSI21301,COND=(4,LT)       


Thanks,
-3nadh
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Fri Feb 08, 2013 5:54 am    Post subject: Reply to: Issue with variable length fields
Reply with quote

Sorry for the wrong syntax in my previous post. It should be

Code:

OUTREC FINDREP=(IN=C' ',OUT=C'',STARTPOS=34)     


Thanks
-3nadh
Back to top
View user's profile Send private message
manuwankenobi

New User


Joined: 02 Mar 2006
Posts: 32
Location: FRANCE

PostPosted: Fri Feb 08, 2013 4:34 pm    Post subject:
Reply with quote

Hello,

With your help the job is now OK.

Thank you Bill, thnak you bodatrinadh.

Bye !
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Sat Feb 09, 2013 2:31 am    Post subject: Reply to: Issue with variable length fields
Reply with quote

Unless I am missing something here , isn't it easy with 2 FINDREP statements? get rid of the quote in first findrep and then use another findrep to replace PARM=%SYSTDB2., with SYSTEM=%SYSTDB2.,UID=
Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                                 
V//FSI21B50 EXEC DSNUPROC,PARM='%SYSTDB2.,FSI21B5'             
V//FSI21301 EXEC DSNUPROC,PARM='%SYSTDB2.,FSI21301',COND=(4,LT)
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  OPTION COPY                                                   
  INREC FINDREP=(IN=C'''',OUT=C'')                             
  OUTREC FINDREP=(IN=C'PARM=%SYSTDB2.,',                       
                 OUT=C'SYSTEM=%SYSTDB2.,UID=')                 
//*
Back to top
View user's profile Send private message
manuwankenobi

New User


Joined: 02 Mar 2006
Posts: 32
Location: FRANCE

PostPosted: Sat Feb 09, 2013 11:39 am    Post subject:
Reply with quote

Hello Skolusu,

I don't think so, because it is not always "%systdb2" that is in the file, it could be "blahblah" !
I think I really need to get variable length fields.

Thank you.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts DFHRESPONSE returns issue divated CICS 3 Wed Nov 02, 2016 6:32 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us