MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Move records backward

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Sat Feb 14, 2009 7:29 am    Post subject: Move records backward Reply with quote

Hi All,

We get a VB file daily through FTP. I need to check the file if all the records are starting from 1st position.
If not i have move records to first position & leave the file as it is if the all the records are already started in 1st position.

Code:


CHKPT           021320091046096                        5401042
       CCCDAA  0F2FL6540211200914295880087723354010410001
            CCCDAA  0F2FM1540211200914300060089272154010410001
            CCCDAA  0F2FM5540211200914300110058454054010410001
            CCCDAA  0F2FM35402112009143000700D1EC9F54010410001
            CCCDAA  0F2FM0540211200914300050028872454010410001
            CCCDAA  0F2FLP540211200914295970013346854010410001
            CCCCAL  0F2FMC540211200914300130093855554010410001
            CCCDAA  0F2FMJ540211200914300180000000154010410001




Output

Code:


CHKPT           021320091046096                        5401042
CCCDAA  0F2FL6540211200914295880087723354010410001
CCCDAA  0F2FM1540211200914300060089272154010410001
CCCDAA  0F2FM5540211200914300110058454054010410001
CCCDAA  0F2FM35402112009143000700D1EC9F54010410001
CCCDAA  0F2FM0540211200914300050028872454010410001
CCCDAA  0F2FLP540211200914295970013346854010410001
CCCCAL  0F2FMC540211200914300130093855554010410001
CCCDAA  0F2FMJ540211200914300180000000154010410001




Thanks,
Siva
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sat Feb 14, 2009 1:06 pm    Post subject: Reply with quote

You can use a DFSORT job like the following. I assumed your input file has LRECL=80, but the job can be changed appropriately for other LRECLs.

Code:

//S1    EXEC  PGM=SORT                                           
//SYSOUT    DD  SYSOUT=*                                         
//SORTIN DD DSN=...  input file (VB/80)                             
//SORTOUT DD DSN=...  output file (VB/80) 
//SYSIN    DD    *                                               
  OPTION COPY                                                   
  INREC IFTHEN=(WHEN=(5,1,CH,EQ,C' '),                           
    BUILD=(1,4,5,76,JFY=(SHIFT=LEFT)))                           
  OUTFIL VLTRIM=C' '                                             
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Sun Feb 15, 2009 11:39 am    Post subject: Reply with quote

Frank Yaeger,

Thanks for JCL .. I am just amazed by the power of sort

But i have another error of same kind but a minor difference i.e we have extra characters V001.00..... I need to remove as well along with spaces.

Code:


V001.00.....CCDDDA  0F2FL6540211200914295880087723354010410001465
            CCDDDA  0F2FM1540211200914300060089272154010410001465
            CCDDDA  0F2FM0540211200914300050028872454010410001465
V001.00.....CCDDDA  0F2FL6540211200914295880087723354010410001465
            CCDDDA  0F2FM1540211200914300060089272154010410001465
V001.00.....CCDDD   002H92540211200914244190087779125412343802812
            CCDDD   002H92540211200914245400087779125412343802942
            CCDDD   002H92540211200914250040087779125412343803002



output should be

Code:


CCDDDA  0F2FL6540211200914295880087723354010410001465
CCDDDA  0F2FM1540211200914300060089272154010410001465
CCDDDA  0F2FM0540211200914300050028872454010410001465
CCDDDA  0F2FL6540211200914295880087723354010410001465
CCDDDA  0F2FM1540211200914300060089272154010410001465
CCDDD   002H92540211200914244190087779125412343802812
CCDDD   002H92540211200914245400087779125412343802942
CCDDD   002H92540211200914250040087779125412343803002



Thanks,
Siva
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sun Feb 15, 2009 1:17 pm    Post subject: Reply with quote

Here's a DFSORT job for your new requirement:

Code:

//S2    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB/80)
//SORTOUT DD DSN=...  output file (VB/80)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(5,12,CH,EQ,C'V001.00.....'),
    BUILD=(1,4,17)),
   IFTHEN=(WHEN=(5,1,CH,EQ,C' '),
    BUILD=(1,4,5,76,JFY=(SHIFT=LEFT)))
  OUTFIL VLTRIM=C' '
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Mon Feb 16, 2009 5:20 am    Post subject: Reply with quote

Frank Yaeger,

I tried you sort card with FB with LRECL=80 but i was getting below error

Code:


WER108I  SORTIN   : RECFM=FB   ; LRECL=   128; BLKSIZE= 27904     
WER231A  INREC  - ILLEGAL DATA FIELD                               
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                     
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                     




Thanks,
Siva
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Feb 16, 2009 11:21 am    Post subject: Reply with quote

Sigh.

In your first post, you said
Quote:
We get a VB file daily


So I gave you a DFSORT job for a VB input file as requested.

Now you say
Quote:
I tried you sort card with FB with LRECL=80 but i was getting below error


If your input file is FB, why did you say it is VB? The DFSORT job for an FB file would be different.

At any rate, the WER messages indicate you're using Syncsort, not DFSORT. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Mon Feb 16, 2009 11:49 am    Post subject: Reply with quote

Frank Yaeger,

Sorry for that... the other file has FB recfm.

You said
Quote:

The DFSORT job for an FB file would be different


How sort job is differnent from VB file. Just we need to change the position.
But the previous job which you gave for first file ran fine.

If the job is different for FB file . Could you please tell me?

Thanks,
Siva
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Feb 16, 2009 1:01 pm    Post subject: Reply with quote

Quote:
If the job is different for FB file . Could you please tell me?


As I said in my previous post:

Quote:
I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.


I leave the Syncsort answers to the Syncsort people.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Mon Feb 16, 2009 3:00 pm    Post subject: Reply with quote

Hi,
Can anybody give me the syncsort job for above requirement.


Thanks,
siva
Back to top
View user's profile Send private message
Brian Wood
Beginner


Joined: 14 Jan 2009
Posts: 37
Topics: 0
Location: USA

PostPosted: Tue Feb 17, 2009 11:14 am    Post subject: Reply with quote

sivafdms: The suggested coding is appropriate for variable-length data. The first BUILD statement assumes VB data and references the starting position of the remainder of the variable-length data without, of course, specifying the length. If you are now working with FB data, it apppears that all you need to do is define this field to specify both starting position and length.

If you are still encountering dicfficulties, please email your last coding attempt along with the SyncSort message output to zos_tech@syncsort.com.
_________________
Brian Wood
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group