View previous topic :: View next topic
|
Author |
Message |
sundaram.naveen Warnings : 1 New User
Joined: 06 Oct 2016 Posts: 19 Location: India
|
|
|
|
Hi!
My requirement is I have been given a ps file. Let's say the PS file is a cobol code and it has a key word 'ABC' . I need to verify whether ABC starts from a particular column say 8. If it is not then I need to change it to column 8 and write it in a NEW PS File. Similarly I need to do this for 'EDF' too. So I would like to know how do I get started with this. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
post a sample of the input data, and a sample of the output data
for large datasets REXX is not the best language ,
a <Your SORT> solution might provide a better performance |
|
Back to top |
|
|
sundaram.naveen Warnings : 1 New User
Joined: 06 Oct 2016 Posts: 19 Location: India
|
|
|
|
I want all the PIC clause to start from col40(say). Below is my sample in put and my expected output
******INPUT*******
Code: |
005900 01 SORTED-RECORD.
006000 05 WS-SR-ACCT-NO PIC X(05).
006100 05 FILLER PIC X(05).
006200 05 WS-SR-AMOUNT PIC 9(05).
006300 05 WS-SR-CUST-NAME PIC X(10).
006400 05 FILLER PIC X(55).
|
******OUTPUT*****
Code: |
005900 01 SORTED-RECORD.
006000 05 WS-SR-ACCT-NO PIC X(05).
006100 05 FILLER PIC X(05).
006200 05 WS-SR-AMOUNT PIC 9(05).
006300 05 WS-SR-CUST-NAME PIC X(10).
006400 05 FILLER PIC X(55).
|
The above code is a part of a cobol program. I also need to make sure all the 'TO' variables are starting at col40 too. So it's like a review/correction that needs to be done on the input file and give a final sorted output file |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
Back to top |
|
|
sundaram.naveen Warnings : 1 New User
Joined: 06 Oct 2016 Posts: 19 Location: India
|
|
|
|
can you please help me out ? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
to help You I / we all need to know EXACTLY where You stand as far as the REXX skill level
a Forum is to HELP when somebody find an obstacle,
not to provide step by step guidance in performing a task
how much did You understand of the script I pointed You to ? |
|
Back to top |
|
|
sundaram.naveen Warnings : 1 New User
Joined: 06 Oct 2016 Posts: 19 Location: India
|
|
|
|
I meant what you have done in the script. I told you I am a beginner. I am still learning. I need a heads up or lead from where I could start with the logic |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Look up the functions that del with WORDs and POSitions
That will tell you if the word is on a line and where it is
Split the line and re-assemble with extra/fewer blanks to align as you want
But, what if the position (40) is not blank? Where is the second part of the line to be positioned? A new line? |
|
Back to top |
|
|
sundaram.naveen Warnings : 1 New User
Joined: 06 Oct 2016 Posts: 19 Location: India
|
|
|
|
Yes Nic , a new line. But then we should also identify if the entire string can be accommodated in a single line without changing the starting position of the string. If it fails it then we should move to a new line starting from the variable that needs to come at the 40 position. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
if the question asked is just a small detail of a larger requirement/task
( as You said in Your PM )
which I guess is a COBOL reformatter/normaliser
I think that it is a task above the skill level of a beginner |
|
Back to top |
|
|
|