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
 
how to line up this format? really need your help.

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

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Mon Apr 07, 2008 11:46 am    Post subject: how to line up this format? really need your help.
Reply with quote

Hi,

I need to line up the some sysin.

The old format like this:
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
DEF GDG (NAME(P&CUST.ZK7AT.BPPART)      SCRATCH LIMIT(03))         
DEF GDG (NAME(P&CUST.ZK7AT.ORDPREAN)    SCRATCH LIMIT(03))   
DEF GDG (NAME(P&CUST.ZK7AT.OTBXREF) SCRATCH LIMIT(03))         
DEF GDG (NAME(P&CUST.BDCSTCDE)SCRATCH LIMIT(03))   
DEF GDG (NAME(P&CUST.BPPART)               SCRATCH LIMIT(03))     


The new format need to line up the SRATCH LIMIIT words from the col 49. So we would get the new format like that:

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
DEF GDG (NAME(P&CUST.ZK7AT.BPPART)   SCRATCH LIMIT(03))         
DEF GDG (NAME(P&CUST.ZK7AT.ORDPREAN) SCRATCH LIMIT(03))   
DEF GDG (NAME(P&CUST.ZK7AT.OTBXREF)  SCRATCH LIMIT(03))         
DEF GDG (NAME(P&CUST.BDCSTCDE)       SCRATCH LIMIT(03))   
DEF GDG (NAME(P&CUST.BPPART)         SCRATCH LIMIT(03))   



Anybody who know how to deal with this situation, plz kindly tell me.
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: Mon Apr 07, 2008 7:16 pm    Post subject:
Reply with quote

Have you looked at the functionality of DFSort's very powerful
PARSE
This operand allows you to extract variable position/length fields into fixed parsed fields. Parsed fields (%nn) can be used where fixed position/length fields (p,m) can be used in the BUILD (or OUTREC) or OVERLAY operands as described later in this section.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Apr 07, 2008 8:45 pm    Post subject:
Reply with quote

kennedy_zhu,

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/72)
//SORTOUT DD DSN=...  output file (FB/72)
//SYSIN    DD    *
  OPTION COPY
  INREC PARSE=(%01=(ENDAT=C')',FIXLEN=48),
     %02=(STARTAT=NONBLANK,ENDBEFR=C' ',FIXLEN=8),
     %03=(STARTAT=NONBLANK,FIXLEN=16)),
   BUILD=(%01,%02,%03)
/*
Back to top
View user's profile Send private message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Tue Apr 08, 2008 9:12 am    Post subject:
Reply with quote

Unfortunately, I got this error:
Code:
SYNCSORT FOR Z/OS  1.2.2.1R    U.S. PATENTS: 4210961, 5117495   (C) 2005 SYNCS
                                       ELECTRONIC DATA SYSTEMS   z/OS   1.7.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 31A2C, MODEL 2064 1C8              LICE
SYSIN :                                                                       
  OPTION COPY                                                                 
  INREC  PARSE=(%01=(ENDAT=C')',FIXLEN=48),                                   
             *                                                                   
                %02=(STARTAT=NONBLANK,ENDBEFR=C' ',FIXLEN=8),                 
                %03=(STARTAT=NONBLANK,FIXLEN=16)),                           
         BUILD=(%01,%02,%03)                                                 
WER268A  INREC STATEMENT   : SYNTAX ERROR                                     

I replace the key word 'INREC' with 'OUTFIL', the same result we got.

Code:
SYNCSORT FOR Z/OS  1.2.2.1R    U.S. PATENTS: 4210961, 5117495   (C) 2005 SYNCS
                                       ELECTRONIC DATA SYSTEMS   z/OS   1.7.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 31A2C, MODEL 2064 1C8              LICE
SYSIN :                                                                       
  OPTION COPY                                                                 
  OUTFIL PARSE=(%01=(ENDAT=C')',FIXLEN=48),                                   
             *                                                                   
                %02=(STARTAT=NONBLANK,ENDBEFR=C' ',FIXLEN=8),                 
                %03=(STARTAT=NONBLANK,FIXLEN=16)),                           
         BUILD=(%01,%02,%03)                                                 
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Tue Apr 08, 2008 10:31 am    Post subject:
Reply with quote

kennedy_zhu,
You are using SYNCSORT.Not the DFSORT.SYNCSORT new version is having the support of PARSE(1.3 ).Youe env is having the older version(1.2.2.1R ) which is not supporting the PARSE function.

Thanks
Krishy
Back to top
View user's profile Send private message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Tue Apr 08, 2008 10:37 am    Post subject:
Reply with quote

all right. Maybe we can use another utility to solve the trouble. I would try to write a program. Anyway, thx. : )
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Tue Apr 08, 2008 8:29 pm    Post subject:
Reply with quote

kennedy_zhu,
If you are okay with writing the Exit routines for the sort,here is the job which will solve your problem with the earlier releases of SYNCSORT.



Code:

//STEP0200 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SYSLIN   DD DSN=&S1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)       
//SYSLMOD  DD DSN=&S2,DISP=(,PASS),SPACE=(CYL,(1,1,2),RLSE)     
//SORTIN   DD *                                                 
DEF GDG (NAME(P&CUST.ZK7AT.BPPART)      SCRATCH LIMIT(03))     
DEF GDG (NAME(P&CUST.ZK7AT.ORDPREAN)    SCRATCH LIMIT(03))     
DEF GDG (NAME(P&CUST.ZK7AT.OTBXREF) SCRATCH LIMIT(03))         
DEF GDG (NAME(P&CUST.BDCSTCDE)SCRATCH LIMIT(03))               
DEF GDG (NAME(P&CUST.BPPART)               SCRATCH LIMIT(03))   
//SORTOUT  DD DSN=XXXXXXX.YY.ZZ,                               
//            DISP=(NEW,CATLG,DELETE),                         
//            UNIT=SYSDK,SPACE=(TRK,(1,1),RLSE)                 
//SYSTSPRT DD SYSOUT=*                                         
//MODLIB   DD YOUR MODLLIB DATA SET,                           
//            DISP=SHR                                         
//SYSIN DD *                                                   
  SORT FIELDS=COPY                                             
  MODS E15=(E15Z,133,MODLIB,X)                                 


You need to place the below code in the MODLIB PDS with the name E15Z.

Code:


/* REXX E15Z */                       
ADDRESS 'SYNCREXX' 'GIVE'             
LS = LENGTH(SYRECORD)                 
IF LS > 0                             
THEN DO                               
SYACTION = 'REPLACE'                 
LSB = POS(')',SYRECORD)               
LSS = POS('SCRATC',SYRECORD)         
LSN1 = SUBSTR(SYRECORD,1,LSB)         
LSN2 = SUBSTR(SYRECORD,LSS,80)       
SYRECORD = SUBSTR(LSN1,1,48,' ')||LSN2
END                                   
ELSE DO                               
SYACTION = 'CLOSE'                   
END                                   
ADDRESS 'SYNCREXX' 'TAKE'             
RETURN                               


The o/p will be like below in the SORTOUT dataset.


Code:


DEF GDG (NAME(P&CUST.ZK7AT.BPPART)              SCRATCH LIMIT(03))
DEF GDG (NAME(P&CUST.ZK7AT.ORDPREAN)            SCRATCH LIMIT(03))
DEF GDG (NAME(P&CUST.ZK7AT.OTBXREF)             SCRATCH LIMIT(03))
DEF GDG (NAME(P&CUST.BDCSTCDE)                  SCRATCH LIMIT(03))
DEF GDG (NAME(P&CUST.BPPART)                    SCRATCH LIMIT(03))



Thanks
Krishy
Back to top
View user's profile Send private message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Thu Apr 10, 2008 12:32 pm    Post subject:
Reply with quote

Fabulous.

That's great.

I add some simple logic so that it could execute the continue line.

->

LSN0 = SUBSTR(SYRECORD,1,4)
IF LSN0 = ' '
THEN DO
LSB = 0
END
IF LSB <> 0 & LSS <> 0
THEN DO
LSN1 = SUBSTR(SYRECORD,1,LSB)

Thanks a million! Krishy.

And thanks for all of you, cool guy. : P
Back to top
View user's profile Send private message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Thu Apr 10, 2008 12:34 pm    Post subject:
Reply with quote

Forget paste the continue line

->

DEF GDG (NAME(P&CUST.ZK7AT.ORDPREAN) -
SCRATCH LIMIT(03))
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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

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