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

Reformat a file using sort


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

New User


Joined: 03 Feb 2010
Posts: 29
Location: Chennai

PostPosted: Fri Aug 17, 2012 8:36 am
Reply with quote

It is 80 bytes
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: Fri Aug 17, 2012 8:55 am
Reply with quote

Hello,

I have neither the documentation with me nor connectivity to a Syncsort system so i can't test.

PUSH=(81:1,32))
How was this determined?

Sorry i don't just have the answer, bit i'm kinda trying to deal with one error at a time . . . icon_confused.gif
Back to top
View user's profile Send private message
mksranjani

New User


Joined: 03 Feb 2010
Posts: 29
Location: Chennai

PostPosted: Fri Aug 17, 2012 9:02 am
Reply with quote

LRECL is 80 bytes, and the data in first line starts at col 1 with length 32.
Im not sure if this is correct. But I tried like this.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri Aug 17, 2012 9:56 am
Reply with quote

Infact the first push should suffice

Change ID=1 to 1,32

Use INCLUDE/OMIT to pic records that is needed then format GET record

Remove the second ifthen
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Aug 17, 2012 10:08 am
Reply with quote

Hi,

here is a solution as has been suggested
Code:
//STEP0100 EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD *                                                   
ABCDEFG.TXT                                                       
CD AAAAAA                                                         
CD BBBBBB                                                         
CD CCCCCCC                                                         
CD DDDDDDD                                                         
LOCSITE PRI=5 CY SEC=1 CY U=TESTDA REC=FB LR=1402 BLOCKSI=0       
GET                                                   +           
USER.NONX.USER9999.SAMPLE(+1)'                                     
QUIT                                                               
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                   
  OPTION COPY                                                     
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,4,ZD)),               
  IFTHEN=(WHEN=GROUP,BEGIN=(81,4,ZD,EQ,+1),PUSH=(85:1,32))         
  OUTREC IFTHEN=(WHEN=(1,4,CH,EQ,C'GET '),                         
        OVERLAY=(5:85,32))                                         
  OUTFIL OMIT(81,4,ZD,EQ,+1),BUILD=(1,80)                         


Gerry
Back to top
View user's profile Send private message
mksranjani

New User


Joined: 03 Feb 2010
Posts: 29
Location: Chennai

PostPosted: Fri Aug 17, 2012 10:45 am
Reply with quote

Gerry,

I tried the code you provided. Got the output as below. The data in first line is removed but it is not moved near 'get'.
Code:
cd aaaaaa                                                   
cd bbbbbb                                                   
cd ccccccc                                                   
cd ddddddd                                                   
locsite pri=5 cy sec=1 cy u=testda rec=fb lr=1402 blocksi=0 
get                                                       +     
USER.NONX.USER9999.SAMPLE(+1)'                               
quit                             
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Aug 17, 2012 10:58 am
Reply with quote

Hi,

my get is in upper case, try changing it to lower case.


Gerry
Back to top
View user's profile Send private message
mksranjani

New User


Joined: 03 Feb 2010
Posts: 29
Location: Chennai

PostPosted: Fri Aug 17, 2012 11:18 am
Reply with quote

Gerry,

I changed it to lower case, and I got the expected result.
Great and thanks a lot!
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 Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
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
Search our Forums:

Back to Top