Sort help

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
simo78
Member
Posts: 35
Joined: Tue Aug 11, 2009 12:20 am
Location: Munich

Sort help

Post by simo78 » Sun Sep 28, 2014 6:53 pm

Hello together,

my input file is a gds (ABC.ZTUIDR.CNO113.G001V00) and
I would like to get the following output XNO113_<DATE1>_<TIME1> for example
XNO113_140926_180629.
I tryed this

Code: Select all

//SORT   EXEC PGM=SORT                                                
//SORTIN   DD   *                                                       
ABC.ZTUIDR.CNO113.G0001V00                                              
//SORTOUT  DD   SYSOUT=*,LRECL=80                                       
//SYSOUT   DD   SYSOUT=*                                                
//SYSIN    DD   *                                                       
  OPTION COPY                                                           
  INREC IFTHEN=&#40;WHEN=INIT,                                              
  PARSE=&#40;%01=&#40;ABSPOS=13,ENDBEFR=C'.G',FIXLEN=10&#41;&#41;,                      
  BUILD=&#40;%01&#41;&#41;                                                          
  OUTREC OVERLAY=&#40;90&#58;DATE1,TIME1,60&#58;C'_',92,6,C'_',98,6&#41;                
but I get

Code: Select all

NO113                                                      _140926_180629

Any help is appreciated

Attack1988
Member
Posts: 18
Joined: Tue Apr 15, 2014 4:18 pm

Post by Attack1988 » Mon Sep 29, 2014 2:33 pm

@Simo
Are u sure of this. You have given Date1 and Time1 in 90 ..
It dint abend ?
I think yr variable (after position 13 and before '.G'
have length 10 (5 for NO1113 and 5 for spaces )
so u have to use
extra outfil outrec where u have to squeeze it
to appropraite length ,reformat it .
I cant give it in codes since dont have id to check .ok
Some one give it in codes . or suggest anather method . ^_^[/code]
Attack1988

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Mon Sep 29, 2014 3:21 pm

Attack1988, why do you think it would abend?

SQZ is certainly needed.

Also the PARSE needs extending, to set two dummy parsed field for the first two elements of the DSN.

simo78
Member
Posts: 35
Joined: Tue Aug 11, 2009 12:20 am
Location: Munich

Post by simo78 » Tue Sep 30, 2014 12:02 pm

@Attack1988
The JOB will not abend.

I tryed this,too

Code: Select all

//SORT   EXEC PGM=SORT                                          
//SORTIN   DD   *                                               
ABC.ZTUIDR.CNO113.G0001V00                                      
//SORTOUT  DD   SYSOUT=*,LRECL=80                               
//SYSOUT   DD   SYSOUT=*                                        
//SYSIN    DD   *                                               
  OPTION COPY                                                   
  INREC IFTHEN=&#40;WHEN=INIT,                                      
  PARSE=&#40;%01=&#40;ABSPOS=13,ENDBEFR=C'.G',FIXLEN=10&#41;&#41;,              
  BUILD=&#40;1&#58;C'X',%01&#41;&#41;                                           
  OUTREC OVERLAY=&#40;90&#58;DATE1,TIME1,60&#58;C'_',92,6,C'_',98,6&#41;        
  OUTREC BUILD=&#40;1&#58;C'X',1,80,SQZ=&#40;SHIFT=LEFT&#41;&#41;    



but i don't understand why the SQZ doesn't work.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Tue Sep 30, 2014 3:34 pm

You have two OUTREC statement. That shouldn't work.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others