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
 
PARSE GDG name to separate generation number

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
Abid Hasan

New User


Joined: 25 Mar 2013
Posts: 88
Location: India

PostPosted: Sun Feb 11, 2018 3:40 pm    Post subject: PARSE GDG name to separate generation number
Reply with quote

Hello,

I need to extract DSN from a list of GDG DS.
The input is of the order:

Code:

XXXX.NN.YYYY.GnnnnVmm
XXXXXXXX.NNNN.YYYYYY.AAAAA.BBB.GnnnnVmm
XX.NNN.AAAAA.BBB.GnnnnVmm
---
---
---
and so on....


Expected output:

Code:

XXXX.NN.YYYY
XXXXXXXX.NNNN.YYYYYY.AAAAA.BBB
XX.NNN.AAAAA.BBB
---
---
---
and so on....


This is a relatively simple task, with PARSE, but my *SORT is relatively rusty (having been away from programming for almost an year).
PARSE, ENDBEFR '.G' is not very helpful because '.G' can occur in the DSN as well, for example: XXXX.GYYYY.AAAA.BBBB.GnnnnVmm

Any assistance/guidance with keywords is much appreciated.
Aside, if I had to do it with COBOL, I'd start reading DSN in reverse, checking on space after the DSN, and simply knock off 9 bytes of data after the first character was encountered; have forgotten how to achieve this with *SORT. icon_redface.gif
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10456
Location: italy

PostPosted: Sun Feb 11, 2018 6:09 pm    Post subject: Reply to: PARSE GDG name to separate generation number
Reply with quote

shift right (44 bytes ) shift left ( 35 bytes )
Back to top
View user's profile Send private message
Abid Hasan

New User


Joined: 25 Mar 2013
Posts: 88
Location: India

PostPosted: Mon Feb 12, 2018 3:14 pm    Post subject:
Reply with quote

Hello Enrico,

Thanks a ton, sometimes overthinking leads us astray from the simple and obvious.

Final solution, INREC, JUSTIFY SHIFT=RIGHT, OUTFIL BUILD and drop the additional bytes of data.
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Repeat Sequence Number Until change i... rahulabvp DFSORT/ICETOOL 6 Thu Mar 29, 2018 12:51 pm
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Profile changed to NUMBER ON STD (fro... Martylin TSO/ISPF 1 Thu Aug 03, 2017 9:14 am
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm

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